From da9e91bde22b4b35f5a0582016320aae15bfe678 Mon Sep 17 00:00:00 2001 From: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> Date: Wed, 3 Mar 2021 14:22:12 -0800 Subject: [PATCH] Add system event converters and fix nullability of CloudEvent properties (#19181) * Add system event converters and fix nullability of CloudEvent properties * API --- sdk/core/Azure.Core/api/Azure.Core.net461.cs | 10 +- sdk/core/Azure.Core/api/Azure.Core.net5.0.cs | 10 +- .../api/Azure.Core.netstandard2.0.cs | 10 +- .../Azure.Core/src/Messaging/CloudEvent.cs | 16 +- ...zure.Messaging.EventGrid.netstandard2.0.cs | 233 ++++++++++++---- .../Customization/SystemEventExtensions.cs | 24 +- .../src/Customization/SystemEventNames.cs | 46 ++-- ...CSChatEventBaseProperties.Serialization.cs | 33 ++- .../Models/ACSChatEventBaseProperties.cs | 18 +- ...hatMemberAddedToThreadWithUserEventData.cs | 43 --- ...emberRemovedFromThreadWithUserEventData.cs | 43 --- ...atMessageDeletedEventData.Serialization.cs | 43 ++- .../Models/ACSChatMessageDeletedEventData.cs | 14 +- ...hatMessageEditedEventData.Serialization.cs | 43 ++- .../Models/ACSChatMessageEditedEventData.cs | 14 +- ...essageEventBaseProperties.Serialization.cs | 43 ++- .../ACSChatMessageEventBaseProperties.cs | 20 +- ...tMessageReceivedEventData.Serialization.cs | 43 ++- .../Models/ACSChatMessageReceivedEventData.cs | 14 +- ...dCreatedWithUserEventData.Serialization.cs | 53 +++- .../ACSChatThreadCreatedWithUserEventData.cs | 30 +-- ...ThreadEventBaseProperties.Serialization.cs | 32 ++- .../ACSChatThreadEventBaseProperties.cs | 12 +- ...hatThreadMemberProperties.Serialization.cs | 35 --- .../Models/ACSChatThreadMemberProperties.cs | 32 --- ...esUpdatedPerUserEventData.Serialization.cs | 43 ++- ...ThreadPropertiesUpdatedPerUserEventData.cs | 20 +- ...dWithUserDeletedEventData.Serialization.cs | 43 ++- .../ACSChatThreadWithUserDeletedEventData.cs | 20 +- ...entInThreadBaseProperties.Serialization.cs | 45 ++++ .../AcsChatEventInThreadBaseProperties.cs | 28 ++ ...eDeletedInThreadEventData.Serialization.cs | 107 ++++++++ .../AcsChatMessageDeletedInThreadEventData.cs | 37 +++ ...geEditedInThreadEventData.Serialization.cs | 113 ++++++++ .../AcsChatMessageEditedInThreadEventData.cs | 41 +++ ...entInThreadBaseProperties.Serialization.cs | 96 +++++++ ...sChatMessageEventInThreadBaseProperties.cs | 51 ++++ ...ReceivedInThreadEventData.Serialization.cs | 102 +++++++ ...AcsChatMessageReceivedInThreadEventData.cs | 37 +++ ...ntAddedToThreadEventData.Serialization.cs} | 51 ++-- ...csChatParticipantAddedToThreadEventData.cs | 43 +++ ...ToThreadWithUserEventData.Serialization.cs | 117 ++++++++ ...rticipantAddedToThreadWithUserEventData.cs | 43 +++ ...emovedFromThreadEventData.Serialization.cs | 89 ++++++ ...atParticipantRemovedFromThreadEventData.cs | 43 +++ ...omThreadWithUserEventData.Serialization.cs | 117 ++++++++ ...ipantRemovedFromThreadWithUserEventData.cs | 43 +++ ...hatThreadCreatedEventData.Serialization.cs | 111 ++++++++ .../Models/AcsChatThreadCreatedEventData.cs | 45 ++++ ...atThreadDeletedEventData.Serialization.cs} | 51 ++-- .../Models/AcsChatThreadDeletedEventData.cs | 37 +++ ...entInThreadBaseProperties.Serialization.cs | 67 +++++ ...csChatThreadEventInThreadBaseProperties.cs | 35 +++ ...readParticipantProperties.Serialization.cs | 56 ++++ .../AcsChatThreadParticipantProperties.cs | 32 +++ ...ropertiesUpdatedEventData.Serialization.cs | 106 ++++++++ ...AcsChatThreadPropertiesUpdatedEventData.cs | 44 +++ ...DeliveryAttemptProperties.Serialization.cs | 15 ++ ...ryReportReceivedEventData.Serialization.cs | 15 ++ ...AcsSmsEventBaseProperties.Serialization.cs | 16 ++ .../AcsSmsReceivedEventData.Serialization.cs | 15 ++ ...nKeyValueDeletedEventData.Serialization.cs | 24 +- ...ppConfigurationKeyValueDeletedEventData.cs | 6 +- ...KeyValueModifiedEventData.Serialization.cs | 24 +- ...pConfigurationKeyValueModifiedEventData.cs | 6 +- .../AppEventTypeDetail.Serialization.cs | 16 ++ ...ervicePlanEventTypeDetail.Serialization.cs | 16 ++ .../CloudEventInternal.Serialization.cs | 15 ++ .../CommunicationCloudEnvironmentModel.cs | 54 ++++ ...municationIdentifierModel.Serialization.cs | 78 ++++++ .../Models/CommunicationIdentifierModel.cs | 40 +++ ...cationUserIdentifierModel.Serialization.cs | 45 ++++ .../CommunicationUserIdentifierModel.cs | 31 +++ ...RegistryArtifactEventData.Serialization.cs | 15 ++ ...gistryArtifactEventTarget.Serialization.cs | 16 ++ ...stryChartDeletedEventData.Serialization.cs | 15 ++ ...istryChartPushedEventData.Serialization.cs | 15 ++ ...ntainerRegistryEventActor.Serialization.cs | 16 ++ ...ontainerRegistryEventData.Serialization.cs | 15 ++ ...ainerRegistryEventRequest.Serialization.cs | 16 ++ ...tainerRegistryEventSource.Serialization.cs | 16 ++ ...tainerRegistryEventTarget.Serialization.cs | 16 ++ ...stryImageDeletedEventData.Serialization.cs | 15 ++ ...istryImagePushedEventData.Serialization.cs | 15 ++ ...eConnectionStateEventInfo.Serialization.cs | 16 ++ ...ctionStateEventProperties.Serialization.cs | 16 ++ ...eLifeCycleEventProperties.Serialization.cs | 16 ++ ...eTelemetryEventProperties.Serialization.cs | 16 ++ .../Models/DeviceTwinInfo.Serialization.cs | 16 ++ .../DeviceTwinInfoProperties.Serialization.cs | 16 ++ ...iceTwinInfoX509Thumbprint.Serialization.cs | 16 ++ .../DeviceTwinMetadata.Serialization.cs | 16 ++ .../DeviceTwinProperties.Serialization.cs | 16 ++ .../EventGridEventInternal.Serialization.cs | 15 ++ ...ptureFileCreatedEventData.Serialization.cs | 15 ++ ...bDeviceConnectedEventData.Serialization.cs | 16 ++ ...HubDeviceCreatedEventData.Serialization.cs | 16 ++ ...HubDeviceDeletedEventData.Serialization.cs | 16 ++ ...viceDisconnectedEventData.Serialization.cs | 16 ++ ...bDeviceTelemetryEventData.Serialization.cs | 16 ++ ...essPolicyChangedEventData.Serialization.cs | 16 ++ ...rtificateExpiredEventData.Serialization.cs | 16 ++ ...ficateNearExpiryEventData.Serialization.cs | 16 ++ ...ewVersionCreatedEventData.Serialization.cs | 16 ++ ...yVaultKeyExpiredEventData.Serialization.cs | 16 ++ ...ultKeyNearExpiryEventData.Serialization.cs | 16 ++ ...ewVersionCreatedEventData.Serialization.cs | 16 ++ ...ultSecretExpiredEventData.Serialization.cs | 16 ++ ...SecretNearExpiryEventData.Serialization.cs | 16 ++ ...ewVersionCreatedEventData.Serialization.cs | 16 ++ ...setDriftDetectedEventData.Serialization.cs | 15 ++ ...cesModelDeployedEventData.Serialization.cs | 16 ++ ...sModelRegisteredEventData.Serialization.cs | 16 ++ ...icesRunCompletedEventData.Serialization.cs | 16 ++ ...RunStatusChangedEventData.Serialization.cs | 16 ++ ...sGeofenceEnteredEventData.Serialization.cs | 16 ++ ...psGeofenceEventProperties.Serialization.cs | 16 ++ ...psGeofenceExitedEventData.Serialization.cs | 16 ++ .../MapsGeofenceGeometry.Serialization.cs | 16 ++ ...psGeofenceResultEventData.Serialization.cs | 16 ++ ...MediaJobCanceledEventData.Serialization.cs | 16 ++ ...ediaJobCancelingEventData.Serialization.cs | 16 ++ .../Models/MediaJobError.Serialization.cs | 16 ++ .../MediaJobErrorDetail.Serialization.cs | 16 ++ .../MediaJobErroredEventData.Serialization.cs | 16 ++ ...MediaJobFinishedEventData.Serialization.cs | 16 ++ .../Models/MediaJobOutput.Serialization.cs | 16 ++ .../MediaJobOutputAsset.Serialization.cs | 16 ++ ...obOutputCanceledEventData.Serialization.cs | 16 ++ ...bOutputCancelingEventData.Serialization.cs | 16 ++ ...JobOutputErroredEventData.Serialization.cs | 16 ++ ...obOutputFinishedEventData.Serialization.cs | 16 ++ ...OutputProcessingEventData.Serialization.cs | 16 ++ ...obOutputProgressEventData.Serialization.cs | 16 ++ ...bOutputScheduledEventData.Serialization.cs | 16 ++ ...utputStateChangeEventData.Serialization.cs | 16 ++ ...diaJobProcessingEventData.Serialization.cs | 16 ++ ...ediaJobScheduledEventData.Serialization.cs | 16 ++ ...iaJobStateChangeEventData.Serialization.cs | 16 ++ ...nnectionRejectedEventData.Serialization.cs | 16 ++ ...EncoderConnectedEventData.Serialization.cs | 16 ++ ...oderDisconnectedEventData.Serialization.cs | 16 ++ ...DataChunkDroppedEventData.Serialization.cs | 16 ++ ...ngStreamReceivedEventData.Serialization.cs | 16 ++ ...StreamsOutOfSyncEventData.Serialization.cs | 16 ++ ...StreamsOutOfSyncEventData.Serialization.cs | 16 ++ ...tIngestHeartbeatEventData.Serialization.cs | 16 ++ ...ntinuityDetectedEventData.Serialization.cs | 16 ++ ...tTeamsUserIdentifierModel.Serialization.cs | 67 +++++ .../MicrosoftTeamsUserIdentifierModel.cs | 46 ++++ ...honeNumberIdentifierModel.Serialization.cs | 45 ++++ .../Models/PhoneNumberIdentifierModel.cs | 31 +++ ...portRDBCompletedEventData.Serialization.cs | 15 ++ ...portRDBCompletedEventData.Serialization.cs | 15 ++ ...atchingCompletedEventData.Serialization.cs | 15 ++ ...ScalingCompletedEventData.Serialization.cs | 15 ++ .../ResourceActionCancelData.Serialization.cs | 16 ++ ...ResourceActionFailureData.Serialization.cs | 16 ++ ...ResourceActionSuccessData.Serialization.cs | 16 ++ .../ResourceDeleteCancelData.Serialization.cs | 16 ++ ...ResourceDeleteFailureData.Serialization.cs | 16 ++ ...ResourceDeleteSuccessData.Serialization.cs | 16 ++ .../ResourceWriteCancelData.Serialization.cs | 16 ++ .../ResourceWriteFailureData.Serialization.cs | 16 ++ .../ResourceWriteSuccessData.Serialization.cs | 16 ++ ...dicNotificationsEventData.Serialization.cs | 75 ++++++ ...AvailablePeriodicNotificationsEventData.cs | 48 ++++ ...eWithNoListenersEventData.Serialization.cs | 16 ++ ...dicNotificationsEventData.Serialization.cs | 75 ++++++ ...AvailablePeriodicNotificationsEventData.cs | 48 ++++ ...eWithNoListenersEventData.Serialization.cs | 16 ++ ...nectionConnectedEventData.Serialization.cs | 15 ++ ...tionDisconnectedEventData.Serialization.cs | 15 ++ ...orageBlobCreatedEventData.Serialization.cs | 16 ++ ...orageBlobDeletedEventData.Serialization.cs | 16 ++ ...orageBlobRenamedEventData.Serialization.cs | 16 ++ ...DirectoryCreatedEventData.Serialization.cs | 16 ++ ...DirectoryDeletedEventData.Serialization.cs | 16 ++ ...DirectoryRenamedEventData.Serialization.cs | 16 ++ ...PolicyActionSummaryDetail.Serialization.cs | 16 ++ ...ePolicyCompletedEventData.Serialization.cs | 16 ++ ...scriptionDeletedEventData.Serialization.cs | 16 ++ ...iptionValidationEventData.Serialization.cs | 16 ++ ...riptionValidationResponse.Serialization.cs | 16 ++ ...rvicePlanUpdatedEventData.Serialization.cs | 16 ++ ...cePlanUpdatedEventDataSku.Serialization.cs | 16 ++ .../WebAppUpdatedEventData.Serialization.cs | 16 ++ ...erationCompletedEventData.Serialization.cs | 16 ++ ...pOperationFailedEventData.Serialization.cs | 16 ++ ...OperationStartedEventData.Serialization.cs | 16 ++ ...erationCompletedEventData.Serialization.cs | 16 ++ ...eOperationFailedEventData.Serialization.cs | 16 ++ ...OperationStartedEventData.Serialization.cs | 16 ++ ...lotSwapCompletedEventData.Serialization.cs | 16 ++ ...ebSlotSwapFailedEventData.Serialization.cs | 16 ++ ...bSlotSwapStartedEventData.Serialization.cs | 16 ++ ...PreviewCancelledEventData.Serialization.cs | 16 ++ ...thPreviewStartedEventData.Serialization.cs | 16 ++ .../Azure.Messaging.EventGrid/src/autorest.md | 10 +- .../tests/ConsumeEventTests.cs | 255 ++++++++++-------- 200 files changed, 5207 insertions(+), 593 deletions(-) delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMemberAddedToThreadWithUserEventData.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMemberRemovedFromThreadWithUserEventData.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadMemberProperties.Serialization.cs delete mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadMemberProperties.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatEventInThreadBaseProperties.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatEventInThreadBaseProperties.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageDeletedInThreadEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageDeletedInThreadEventData.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEditedInThreadEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEditedInThreadEventData.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEventInThreadBaseProperties.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEventInThreadBaseProperties.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageReceivedInThreadEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageReceivedInThreadEventData.cs rename sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/{ACSChatMemberRemovedFromThreadWithUserEventData.Serialization.cs => AcsChatParticipantAddedToThreadEventData.Serialization.cs} (52%) create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantAddedToThreadEventData.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantAddedToThreadWithUserEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantAddedToThreadWithUserEventData.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantRemovedFromThreadEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantRemovedFromThreadEventData.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantRemovedFromThreadWithUserEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantRemovedFromThreadWithUserEventData.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadCreatedEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadCreatedEventData.cs rename sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/{ACSChatMemberAddedToThreadWithUserEventData.Serialization.cs => AcsChatThreadDeletedEventData.Serialization.cs} (55%) create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadDeletedEventData.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadEventInThreadBaseProperties.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadEventInThreadBaseProperties.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadParticipantProperties.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadParticipantProperties.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadPropertiesUpdatedEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadPropertiesUpdatedEventData.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CommunicationCloudEnvironmentModel.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CommunicationIdentifierModel.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CommunicationIdentifierModel.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CommunicationUserIdentifierModel.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CommunicationUserIdentifierModel.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MicrosoftTeamsUserIdentifierModel.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MicrosoftTeamsUserIdentifierModel.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/PhoneNumberIdentifierModel.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/PhoneNumberIdentifierModel.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData.cs diff --git a/sdk/core/Azure.Core/api/Azure.Core.net461.cs b/sdk/core/Azure.Core/api/Azure.Core.net461.cs index d63632445e784..bd6368f8acc75 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.net461.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.net461.cs @@ -576,17 +576,17 @@ namespace Azure.Messaging { public partial class CloudEvent { - public CloudEvent(string source, string type, System.BinaryData data, string dataContentType, Azure.Messaging.CloudEventDataFormat dataFormat = Azure.Messaging.CloudEventDataFormat.Binary) { } - public CloudEvent(string source, string type, object jsonSerializableData, System.Type? dataSerializationType = null) { } + public CloudEvent(string source, string type, System.BinaryData? data, string? dataContentType, Azure.Messaging.CloudEventDataFormat dataFormat = Azure.Messaging.CloudEventDataFormat.Binary) { } + public CloudEvent(string source, string type, object? jsonSerializableData, System.Type? dataSerializationType = null) { } public System.BinaryData? Data { get { throw null; } set { } } public string? DataContentType { get { throw null; } set { } } public string? DataSchema { get { throw null; } set { } } public System.Collections.Generic.IDictionary ExtensionAttributes { get { throw null; } } - public string Id { get { throw null; } set { } } - public string Source { get { throw null; } set { } } + public string? Id { get { throw null; } set { } } + public string? Source { get { throw null; } set { } } public string? Subject { get { throw null; } set { } } public System.DateTimeOffset? Time { get { throw null; } set { } } - public string Type { get { throw null; } set { } } + public string? Type { get { throw null; } set { } } public static Azure.Messaging.CloudEvent? Parse(System.BinaryData jsonEvent, bool skipValidation = false) { throw null; } public static Azure.Messaging.CloudEvent[] ParseEvents(string jsonContent, bool skipValidation = false) { throw null; } } diff --git a/sdk/core/Azure.Core/api/Azure.Core.net5.0.cs b/sdk/core/Azure.Core/api/Azure.Core.net5.0.cs index 4e0f955a03af8..c5790f30903ac 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.net5.0.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.net5.0.cs @@ -576,17 +576,17 @@ namespace Azure.Messaging { public partial class CloudEvent { - public CloudEvent(string source, string type, System.BinaryData data, string dataContentType, Azure.Messaging.CloudEventDataFormat dataFormat = Azure.Messaging.CloudEventDataFormat.Binary) { } - public CloudEvent(string source, string type, object jsonSerializableData, System.Type? dataSerializationType = null) { } + public CloudEvent(string source, string type, System.BinaryData? data, string? dataContentType, Azure.Messaging.CloudEventDataFormat dataFormat = Azure.Messaging.CloudEventDataFormat.Binary) { } + public CloudEvent(string source, string type, object? jsonSerializableData, System.Type? dataSerializationType = null) { } public System.BinaryData? Data { get { throw null; } set { } } public string? DataContentType { get { throw null; } set { } } public string? DataSchema { get { throw null; } set { } } public System.Collections.Generic.IDictionary ExtensionAttributes { get { throw null; } } - public string Id { get { throw null; } set { } } - public string Source { get { throw null; } set { } } + public string? Id { get { throw null; } set { } } + public string? Source { get { throw null; } set { } } public string? Subject { get { throw null; } set { } } public System.DateTimeOffset? Time { get { throw null; } set { } } - public string Type { get { throw null; } set { } } + public string? Type { get { throw null; } set { } } public static Azure.Messaging.CloudEvent? Parse(System.BinaryData jsonEvent, bool skipValidation = false) { throw null; } public static Azure.Messaging.CloudEvent[] ParseEvents(string jsonContent, bool skipValidation = false) { throw null; } } diff --git a/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs b/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs index d63632445e784..bd6368f8acc75 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs @@ -576,17 +576,17 @@ namespace Azure.Messaging { public partial class CloudEvent { - public CloudEvent(string source, string type, System.BinaryData data, string dataContentType, Azure.Messaging.CloudEventDataFormat dataFormat = Azure.Messaging.CloudEventDataFormat.Binary) { } - public CloudEvent(string source, string type, object jsonSerializableData, System.Type? dataSerializationType = null) { } + public CloudEvent(string source, string type, System.BinaryData? data, string? dataContentType, Azure.Messaging.CloudEventDataFormat dataFormat = Azure.Messaging.CloudEventDataFormat.Binary) { } + public CloudEvent(string source, string type, object? jsonSerializableData, System.Type? dataSerializationType = null) { } public System.BinaryData? Data { get { throw null; } set { } } public string? DataContentType { get { throw null; } set { } } public string? DataSchema { get { throw null; } set { } } public System.Collections.Generic.IDictionary ExtensionAttributes { get { throw null; } } - public string Id { get { throw null; } set { } } - public string Source { get { throw null; } set { } } + public string? Id { get { throw null; } set { } } + public string? Source { get { throw null; } set { } } public string? Subject { get { throw null; } set { } } public System.DateTimeOffset? Time { get { throw null; } set { } } - public string Type { get { throw null; } set { } } + public string? Type { get { throw null; } set { } } public static Azure.Messaging.CloudEvent? Parse(System.BinaryData jsonEvent, bool skipValidation = false) { throw null; } public static Azure.Messaging.CloudEvent[] ParseEvents(string jsonContent, bool skipValidation = false) { throw null; } } diff --git a/sdk/core/Azure.Core/src/Messaging/CloudEvent.cs b/sdk/core/Azure.Core/src/Messaging/CloudEvent.cs index bbc059d33d942..b0dfd6bfb1f94 100644 --- a/sdk/core/Azure.Core/src/Messaging/CloudEvent.cs +++ b/sdk/core/Azure.Core/src/Messaging/CloudEvent.cs @@ -19,7 +19,7 @@ public class CloudEvent /// Event data specific to the event type. /// The type to use when serializing the data. /// If not specified, will be used on . - public CloudEvent(string source, string type, object jsonSerializableData, Type? dataSerializationType = default) + public CloudEvent(string source, string type, object? jsonSerializableData, Type? dataSerializationType = default) { if (jsonSerializableData is BinaryData) { @@ -39,7 +39,7 @@ public CloudEvent(string source, string type, object jsonSerializableData, Type? /// Binary event data specific to the event type. /// Content type of the payload. A content type different from "application/json" should be specified if payload is not JSON. /// - public CloudEvent(string source, string type, BinaryData data, string dataContentType, CloudEventDataFormat dataFormat = CloudEventDataFormat.Binary) + public CloudEvent(string source, string type, BinaryData? data, string? dataContentType, CloudEventDataFormat dataFormat = CloudEventDataFormat.Binary) { Source = source; Type = type; @@ -62,11 +62,11 @@ internal CloudEvent() { } /// Gets or sets an identifier for the event. The combination of and must be unique for each distinct event. /// If not explicitly set, this will default to a . /// - public string Id + public string? Id { get { - return _id!; + return _id; } set { @@ -80,11 +80,11 @@ public string Id /// Gets or sets the context in which an event happened. The combination of /// and must be unique for each distinct event. - public string Source + public string? Source { get { - return _source!; + return _source; } set { @@ -95,11 +95,11 @@ public string Source private string? _source; /// Gets or sets the type of event related to the originating occurrence. - public string Type + public string? Type { get { - return _type!; + return _type; } set { 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 2c4538e9ad11f..6ad4d13068fd3 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 @@ -54,15 +54,17 @@ public EventGridSasBuilder(System.Uri endpoint, System.DateTimeOffset expiresOn) } public static partial class SystemEventNames { - public const string ACSChatMemberAddedToThreadWithUser = "Microsoft.Communication.ChatMemberAddedToThreadWithUser"; - public const string ACSChatMemberRemovedFromThreadWithUser = "Microsoft.Communication.ChatMemberRemovedFromThreadWithUser"; - public const string ACSChatMessageDeleted = "Microsoft.Communication.ChatMessageDeleted"; - public const string ACSChatMessageEdited = "Microsoft.Communication.ChatMessageEdited"; - public const string ACSChatMessageReceived = "Microsoft.Communication.ChatMessageReceived"; - public const string ACSChatThreadCreatedWithUser = "Microsoft.Communication.ChatThreadCreatedWithUser"; - public const string ACSChatThreadPropertiesUpdatedPerUser = "Microsoft.Communication.ChatThreadPropertiesUpdatedPerUser"; - public const string ACSChatThreadWithUserDeleted = "Microsoft.Communication.ChatThreadWithUserDeleted"; - public const string ACSSMSDeliveryReportReceived = "Microsoft.Communication.SMSDeliveryReportReceived"; + public const string AcsChatMessageDeleted = "Microsoft.Communication.ChatMessageDeleted"; + public const string AcsChatMessageEdited = "Microsoft.Communication.ChatMessageEdited"; + public const string AcsChatMessageReceived = "Microsoft.Communication.ChatMessageReceived"; + public const string AcsChatParticipantAddedToThread = "Microsoft.Communication.ChatParticipantAddedToThread"; + public const string AcsChatParticipantAddedToThreadWithUser = "Microsoft.Communication.ChatParticipantAddedToThreadWithUser"; + public const string AcsChatParticipantRemovedFromThread = "Microsoft.Communication.ChatParticipantRemovedFromThread"; + public const string AcsChatParticipantRemovedFromThreadWithUser = "Microsoft.Communication.ChatParticipantRemovedFromThreadWithUser"; + public const string AcsChatThreadCreatedWithUser = "Microsoft.Communication.ChatThreadCreatedWithUser"; + public const string AcsChatThreadPropertiesUpdatedPerUser = "Microsoft.Communication.ChatThreadPropertiesUpdatedPerUser"; + public const string AcsChatThreadWithUserDeleted = "Microsoft.Communication.ChatThreadWithUserDeleted"; + public const string AcsSmsDeliveryReportReceived = "Microsoft.Communication.SMSDeliveryReportReceived"; public const string ACSSMSReceived = "Microsoft.Communication.SMSReceived"; public const string AppConfigurationKeyValueDeleted = "Microsoft.AppConfiguration.KeyValueDeleted"; public const string AppConfigurationKeyValueModified = "Microsoft.AppConfiguration.KeyValueModified"; @@ -155,83 +157,156 @@ public static partial class SystemEventNames } namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ACSChatEventBaseProperties + public partial class AcsChatEventBaseProperties { - internal ACSChatEventBaseProperties() { } - public string RecipientId { get { throw null; } } + internal AcsChatEventBaseProperties() { } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel RecipientCommunicationIdentifier { get { throw null; } } public string ThreadId { get { throw null; } } public string TransactionId { get { throw null; } } } - public partial class ACSChatMemberAddedToThreadWithUserEventData : Azure.Messaging.EventGrid.SystemEvents.ACSChatThreadEventBaseProperties + public partial class AcsChatEventInThreadBaseProperties { - internal ACSChatMemberAddedToThreadWithUserEventData() { } - public string AddedBy { get { throw null; } } - public Azure.Messaging.EventGrid.SystemEvents.ACSChatThreadMemberProperties MemberAdded { get { throw null; } } - public System.DateTimeOffset? Time { get { throw null; } } + internal AcsChatEventInThreadBaseProperties() { } + public string ThreadId { get { throw null; } } } - public partial class ACSChatMemberRemovedFromThreadWithUserEventData : Azure.Messaging.EventGrid.SystemEvents.ACSChatThreadEventBaseProperties + public partial class AcsChatMessageDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventBaseProperties { - internal ACSChatMemberRemovedFromThreadWithUserEventData() { } - public Azure.Messaging.EventGrid.SystemEvents.ACSChatThreadMemberProperties MemberRemoved { get { throw null; } } - public string RemovedBy { get { throw null; } } - public System.DateTimeOffset? Time { get { throw null; } } + internal AcsChatMessageDeletedEventData() { } + public System.DateTimeOffset? DeleteTime { get { throw null; } } } - public partial class ACSChatMessageDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.ACSChatMessageEventBaseProperties + public partial class AcsChatMessageDeletedInThreadEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventInThreadBaseProperties { - internal ACSChatMessageDeletedEventData() { } + internal AcsChatMessageDeletedInThreadEventData() { } public System.DateTimeOffset? DeleteTime { get { throw null; } } } - public partial class ACSChatMessageEditedEventData : Azure.Messaging.EventGrid.SystemEvents.ACSChatMessageEventBaseProperties + public partial class AcsChatMessageEditedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventBaseProperties { - internal ACSChatMessageEditedEventData() { } + internal AcsChatMessageEditedEventData() { } public System.DateTimeOffset? EditTime { get { throw null; } } public string MessageBody { get { throw null; } } } - public partial class ACSChatMessageEventBaseProperties : Azure.Messaging.EventGrid.SystemEvents.ACSChatEventBaseProperties + public partial class AcsChatMessageEditedInThreadEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventInThreadBaseProperties { - internal ACSChatMessageEventBaseProperties() { } + internal AcsChatMessageEditedInThreadEventData() { } + public System.DateTimeOffset? EditTime { get { throw null; } } + public string MessageBody { get { throw null; } } + } + public partial class AcsChatMessageEventBaseProperties : Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties + { + internal AcsChatMessageEventBaseProperties() { } public System.DateTimeOffset? ComposeTime { get { throw null; } } public string MessageId { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel SenderCommunicationIdentifier { get { throw null; } } public string SenderDisplayName { get { throw null; } } - public string SenderId { get { throw null; } } public string Type { get { throw null; } } public long? Version { get { throw null; } } } - public partial class ACSChatMessageReceivedEventData : Azure.Messaging.EventGrid.SystemEvents.ACSChatMessageEventBaseProperties + public partial class AcsChatMessageEventInThreadBaseProperties : Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties { - internal ACSChatMessageReceivedEventData() { } + internal AcsChatMessageEventInThreadBaseProperties() { } + public System.DateTimeOffset? ComposeTime { get { throw null; } } + public string MessageId { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel SenderCommunicationIdentifier { get { throw null; } } + public string SenderDisplayName { get { throw null; } } + public string Type { get { throw null; } } + public long? Version { get { throw null; } } + } + public partial class AcsChatMessageReceivedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventBaseProperties + { + internal AcsChatMessageReceivedEventData() { } + public string MessageBody { get { throw null; } } + } + public partial class AcsChatMessageReceivedInThreadEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatMessageEventInThreadBaseProperties + { + internal AcsChatMessageReceivedInThreadEventData() { } public string MessageBody { get { throw null; } } } - public partial class ACSChatThreadCreatedWithUserEventData : Azure.Messaging.EventGrid.SystemEvents.ACSChatThreadEventBaseProperties + public partial class AcsChatParticipantAddedToThreadEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties { - internal ACSChatThreadCreatedWithUserEventData() { } - public string CreatedBy { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Members { get { throw null; } } + internal AcsChatParticipantAddedToThreadEventData() { } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel AddedByCommunicationIdentifier { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties ParticipantAdded { get { throw null; } } + public System.DateTimeOffset? Time { get { throw null; } } + public long? Version { get { throw null; } } + } + public partial class AcsChatParticipantAddedToThreadWithUserEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventBaseProperties + { + internal AcsChatParticipantAddedToThreadWithUserEventData() { } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel AddedByCommunicationIdentifier { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties ParticipantAdded { get { throw null; } } + public System.DateTimeOffset? Time { get { throw null; } } + } + public partial class AcsChatParticipantRemovedFromThreadEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties + { + internal AcsChatParticipantRemovedFromThreadEventData() { } + public Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties ParticipantRemoved { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel RemovedByCommunicationIdentifier { get { throw null; } } + public System.DateTimeOffset? Time { get { throw null; } } + public long? Version { get { throw null; } } + } + public partial class AcsChatParticipantRemovedFromThreadWithUserEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventBaseProperties + { + internal AcsChatParticipantRemovedFromThreadWithUserEventData() { } + public Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadParticipantProperties ParticipantRemoved { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel RemovedByCommunicationIdentifier { get { throw null; } } + public System.DateTimeOffset? Time { get { throw null; } } + } + public partial class AcsChatThreadCreatedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventInThreadBaseProperties + { + internal AcsChatThreadCreatedEventData() { } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel CreatedByCommunicationIdentifier { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Participants { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Properties { get { throw null; } } } - public partial class ACSChatThreadEventBaseProperties : Azure.Messaging.EventGrid.SystemEvents.ACSChatEventBaseProperties + public partial class AcsChatThreadCreatedWithUserEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventBaseProperties + { + internal AcsChatThreadCreatedWithUserEventData() { } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel CreatedByCommunicationIdentifier { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Participants { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Properties { get { throw null; } } + } + public partial class AcsChatThreadDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventInThreadBaseProperties + { + internal AcsChatThreadDeletedEventData() { } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel DeletedByCommunicationIdentifier { get { throw null; } } + public System.DateTimeOffset? DeleteTime { get { throw null; } } + } + public partial class AcsChatThreadEventBaseProperties : Azure.Messaging.EventGrid.SystemEvents.AcsChatEventBaseProperties + { + internal AcsChatThreadEventBaseProperties() { } + public System.DateTimeOffset? CreateTime { get { throw null; } } + public long? Version { get { throw null; } } + } + public partial class AcsChatThreadEventInThreadBaseProperties : Azure.Messaging.EventGrid.SystemEvents.AcsChatEventInThreadBaseProperties { - internal ACSChatThreadEventBaseProperties() { } + internal AcsChatThreadEventInThreadBaseProperties() { } public System.DateTimeOffset? CreateTime { get { throw null; } } public long? Version { get { throw null; } } } - public partial class ACSChatThreadMemberProperties + public partial class AcsChatThreadParticipantProperties { - internal ACSChatThreadMemberProperties() { } + internal AcsChatThreadParticipantProperties() { } public string DisplayName { get { throw null; } } - public string MemberId { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel ParticipantCommunicationIdentifier { get { throw null; } } + } + public partial class AcsChatThreadPropertiesUpdatedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventInThreadBaseProperties + { + internal AcsChatThreadPropertiesUpdatedEventData() { } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel EditedByCommunicationIdentifier { get { throw null; } } + public System.DateTimeOffset? EditTime { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Properties { get { throw null; } } } - public partial class ACSChatThreadPropertiesUpdatedPerUserEventData : Azure.Messaging.EventGrid.SystemEvents.ACSChatThreadEventBaseProperties + public partial class AcsChatThreadPropertiesUpdatedPerUserEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventBaseProperties { - internal ACSChatThreadPropertiesUpdatedPerUserEventData() { } - public string EditedBy { get { throw null; } } + internal AcsChatThreadPropertiesUpdatedPerUserEventData() { } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel EditedByCommunicationIdentifier { get { throw null; } } public System.DateTimeOffset? EditTime { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Properties { get { throw null; } } } - public partial class ACSChatThreadWithUserDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.ACSChatThreadEventBaseProperties + public partial class AcsChatThreadWithUserDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsChatThreadEventBaseProperties { - internal ACSChatThreadWithUserDeletedEventData() { } - public string DeletedBy { get { throw null; } } + internal AcsChatThreadWithUserDeletedEventData() { } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationIdentifierModel DeletedByCommunicationIdentifier { get { throw null; } } public System.DateTimeOffset? DeleteTime { get { throw null; } } } public partial class AcsSmsDeliveryAttemptProperties @@ -290,6 +365,7 @@ internal AppConfigurationKeyValueDeletedEventData() { } public string Etag { get { throw null; } } public string Key { get { throw null; } } public string Label { get { throw null; } } + public string SyncToken { get { throw null; } } } public partial class AppConfigurationKeyValueModifiedEventData { @@ -297,6 +373,7 @@ internal AppConfigurationKeyValueModifiedEventData() { } public string Etag { get { throw null; } } public string Key { get { throw null; } } public string Label { get { throw null; } } + public string SyncToken { get { throw null; } } } public partial class AppEventTypeDetail { @@ -346,6 +423,38 @@ internal AppServicePlanEventTypeDetail() { } public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.AsyncStatus left, Azure.Messaging.EventGrid.SystemEvents.AsyncStatus right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CommunicationCloudEnvironmentModel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CommunicationCloudEnvironmentModel(string value) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel Dod { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel Gcch { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel Public { get { throw null; } } + public bool Equals(Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel left, Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel right) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel (string value) { throw null; } + public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel left, Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CommunicationIdentifierModel + { + internal CommunicationIdentifierModel() { } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationUserIdentifierModel CommunicationUser { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel MicrosoftTeamsUser { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.PhoneNumberIdentifierModel PhoneNumber { get { throw null; } } + public string RawId { get { throw null; } } + } + public partial class CommunicationUserIdentifierModel + { + internal CommunicationUserIdentifierModel() { } + public string Id { get { throw null; } } + } public partial class ContainerRegistryArtifactEventData { internal ContainerRegistryArtifactEventData() { } @@ -941,6 +1050,18 @@ internal MediaLiveEventTrackDiscontinuityDetectedEventData() { } public string TrackName { get { throw null; } } public string TrackType { get { throw null; } } } + public partial class MicrosoftTeamsUserIdentifierModel + { + internal MicrosoftTeamsUserIdentifierModel() { } + public Azure.Messaging.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel? Cloud { get { throw null; } } + public bool? IsAnonymous { get { throw null; } } + public string UserId { get { throw null; } } + } + public partial class PhoneNumberIdentifierModel + { + internal PhoneNumberIdentifierModel() { } + public string Value { get { throw null; } } + } public partial class RedisExportRDBCompletedEventData { internal RedisExportRDBCompletedEventData() { } @@ -1104,6 +1225,16 @@ internal ResourceWriteSuccessData() { } public string SubscriptionId { get { throw null; } } public string TenantId { get { throw null; } } } + public partial class ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData + { + internal ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData() { } + public string EntityType { get { throw null; } } + public string NamespaceName { get { throw null; } } + public string QueueName { get { throw null; } } + public string RequestUri { get { throw null; } } + public string SubscriptionName { get { throw null; } } + public string TopicName { get { throw null; } } + } public partial class ServiceBusActiveMessagesAvailableWithNoListenersEventData { internal ServiceBusActiveMessagesAvailableWithNoListenersEventData() { } @@ -1114,6 +1245,16 @@ internal ServiceBusActiveMessagesAvailableWithNoListenersEventData() { } public string SubscriptionName { get { throw null; } } public string TopicName { get { throw null; } } } + public partial class ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData + { + internal ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData() { } + public string EntityType { get { throw null; } } + public string NamespaceName { get { throw null; } } + public string QueueName { get { throw null; } } + public string RequestUri { get { throw null; } } + public string SubscriptionName { get { throw null; } } + public string TopicName { get { throw null; } } + } public partial class ServiceBusDeadletterMessagesAvailableWithNoListenersEventData { internal ServiceBusDeadletterMessagesAvailableWithNoListenersEventData() { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/SystemEventExtensions.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/SystemEventExtensions.cs index 384ab08f40d08..7f1d42df3ac8e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/SystemEventExtensions.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/SystemEventExtensions.cs @@ -12,7 +12,7 @@ internal class SystemEventExtensions { public static object AsSystemEventData(string eventType, JsonElement data) { - if (SystemEventDeserializers.TryGetValue(eventType, out Func systemDeserializationFunction)) + if (s_systemEventDeserializers.TryGetValue(eventType, out Func systemDeserializationFunction)) { return systemDeserializationFunction(data); } @@ -22,7 +22,7 @@ public static object AsSystemEventData(string eventType, JsonElement data) } } - public static readonly IReadOnlyDictionary> SystemEventDeserializers = new Dictionary>(StringComparer.OrdinalIgnoreCase) + private static readonly IReadOnlyDictionary> s_systemEventDeserializers = new Dictionary>(StringComparer.OrdinalIgnoreCase) { // KEEP THIS SORTED BY THE NAME OF THE PUBLISHING SERVICE // Add handling for additional event types here. @@ -32,15 +32,17 @@ public static object AsSystemEventData(string eventType, JsonElement data) { SystemEventNames.AppConfigurationKeyValueModified, AppConfigurationKeyValueModifiedEventData.DeserializeAppConfigurationKeyValueModifiedEventData }, // Communication events - { SystemEventNames.ACSChatMemberAddedToThreadWithUser, ACSChatMemberAddedToThreadWithUserEventData.DeserializeACSChatMemberAddedToThreadWithUserEventData }, - { SystemEventNames.ACSChatMemberRemovedFromThreadWithUser, ACSChatMemberRemovedFromThreadWithUserEventData.DeserializeACSChatMemberRemovedFromThreadWithUserEventData }, - { SystemEventNames.ACSChatMessageDeleted, ACSChatMessageDeletedEventData.DeserializeACSChatMessageDeletedEventData }, - { SystemEventNames.ACSChatMessageEdited, ACSChatMessageEditedEventData.DeserializeACSChatMessageEditedEventData }, - { SystemEventNames.ACSChatMessageReceived, ACSChatMessageReceivedEventData.DeserializeACSChatMessageReceivedEventData }, - { SystemEventNames.ACSChatThreadCreatedWithUser, ACSChatThreadCreatedWithUserEventData.DeserializeACSChatThreadCreatedWithUserEventData }, - { SystemEventNames.ACSChatThreadPropertiesUpdatedPerUser, ACSChatThreadPropertiesUpdatedPerUserEventData.DeserializeACSChatThreadPropertiesUpdatedPerUserEventData }, - { SystemEventNames.ACSChatThreadWithUserDeleted, ACSChatThreadWithUserDeletedEventData.DeserializeACSChatThreadWithUserDeletedEventData }, - { SystemEventNames.ACSSMSDeliveryReportReceived, AcsSmsDeliveryReportReceivedEventData.DeserializeAcsSmsDeliveryReportReceivedEventData }, + { SystemEventNames.AcsChatParticipantAddedToThread, AcsChatParticipantAddedToThreadEventData.DeserializeAcsChatParticipantAddedToThreadEventData }, + { SystemEventNames.AcsChatParticipantAddedToThreadWithUser, AcsChatParticipantAddedToThreadWithUserEventData.DeserializeAcsChatParticipantAddedToThreadWithUserEventData }, + { SystemEventNames.AcsChatParticipantRemovedFromThread, AcsChatParticipantRemovedFromThreadEventData.DeserializeAcsChatParticipantRemovedFromThreadEventData }, + { SystemEventNames.AcsChatParticipantRemovedFromThreadWithUser, AcsChatParticipantRemovedFromThreadWithUserEventData.DeserializeAcsChatParticipantRemovedFromThreadWithUserEventData }, + { SystemEventNames.AcsChatMessageDeleted, AcsChatMessageDeletedEventData.DeserializeAcsChatMessageDeletedEventData }, + { SystemEventNames.AcsChatMessageEdited, AcsChatMessageEditedEventData.DeserializeAcsChatMessageEditedEventData }, + { SystemEventNames.AcsChatMessageReceived, AcsChatMessageReceivedEventData.DeserializeAcsChatMessageReceivedEventData }, + { SystemEventNames.AcsChatThreadCreatedWithUser, AcsChatThreadCreatedWithUserEventData.DeserializeAcsChatThreadCreatedWithUserEventData }, + { SystemEventNames.AcsChatThreadPropertiesUpdatedPerUser, AcsChatThreadPropertiesUpdatedPerUserEventData.DeserializeAcsChatThreadPropertiesUpdatedPerUserEventData }, + { SystemEventNames.AcsChatThreadWithUserDeleted, AcsChatThreadWithUserDeletedEventData.DeserializeAcsChatThreadWithUserDeletedEventData }, + { SystemEventNames.AcsSmsDeliveryReportReceived, AcsSmsDeliveryReportReceivedEventData.DeserializeAcsSmsDeliveryReportReceivedEventData }, { SystemEventNames.ACSSMSReceived, AcsSmsReceivedEventData.DeserializeAcsSmsReceivedEventData }, // ContainerRegistry events diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/SystemEventNames.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/SystemEventNames.cs index b36b51806a0a0..0a3c024ebdf23 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/SystemEventNames.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/SystemEventNames.cs @@ -30,57 +30,69 @@ public static class SystemEventNames #region Communication events /// /// The value of the Event Type stored in and for the - /// system event. + /// system event. /// - public const string ACSChatMemberAddedToThreadWithUser = "Microsoft.Communication.ChatMemberAddedToThreadWithUser"; + public const string AcsChatParticipantAddedToThread = "Microsoft.Communication.ChatParticipantAddedToThread"; /// /// The value of the Event Type stored in and for the - /// system event. + /// system event. /// - public const string ACSChatMemberRemovedFromThreadWithUser = "Microsoft.Communication.ChatMemberRemovedFromThreadWithUser"; + public const string AcsChatParticipantAddedToThreadWithUser = "Microsoft.Communication.ChatParticipantAddedToThreadWithUser"; /// /// The value of the Event Type stored in and for the - /// system event. + /// system event. /// - public const string ACSChatMessageDeleted = "Microsoft.Communication.ChatMessageDeleted"; + public const string AcsChatParticipantRemovedFromThread = "Microsoft.Communication.ChatParticipantRemovedFromThread"; /// /// The value of the Event Type stored in and for the - /// system event. + /// system event. /// - public const string ACSChatMessageEdited = "Microsoft.Communication.ChatMessageEdited"; + public const string AcsChatParticipantRemovedFromThreadWithUser = "Microsoft.Communication.ChatParticipantRemovedFromThreadWithUser"; /// /// The value of the Event Type stored in and for the - /// system event. + /// system event. /// - public const string ACSChatMessageReceived = "Microsoft.Communication.ChatMessageReceived"; + public const string AcsChatMessageDeleted = "Microsoft.Communication.ChatMessageDeleted"; /// /// The value of the Event Type stored in and for the - /// system event. + /// system event. /// - public const string ACSChatThreadCreatedWithUser = "Microsoft.Communication.ChatThreadCreatedWithUser"; + public const string AcsChatMessageEdited = "Microsoft.Communication.ChatMessageEdited"; /// /// The value of the Event Type stored in and for the - /// system event. + /// system event. /// - public const string ACSChatThreadPropertiesUpdatedPerUser = "Microsoft.Communication.ChatThreadPropertiesUpdatedPerUser"; + public const string AcsChatMessageReceived = "Microsoft.Communication.ChatMessageReceived"; /// /// The value of the Event Type stored in and for the - /// system event. + /// system event. /// - public const string ACSChatThreadWithUserDeleted = "Microsoft.Communication.ChatThreadWithUserDeleted"; + public const string AcsChatThreadCreatedWithUser = "Microsoft.Communication.ChatThreadCreatedWithUser"; + + /// + /// The value of the Event Type stored in and for the + /// system event. + /// + public const string AcsChatThreadPropertiesUpdatedPerUser = "Microsoft.Communication.ChatThreadPropertiesUpdatedPerUser"; + + /// + /// The value of the Event Type stored in and for the + /// system event. + /// + public const string AcsChatThreadWithUserDeleted = "Microsoft.Communication.ChatThreadWithUserDeleted"; /// /// The value of the Event Type stored in and for the /// system event. /// - public const string ACSSMSDeliveryReportReceived = "Microsoft.Communication.SMSDeliveryReportReceived"; + public const string AcsSmsDeliveryReportReceived = "Microsoft.Communication.SMSDeliveryReportReceived"; /// /// The value of the Event Type stored in and for the diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatEventBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatEventBaseProperties.Serialization.cs index 69a0406ecd81a..b29b3cf06d6d2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatEventBaseProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatEventBaseProperties.Serialization.cs @@ -5,23 +5,31 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ACSChatEventBaseProperties + [JsonConverter(typeof(AcsChatEventBasePropertiesConverter))] + public partial class AcsChatEventBaseProperties { - internal static ACSChatEventBaseProperties DeserializeACSChatEventBaseProperties(JsonElement element) + internal static AcsChatEventBaseProperties DeserializeAcsChatEventBaseProperties(JsonElement element) { - Optional recipientId = default; + Optional recipientCommunicationIdentifier = default; Optional transactionId = default; Optional threadId = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("recipientId")) + if (property.NameEquals("recipientCommunicationIdentifier")) { - recipientId = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); continue; } if (property.NameEquals("transactionId")) @@ -35,7 +43,20 @@ internal static ACSChatEventBaseProperties DeserializeACSChatEventBaseProperties continue; } } - return new ACSChatEventBaseProperties(recipientId.Value, transactionId.Value, threadId.Value); + return new AcsChatEventBaseProperties(recipientCommunicationIdentifier.Value, transactionId.Value, threadId.Value); + } + + internal partial class AcsChatEventBasePropertiesConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatEventBaseProperties model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatEventBaseProperties Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatEventBaseProperties(document.RootElement); + } } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatEventBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatEventBaseProperties.cs index c03b4e9508153..27560ad8f0e7f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatEventBaseProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatEventBaseProperties.cs @@ -8,26 +8,26 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Schema of common properties of all chat events. - public partial class ACSChatEventBaseProperties + public partial class AcsChatEventBaseProperties { - /// Initializes a new instance of ACSChatEventBaseProperties. - internal ACSChatEventBaseProperties() + /// Initializes a new instance of AcsChatEventBaseProperties. + internal AcsChatEventBaseProperties() { } - /// Initializes a new instance of ACSChatEventBaseProperties. - /// The MRI of the target user. + /// Initializes a new instance of AcsChatEventBaseProperties. + /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. - internal ACSChatEventBaseProperties(string recipientId, string transactionId, string threadId) + internal AcsChatEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId) { - RecipientId = recipientId; + RecipientCommunicationIdentifier = recipientCommunicationIdentifier; TransactionId = transactionId; ThreadId = threadId; } - /// The MRI of the target user. - public string RecipientId { get; } + /// The communication identifier of the target user. + public CommunicationIdentifierModel RecipientCommunicationIdentifier { get; } /// The transaction id will be used as co-relation vector. public string TransactionId { get; } /// The chat thread id. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMemberAddedToThreadWithUserEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMemberAddedToThreadWithUserEventData.cs deleted file mode 100644 index 04ec9ac65a0a3..0000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMemberAddedToThreadWithUserEventData.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMemberAddedToThreadWithUser event. - public partial class ACSChatMemberAddedToThreadWithUserEventData : ACSChatThreadEventBaseProperties - { - /// Initializes a new instance of ACSChatMemberAddedToThreadWithUserEventData. - internal ACSChatMemberAddedToThreadWithUserEventData() - { - } - - /// Initializes a new instance of ACSChatMemberAddedToThreadWithUserEventData. - /// The MRI of the target user. - /// The transaction id will be used as co-relation vector. - /// The chat thread id. - /// The original creation time of the thread. - /// The version of the thread. - /// The time at which the user was added to the thread. - /// The MRI of the user who added the user. - /// The details of the user who was added. - internal ACSChatMemberAddedToThreadWithUserEventData(string recipientId, string transactionId, string threadId, DateTimeOffset? createTime, long? version, DateTimeOffset? time, string addedBy, ACSChatThreadMemberProperties memberAdded) : base(recipientId, transactionId, threadId, createTime, version) - { - Time = time; - AddedBy = addedBy; - MemberAdded = memberAdded; - } - - /// The time at which the user was added to the thread. - public DateTimeOffset? Time { get; } - /// The MRI of the user who added the user. - public string AddedBy { get; } - /// The details of the user who was added. - public ACSChatThreadMemberProperties MemberAdded { get; } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMemberRemovedFromThreadWithUserEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMemberRemovedFromThreadWithUserEventData.cs deleted file mode 100644 index 52e15af6eee09..0000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMemberRemovedFromThreadWithUserEventData.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMemberRemovedFromThreadWithUser event. - public partial class ACSChatMemberRemovedFromThreadWithUserEventData : ACSChatThreadEventBaseProperties - { - /// Initializes a new instance of ACSChatMemberRemovedFromThreadWithUserEventData. - internal ACSChatMemberRemovedFromThreadWithUserEventData() - { - } - - /// Initializes a new instance of ACSChatMemberRemovedFromThreadWithUserEventData. - /// The MRI of the target user. - /// The transaction id will be used as co-relation vector. - /// The chat thread id. - /// The original creation time of the thread. - /// The version of the thread. - /// The time at which the user was removed to the thread. - /// The MRI of the user who removed the user. - /// The details of the user who was removed. - internal ACSChatMemberRemovedFromThreadWithUserEventData(string recipientId, string transactionId, string threadId, DateTimeOffset? createTime, long? version, DateTimeOffset? time, string removedBy, ACSChatThreadMemberProperties memberRemoved) : base(recipientId, transactionId, threadId, createTime, version) - { - Time = time; - RemovedBy = removedBy; - MemberRemoved = memberRemoved; - } - - /// The time at which the user was removed to the thread. - public DateTimeOffset? Time { get; } - /// The MRI of the user who removed the user. - public string RemovedBy { get; } - /// The details of the user who was removed. - public ACSChatThreadMemberProperties MemberRemoved { get; } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageDeletedEventData.Serialization.cs index 83f51be8366d5..2ea45fe808fda 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageDeletedEventData.Serialization.cs @@ -7,22 +7,24 @@ using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ACSChatMessageDeletedEventData + [JsonConverter(typeof(AcsChatMessageDeletedEventDataConverter))] + public partial class AcsChatMessageDeletedEventData { - internal static ACSChatMessageDeletedEventData DeserializeACSChatMessageDeletedEventData(JsonElement element) + internal static AcsChatMessageDeletedEventData DeserializeAcsChatMessageDeletedEventData(JsonElement element) { Optional deleteTime = default; Optional messageId = default; - Optional senderId = default; + Optional senderCommunicationIdentifier = default; Optional senderDisplayName = default; Optional composeTime = default; Optional type = default; Optional version = default; - Optional recipientId = default; + Optional recipientCommunicationIdentifier = default; Optional transactionId = default; Optional threadId = default; foreach (var property in element.EnumerateObject()) @@ -42,9 +44,14 @@ internal static ACSChatMessageDeletedEventData DeserializeACSChatMessageDeletedE messageId = property.Value.GetString(); continue; } - if (property.NameEquals("senderId")) + if (property.NameEquals("senderCommunicationIdentifier")) { - senderId = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); continue; } if (property.NameEquals("senderDisplayName")) @@ -77,9 +84,14 @@ internal static ACSChatMessageDeletedEventData DeserializeACSChatMessageDeletedE version = property.Value.GetInt64(); continue; } - if (property.NameEquals("recipientId")) + if (property.NameEquals("recipientCommunicationIdentifier")) { - recipientId = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); continue; } if (property.NameEquals("transactionId")) @@ -93,7 +105,20 @@ internal static ACSChatMessageDeletedEventData DeserializeACSChatMessageDeletedE continue; } } - return new ACSChatMessageDeletedEventData(recipientId.Value, transactionId.Value, threadId.Value, messageId.Value, senderId.Value, senderDisplayName.Value, Optional.ToNullable(composeTime), type.Value, Optional.ToNullable(version), Optional.ToNullable(deleteTime)); + return new AcsChatMessageDeletedEventData(recipientCommunicationIdentifier.Value, transactionId.Value, threadId.Value, messageId.Value, senderCommunicationIdentifier.Value, senderDisplayName.Value, Optional.ToNullable(composeTime), type.Value, Optional.ToNullable(version), Optional.ToNullable(deleteTime)); + } + + internal partial class AcsChatMessageDeletedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatMessageDeletedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatMessageDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatMessageDeletedEventData(document.RootElement); + } } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageDeletedEventData.cs index 2957bc8b7143a..712ed1e81f740 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageDeletedEventData.cs @@ -10,25 +10,25 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageDeleted event. - public partial class ACSChatMessageDeletedEventData : ACSChatMessageEventBaseProperties + public partial class AcsChatMessageDeletedEventData : AcsChatMessageEventBaseProperties { - /// Initializes a new instance of ACSChatMessageDeletedEventData. - internal ACSChatMessageDeletedEventData() + /// Initializes a new instance of AcsChatMessageDeletedEventData. + internal AcsChatMessageDeletedEventData() { } - /// Initializes a new instance of ACSChatMessageDeletedEventData. - /// The MRI of the target user. + /// Initializes a new instance of AcsChatMessageDeletedEventData. + /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. /// The chat message id. - /// The MRI of the sender. + /// The communication identifier of the sender. /// The display name of the sender. /// The original compose time of the message. /// The type of the message. /// The version of the message. /// The time at which the message was deleted. - internal ACSChatMessageDeletedEventData(string recipientId, string transactionId, string threadId, string messageId, string senderId, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, DateTimeOffset? deleteTime) : base(recipientId, transactionId, threadId, messageId, senderId, senderDisplayName, composeTime, type, version) + internal AcsChatMessageDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, DateTimeOffset? deleteTime) : base(recipientCommunicationIdentifier, transactionId, threadId, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) { DeleteTime = deleteTime; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageEditedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageEditedEventData.Serialization.cs index 354b25fb59bf0..49eb6c710ae42 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageEditedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageEditedEventData.Serialization.cs @@ -7,23 +7,25 @@ using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ACSChatMessageEditedEventData + [JsonConverter(typeof(AcsChatMessageEditedEventDataConverter))] + public partial class AcsChatMessageEditedEventData { - internal static ACSChatMessageEditedEventData DeserializeACSChatMessageEditedEventData(JsonElement element) + internal static AcsChatMessageEditedEventData DeserializeAcsChatMessageEditedEventData(JsonElement element) { Optional messageBody = default; Optional editTime = default; Optional messageId = default; - Optional senderId = default; + Optional senderCommunicationIdentifier = default; Optional senderDisplayName = default; Optional composeTime = default; Optional type = default; Optional version = default; - Optional recipientId = default; + Optional recipientCommunicationIdentifier = default; Optional transactionId = default; Optional threadId = default; foreach (var property in element.EnumerateObject()) @@ -48,9 +50,14 @@ internal static ACSChatMessageEditedEventData DeserializeACSChatMessageEditedEve messageId = property.Value.GetString(); continue; } - if (property.NameEquals("senderId")) + if (property.NameEquals("senderCommunicationIdentifier")) { - senderId = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); continue; } if (property.NameEquals("senderDisplayName")) @@ -83,9 +90,14 @@ internal static ACSChatMessageEditedEventData DeserializeACSChatMessageEditedEve version = property.Value.GetInt64(); continue; } - if (property.NameEquals("recipientId")) + if (property.NameEquals("recipientCommunicationIdentifier")) { - recipientId = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); continue; } if (property.NameEquals("transactionId")) @@ -99,7 +111,20 @@ internal static ACSChatMessageEditedEventData DeserializeACSChatMessageEditedEve continue; } } - return new ACSChatMessageEditedEventData(recipientId.Value, transactionId.Value, threadId.Value, messageId.Value, senderId.Value, senderDisplayName.Value, Optional.ToNullable(composeTime), type.Value, Optional.ToNullable(version), messageBody.Value, Optional.ToNullable(editTime)); + return new AcsChatMessageEditedEventData(recipientCommunicationIdentifier.Value, transactionId.Value, threadId.Value, messageId.Value, senderCommunicationIdentifier.Value, senderDisplayName.Value, Optional.ToNullable(composeTime), type.Value, Optional.ToNullable(version), messageBody.Value, Optional.ToNullable(editTime)); + } + + internal partial class AcsChatMessageEditedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatMessageEditedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatMessageEditedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatMessageEditedEventData(document.RootElement); + } } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageEditedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageEditedEventData.cs index 5fb6c07bc8645..8000fc1626d05 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageEditedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageEditedEventData.cs @@ -10,26 +10,26 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageEdited event. - public partial class ACSChatMessageEditedEventData : ACSChatMessageEventBaseProperties + public partial class AcsChatMessageEditedEventData : AcsChatMessageEventBaseProperties { - /// Initializes a new instance of ACSChatMessageEditedEventData. - internal ACSChatMessageEditedEventData() + /// Initializes a new instance of AcsChatMessageEditedEventData. + internal AcsChatMessageEditedEventData() { } - /// Initializes a new instance of ACSChatMessageEditedEventData. - /// The MRI of the target user. + /// Initializes a new instance of AcsChatMessageEditedEventData. + /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. /// The chat message id. - /// The MRI of the sender. + /// The communication identifier of the sender. /// The display name of the sender. /// The original compose time of the message. /// The type of the message. /// The version of the message. /// The body of the chat message. /// The time at which the message was edited. - internal ACSChatMessageEditedEventData(string recipientId, string transactionId, string threadId, string messageId, string senderId, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, string messageBody, DateTimeOffset? editTime) : base(recipientId, transactionId, threadId, messageId, senderId, senderDisplayName, composeTime, type, version) + internal AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, string messageBody, DateTimeOffset? editTime) : base(recipientCommunicationIdentifier, transactionId, threadId, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) { MessageBody = messageBody; EditTime = editTime; diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageEventBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageEventBaseProperties.Serialization.cs index de419c9ca3aa3..237a3af54bf10 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageEventBaseProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageEventBaseProperties.Serialization.cs @@ -7,21 +7,23 @@ using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ACSChatMessageEventBaseProperties + [JsonConverter(typeof(AcsChatMessageEventBasePropertiesConverter))] + public partial class AcsChatMessageEventBaseProperties { - internal static ACSChatMessageEventBaseProperties DeserializeACSChatMessageEventBaseProperties(JsonElement element) + internal static AcsChatMessageEventBaseProperties DeserializeAcsChatMessageEventBaseProperties(JsonElement element) { Optional messageId = default; - Optional senderId = default; + Optional senderCommunicationIdentifier = default; Optional senderDisplayName = default; Optional composeTime = default; Optional type = default; Optional version = default; - Optional recipientId = default; + Optional recipientCommunicationIdentifier = default; Optional transactionId = default; Optional threadId = default; foreach (var property in element.EnumerateObject()) @@ -31,9 +33,14 @@ internal static ACSChatMessageEventBaseProperties DeserializeACSChatMessageEvent messageId = property.Value.GetString(); continue; } - if (property.NameEquals("senderId")) + if (property.NameEquals("senderCommunicationIdentifier")) { - senderId = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); continue; } if (property.NameEquals("senderDisplayName")) @@ -66,9 +73,14 @@ internal static ACSChatMessageEventBaseProperties DeserializeACSChatMessageEvent version = property.Value.GetInt64(); continue; } - if (property.NameEquals("recipientId")) + if (property.NameEquals("recipientCommunicationIdentifier")) { - recipientId = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); continue; } if (property.NameEquals("transactionId")) @@ -82,7 +94,20 @@ internal static ACSChatMessageEventBaseProperties DeserializeACSChatMessageEvent continue; } } - return new ACSChatMessageEventBaseProperties(recipientId.Value, transactionId.Value, threadId.Value, messageId.Value, senderId.Value, senderDisplayName.Value, Optional.ToNullable(composeTime), type.Value, Optional.ToNullable(version)); + return new AcsChatMessageEventBaseProperties(recipientCommunicationIdentifier.Value, transactionId.Value, threadId.Value, messageId.Value, senderCommunicationIdentifier.Value, senderDisplayName.Value, Optional.ToNullable(composeTime), type.Value, Optional.ToNullable(version)); + } + + internal partial class AcsChatMessageEventBasePropertiesConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatMessageEventBaseProperties model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatMessageEventBaseProperties Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatMessageEventBaseProperties(document.RootElement); + } } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageEventBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageEventBaseProperties.cs index ed7da545b9ad7..9374bf1aa61ad 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageEventBaseProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageEventBaseProperties.cs @@ -10,27 +10,27 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Schema of common properties of all chat message events. - public partial class ACSChatMessageEventBaseProperties : ACSChatEventBaseProperties + public partial class AcsChatMessageEventBaseProperties : AcsChatEventBaseProperties { - /// Initializes a new instance of ACSChatMessageEventBaseProperties. - internal ACSChatMessageEventBaseProperties() + /// Initializes a new instance of AcsChatMessageEventBaseProperties. + internal AcsChatMessageEventBaseProperties() { } - /// Initializes a new instance of ACSChatMessageEventBaseProperties. - /// The MRI of the target user. + /// Initializes a new instance of AcsChatMessageEventBaseProperties. + /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. /// The chat message id. - /// The MRI of the sender. + /// The communication identifier of the sender. /// The display name of the sender. /// The original compose time of the message. /// The type of the message. /// The version of the message. - internal ACSChatMessageEventBaseProperties(string recipientId, string transactionId, string threadId, string messageId, string senderId, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version) : base(recipientId, transactionId, threadId) + internal AcsChatMessageEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version) : base(recipientCommunicationIdentifier, transactionId, threadId) { MessageId = messageId; - SenderId = senderId; + SenderCommunicationIdentifier = senderCommunicationIdentifier; SenderDisplayName = senderDisplayName; ComposeTime = composeTime; Type = type; @@ -39,8 +39,8 @@ internal ACSChatMessageEventBaseProperties(string recipientId, string transactio /// The chat message id. public string MessageId { get; } - /// The MRI of the sender. - public string SenderId { get; } + /// The communication identifier of the sender. + public CommunicationIdentifierModel SenderCommunicationIdentifier { get; } /// The display name of the sender. public string SenderDisplayName { get; } /// The original compose time of the message. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageReceivedEventData.Serialization.cs index 4af6783522981..c4277956225a6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageReceivedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageReceivedEventData.Serialization.cs @@ -7,22 +7,24 @@ using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ACSChatMessageReceivedEventData + [JsonConverter(typeof(AcsChatMessageReceivedEventDataConverter))] + public partial class AcsChatMessageReceivedEventData { - internal static ACSChatMessageReceivedEventData DeserializeACSChatMessageReceivedEventData(JsonElement element) + internal static AcsChatMessageReceivedEventData DeserializeAcsChatMessageReceivedEventData(JsonElement element) { Optional messageBody = default; Optional messageId = default; - Optional senderId = default; + Optional senderCommunicationIdentifier = default; Optional senderDisplayName = default; Optional composeTime = default; Optional type = default; Optional version = default; - Optional recipientId = default; + Optional recipientCommunicationIdentifier = default; Optional transactionId = default; Optional threadId = default; foreach (var property in element.EnumerateObject()) @@ -37,9 +39,14 @@ internal static ACSChatMessageReceivedEventData DeserializeACSChatMessageReceive messageId = property.Value.GetString(); continue; } - if (property.NameEquals("senderId")) + if (property.NameEquals("senderCommunicationIdentifier")) { - senderId = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); continue; } if (property.NameEquals("senderDisplayName")) @@ -72,9 +79,14 @@ internal static ACSChatMessageReceivedEventData DeserializeACSChatMessageReceive version = property.Value.GetInt64(); continue; } - if (property.NameEquals("recipientId")) + if (property.NameEquals("recipientCommunicationIdentifier")) { - recipientId = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); continue; } if (property.NameEquals("transactionId")) @@ -88,7 +100,20 @@ internal static ACSChatMessageReceivedEventData DeserializeACSChatMessageReceive continue; } } - return new ACSChatMessageReceivedEventData(recipientId.Value, transactionId.Value, threadId.Value, messageId.Value, senderId.Value, senderDisplayName.Value, Optional.ToNullable(composeTime), type.Value, Optional.ToNullable(version), messageBody.Value); + return new AcsChatMessageReceivedEventData(recipientCommunicationIdentifier.Value, transactionId.Value, threadId.Value, messageId.Value, senderCommunicationIdentifier.Value, senderDisplayName.Value, Optional.ToNullable(composeTime), type.Value, Optional.ToNullable(version), messageBody.Value); + } + + internal partial class AcsChatMessageReceivedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatMessageReceivedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatMessageReceivedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatMessageReceivedEventData(document.RootElement); + } } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageReceivedEventData.cs index c572547a5faea..712b2a9665469 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageReceivedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMessageReceivedEventData.cs @@ -10,25 +10,25 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageReceived event. - public partial class ACSChatMessageReceivedEventData : ACSChatMessageEventBaseProperties + public partial class AcsChatMessageReceivedEventData : AcsChatMessageEventBaseProperties { - /// Initializes a new instance of ACSChatMessageReceivedEventData. - internal ACSChatMessageReceivedEventData() + /// Initializes a new instance of AcsChatMessageReceivedEventData. + internal AcsChatMessageReceivedEventData() { } - /// Initializes a new instance of ACSChatMessageReceivedEventData. - /// The MRI of the target user. + /// Initializes a new instance of AcsChatMessageReceivedEventData. + /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. /// The chat message id. - /// The MRI of the sender. + /// The communication identifier of the sender. /// The display name of the sender. /// The original compose time of the message. /// The type of the message. /// The version of the message. /// The body of the chat message. - internal ACSChatMessageReceivedEventData(string recipientId, string transactionId, string threadId, string messageId, string senderId, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, string messageBody) : base(recipientId, transactionId, threadId, messageId, senderId, senderDisplayName, composeTime, type, version) + internal AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, string messageBody) : base(recipientCommunicationIdentifier, transactionId, threadId, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) { MessageBody = messageBody; } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadCreatedWithUserEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadCreatedWithUserEventData.Serialization.cs index 035be8e7ec086..aa189cdb0b59e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadCreatedWithUserEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadCreatedWithUserEventData.Serialization.cs @@ -8,27 +8,34 @@ using System; using System.Collections.Generic; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ACSChatThreadCreatedWithUserEventData + [JsonConverter(typeof(AcsChatThreadCreatedWithUserEventDataConverter))] + public partial class AcsChatThreadCreatedWithUserEventData { - internal static ACSChatThreadCreatedWithUserEventData DeserializeACSChatThreadCreatedWithUserEventData(JsonElement element) + internal static AcsChatThreadCreatedWithUserEventData DeserializeAcsChatThreadCreatedWithUserEventData(JsonElement element) { - Optional createdBy = default; + Optional createdByCommunicationIdentifier = default; Optional> properties = default; - Optional> members = default; + Optional> participants = default; Optional createTime = default; Optional version = default; - Optional recipientId = default; + Optional recipientCommunicationIdentifier = default; Optional transactionId = default; Optional threadId = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("createdBy")) + if (property.NameEquals("createdByCommunicationIdentifier")) { - createdBy = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + createdByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); continue; } if (property.NameEquals("properties")) @@ -46,19 +53,19 @@ internal static ACSChatThreadCreatedWithUserEventData DeserializeACSChatThreadCr properties = dictionary; continue; } - if (property.NameEquals("members")) + if (property.NameEquals("participants")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(ACSChatThreadMemberProperties.DeserializeACSChatThreadMemberProperties(item)); + array.Add(AcsChatThreadParticipantProperties.DeserializeAcsChatThreadParticipantProperties(item)); } - members = array; + participants = array; continue; } if (property.NameEquals("createTime")) @@ -81,9 +88,14 @@ internal static ACSChatThreadCreatedWithUserEventData DeserializeACSChatThreadCr version = property.Value.GetInt64(); continue; } - if (property.NameEquals("recipientId")) + if (property.NameEquals("recipientCommunicationIdentifier")) { - recipientId = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); continue; } if (property.NameEquals("transactionId")) @@ -97,7 +109,20 @@ internal static ACSChatThreadCreatedWithUserEventData DeserializeACSChatThreadCr continue; } } - return new ACSChatThreadCreatedWithUserEventData(recipientId.Value, transactionId.Value, threadId.Value, Optional.ToNullable(createTime), Optional.ToNullable(version), createdBy.Value, Optional.ToDictionary(properties), Optional.ToList(members)); + return new AcsChatThreadCreatedWithUserEventData(recipientCommunicationIdentifier.Value, transactionId.Value, threadId.Value, Optional.ToNullable(createTime), Optional.ToNullable(version), createdByCommunicationIdentifier.Value, Optional.ToDictionary(properties), Optional.ToList(participants)); + } + + internal partial class AcsChatThreadCreatedWithUserEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatThreadCreatedWithUserEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatThreadCreatedWithUserEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatThreadCreatedWithUserEventData(document.RootElement); + } } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadCreatedWithUserEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadCreatedWithUserEventData.cs index 1db6df9912a67..92654cd6b4aa0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadCreatedWithUserEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadCreatedWithUserEventData.cs @@ -12,36 +12,36 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadCreatedWithUser event. - public partial class ACSChatThreadCreatedWithUserEventData : ACSChatThreadEventBaseProperties + public partial class AcsChatThreadCreatedWithUserEventData : AcsChatThreadEventBaseProperties { - /// Initializes a new instance of ACSChatThreadCreatedWithUserEventData. - internal ACSChatThreadCreatedWithUserEventData() + /// Initializes a new instance of AcsChatThreadCreatedWithUserEventData. + internal AcsChatThreadCreatedWithUserEventData() { Properties = new ChangeTrackingDictionary(); - Members = new ChangeTrackingList(); + Participants = new ChangeTrackingList(); } - /// Initializes a new instance of ACSChatThreadCreatedWithUserEventData. - /// The MRI of the target user. + /// Initializes a new instance of AcsChatThreadCreatedWithUserEventData. + /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. /// The original creation time of the thread. /// The version of the thread. - /// The MRI of the creator of the thread. + /// The communication identifier of the user who created the thread. /// The thread properties. - /// The list of properties of users who are part of the thread. - internal ACSChatThreadCreatedWithUserEventData(string recipientId, string transactionId, string threadId, DateTimeOffset? createTime, long? version, string createdBy, IReadOnlyDictionary properties, IReadOnlyList members) : base(recipientId, transactionId, threadId, createTime, version) + /// The list of properties of participants who are part of the thread. + internal AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyList participants) : base(recipientCommunicationIdentifier, transactionId, threadId, createTime, version) { - CreatedBy = createdBy; + CreatedByCommunicationIdentifier = createdByCommunicationIdentifier; Properties = properties; - Members = members; + Participants = participants; } - /// The MRI of the creator of the thread. - public string CreatedBy { get; } + /// The communication identifier of the user who created the thread. + public CommunicationIdentifierModel CreatedByCommunicationIdentifier { get; } /// The thread properties. public IReadOnlyDictionary Properties { get; } - /// The list of properties of users who are part of the thread. - public IReadOnlyList Members { get; } + /// The list of properties of participants who are part of the thread. + public IReadOnlyList Participants { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadEventBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadEventBaseProperties.Serialization.cs index efd403602c79b..a6c60226bde28 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadEventBaseProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadEventBaseProperties.Serialization.cs @@ -7,17 +7,19 @@ using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ACSChatThreadEventBaseProperties + [JsonConverter(typeof(AcsChatThreadEventBasePropertiesConverter))] + public partial class AcsChatThreadEventBaseProperties { - internal static ACSChatThreadEventBaseProperties DeserializeACSChatThreadEventBaseProperties(JsonElement element) + internal static AcsChatThreadEventBaseProperties DeserializeAcsChatThreadEventBaseProperties(JsonElement element) { Optional createTime = default; Optional version = default; - Optional recipientId = default; + Optional recipientCommunicationIdentifier = default; Optional transactionId = default; Optional threadId = default; foreach (var property in element.EnumerateObject()) @@ -42,9 +44,14 @@ internal static ACSChatThreadEventBaseProperties DeserializeACSChatThreadEventBa version = property.Value.GetInt64(); continue; } - if (property.NameEquals("recipientId")) + if (property.NameEquals("recipientCommunicationIdentifier")) { - recipientId = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); continue; } if (property.NameEquals("transactionId")) @@ -58,7 +65,20 @@ internal static ACSChatThreadEventBaseProperties DeserializeACSChatThreadEventBa continue; } } - return new ACSChatThreadEventBaseProperties(recipientId.Value, transactionId.Value, threadId.Value, Optional.ToNullable(createTime), Optional.ToNullable(version)); + return new AcsChatThreadEventBaseProperties(recipientCommunicationIdentifier.Value, transactionId.Value, threadId.Value, Optional.ToNullable(createTime), Optional.ToNullable(version)); + } + + internal partial class AcsChatThreadEventBasePropertiesConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatThreadEventBaseProperties model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatThreadEventBaseProperties Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatThreadEventBaseProperties(document.RootElement); + } } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadEventBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadEventBaseProperties.cs index 3e44a93a88f04..b4aad4a5af7e6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadEventBaseProperties.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadEventBaseProperties.cs @@ -10,20 +10,20 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Schema of common properties of all chat thread events. - public partial class ACSChatThreadEventBaseProperties : ACSChatEventBaseProperties + public partial class AcsChatThreadEventBaseProperties : AcsChatEventBaseProperties { - /// Initializes a new instance of ACSChatThreadEventBaseProperties. - internal ACSChatThreadEventBaseProperties() + /// Initializes a new instance of AcsChatThreadEventBaseProperties. + internal AcsChatThreadEventBaseProperties() { } - /// Initializes a new instance of ACSChatThreadEventBaseProperties. - /// The MRI of the target user. + /// Initializes a new instance of AcsChatThreadEventBaseProperties. + /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. /// The original creation time of the thread. /// The version of the thread. - internal ACSChatThreadEventBaseProperties(string recipientId, string transactionId, string threadId, DateTimeOffset? createTime, long? version) : base(recipientId, transactionId, threadId) + internal AcsChatThreadEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, DateTimeOffset? createTime, long? version) : base(recipientCommunicationIdentifier, transactionId, threadId) { CreateTime = createTime; Version = version; diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadMemberProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadMemberProperties.Serialization.cs deleted file mode 100644 index db5ff4451768f..0000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadMemberProperties.Serialization.cs +++ /dev/null @@ -1,35 +0,0 @@ -// 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 ACSChatThreadMemberProperties - { - internal static ACSChatThreadMemberProperties DeserializeACSChatThreadMemberProperties(JsonElement element) - { - Optional displayName = default; - Optional memberId = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("displayName")) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("memberId")) - { - memberId = property.Value.GetString(); - continue; - } - } - return new ACSChatThreadMemberProperties(displayName.Value, memberId.Value); - } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadMemberProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadMemberProperties.cs deleted file mode 100644 index 0fc7d498b1d1a..0000000000000 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadMemberProperties.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.Messaging.EventGrid.SystemEvents -{ - /// Schema of the chat thread member. - public partial class ACSChatThreadMemberProperties - { - /// Initializes a new instance of ACSChatThreadMemberProperties. - internal ACSChatThreadMemberProperties() - { - } - - /// Initializes a new instance of ACSChatThreadMemberProperties. - /// The name of the user. - /// The MRI of the user. - internal ACSChatThreadMemberProperties(string displayName, string memberId) - { - DisplayName = displayName; - MemberId = memberId; - } - - /// The name of the user. - public string DisplayName { get; } - /// The MRI of the user. - public string MemberId { get; } - } -} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadPropertiesUpdatedPerUserEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadPropertiesUpdatedPerUserEventData.Serialization.cs index 5996cd1b32e71..de4014293537a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadPropertiesUpdatedPerUserEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadPropertiesUpdatedPerUserEventData.Serialization.cs @@ -8,27 +8,34 @@ using System; using System.Collections.Generic; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ACSChatThreadPropertiesUpdatedPerUserEventData + [JsonConverter(typeof(AcsChatThreadPropertiesUpdatedPerUserEventDataConverter))] + public partial class AcsChatThreadPropertiesUpdatedPerUserEventData { - internal static ACSChatThreadPropertiesUpdatedPerUserEventData DeserializeACSChatThreadPropertiesUpdatedPerUserEventData(JsonElement element) + internal static AcsChatThreadPropertiesUpdatedPerUserEventData DeserializeAcsChatThreadPropertiesUpdatedPerUserEventData(JsonElement element) { - Optional editedBy = default; + Optional editedByCommunicationIdentifier = default; Optional editTime = default; Optional> properties = default; Optional createTime = default; Optional version = default; - Optional recipientId = default; + Optional recipientCommunicationIdentifier = default; Optional transactionId = default; Optional threadId = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("editedBy")) + if (property.NameEquals("editedByCommunicationIdentifier")) { - editedBy = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + editedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); continue; } if (property.NameEquals("editTime")) @@ -76,9 +83,14 @@ internal static ACSChatThreadPropertiesUpdatedPerUserEventData DeserializeACSCha version = property.Value.GetInt64(); continue; } - if (property.NameEquals("recipientId")) + if (property.NameEquals("recipientCommunicationIdentifier")) { - recipientId = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); continue; } if (property.NameEquals("transactionId")) @@ -92,7 +104,20 @@ internal static ACSChatThreadPropertiesUpdatedPerUserEventData DeserializeACSCha continue; } } - return new ACSChatThreadPropertiesUpdatedPerUserEventData(recipientId.Value, transactionId.Value, threadId.Value, Optional.ToNullable(createTime), Optional.ToNullable(version), editedBy.Value, Optional.ToNullable(editTime), Optional.ToDictionary(properties)); + return new AcsChatThreadPropertiesUpdatedPerUserEventData(recipientCommunicationIdentifier.Value, transactionId.Value, threadId.Value, Optional.ToNullable(createTime), Optional.ToNullable(version), editedByCommunicationIdentifier.Value, Optional.ToNullable(editTime), Optional.ToDictionary(properties)); + } + + internal partial class AcsChatThreadPropertiesUpdatedPerUserEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatThreadPropertiesUpdatedPerUserEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatThreadPropertiesUpdatedPerUserEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatThreadPropertiesUpdatedPerUserEventData(document.RootElement); + } } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadPropertiesUpdatedPerUserEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadPropertiesUpdatedPerUserEventData.cs index 80b110ec20546..6fb96769eea0d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadPropertiesUpdatedPerUserEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadPropertiesUpdatedPerUserEventData.cs @@ -12,32 +12,32 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadPropertiesUpdatedPerUser event. - public partial class ACSChatThreadPropertiesUpdatedPerUserEventData : ACSChatThreadEventBaseProperties + public partial class AcsChatThreadPropertiesUpdatedPerUserEventData : AcsChatThreadEventBaseProperties { - /// Initializes a new instance of ACSChatThreadPropertiesUpdatedPerUserEventData. - internal ACSChatThreadPropertiesUpdatedPerUserEventData() + /// Initializes a new instance of AcsChatThreadPropertiesUpdatedPerUserEventData. + internal AcsChatThreadPropertiesUpdatedPerUserEventData() { Properties = new ChangeTrackingDictionary(); } - /// Initializes a new instance of ACSChatThreadPropertiesUpdatedPerUserEventData. - /// The MRI of the target user. + /// Initializes a new instance of AcsChatThreadPropertiesUpdatedPerUserEventData. + /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. /// The original creation time of the thread. /// The version of the thread. - /// The MRI of the user who updated the thread properties. + /// The communication identifier of the user who updated the thread properties. /// The time at which the properties of the thread were updated. /// The updated thread properties. - internal ACSChatThreadPropertiesUpdatedPerUserEventData(string recipientId, string transactionId, string threadId, DateTimeOffset? createTime, long? version, string editedBy, DateTimeOffset? editTime, IReadOnlyDictionary properties) : base(recipientId, transactionId, threadId, createTime, version) + internal AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel editedByCommunicationIdentifier, DateTimeOffset? editTime, IReadOnlyDictionary properties) : base(recipientCommunicationIdentifier, transactionId, threadId, createTime, version) { - EditedBy = editedBy; + EditedByCommunicationIdentifier = editedByCommunicationIdentifier; EditTime = editTime; Properties = properties; } - /// The MRI of the user who updated the thread properties. - public string EditedBy { get; } + /// The communication identifier of the user who updated the thread properties. + public CommunicationIdentifierModel EditedByCommunicationIdentifier { get; } /// The time at which the properties of the thread were updated. public DateTimeOffset? EditTime { get; } /// The updated thread properties. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadWithUserDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadWithUserDeletedEventData.Serialization.cs index eb5a288153c4d..4c2383686fe3d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadWithUserDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadWithUserDeletedEventData.Serialization.cs @@ -7,26 +7,33 @@ using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ACSChatThreadWithUserDeletedEventData + [JsonConverter(typeof(AcsChatThreadWithUserDeletedEventDataConverter))] + public partial class AcsChatThreadWithUserDeletedEventData { - internal static ACSChatThreadWithUserDeletedEventData DeserializeACSChatThreadWithUserDeletedEventData(JsonElement element) + internal static AcsChatThreadWithUserDeletedEventData DeserializeAcsChatThreadWithUserDeletedEventData(JsonElement element) { - Optional deletedBy = default; + Optional deletedByCommunicationIdentifier = default; Optional deleteTime = default; Optional createTime = default; Optional version = default; - Optional recipientId = default; + Optional recipientCommunicationIdentifier = default; Optional transactionId = default; Optional threadId = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("deletedBy")) + if (property.NameEquals("deletedByCommunicationIdentifier")) { - deletedBy = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + deletedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); continue; } if (property.NameEquals("deleteTime")) @@ -59,9 +66,14 @@ internal static ACSChatThreadWithUserDeletedEventData DeserializeACSChatThreadWi version = property.Value.GetInt64(); continue; } - if (property.NameEquals("recipientId")) + if (property.NameEquals("recipientCommunicationIdentifier")) { - recipientId = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); continue; } if (property.NameEquals("transactionId")) @@ -75,7 +87,20 @@ internal static ACSChatThreadWithUserDeletedEventData DeserializeACSChatThreadWi continue; } } - return new ACSChatThreadWithUserDeletedEventData(recipientId.Value, transactionId.Value, threadId.Value, Optional.ToNullable(createTime), Optional.ToNullable(version), deletedBy.Value, Optional.ToNullable(deleteTime)); + return new AcsChatThreadWithUserDeletedEventData(recipientCommunicationIdentifier.Value, transactionId.Value, threadId.Value, Optional.ToNullable(createTime), Optional.ToNullable(version), deletedByCommunicationIdentifier.Value, Optional.ToNullable(deleteTime)); + } + + internal partial class AcsChatThreadWithUserDeletedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatThreadWithUserDeletedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatThreadWithUserDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatThreadWithUserDeletedEventData(document.RootElement); + } } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadWithUserDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadWithUserDeletedEventData.cs index e57b5c91f0ff7..ae12d8b62461f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadWithUserDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatThreadWithUserDeletedEventData.cs @@ -10,29 +10,29 @@ namespace Azure.Messaging.EventGrid.SystemEvents { /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadWithUserDeleted event. - public partial class ACSChatThreadWithUserDeletedEventData : ACSChatThreadEventBaseProperties + public partial class AcsChatThreadWithUserDeletedEventData : AcsChatThreadEventBaseProperties { - /// Initializes a new instance of ACSChatThreadWithUserDeletedEventData. - internal ACSChatThreadWithUserDeletedEventData() + /// Initializes a new instance of AcsChatThreadWithUserDeletedEventData. + internal AcsChatThreadWithUserDeletedEventData() { } - /// Initializes a new instance of ACSChatThreadWithUserDeletedEventData. - /// The MRI of the target user. + /// Initializes a new instance of AcsChatThreadWithUserDeletedEventData. + /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. /// The chat thread id. /// The original creation time of the thread. /// The version of the thread. - /// The MRI of the user who deleted the thread. + /// The communication identifier of the user who deleted the thread. /// The deletion time of the thread. - internal ACSChatThreadWithUserDeletedEventData(string recipientId, string transactionId, string threadId, DateTimeOffset? createTime, long? version, string deletedBy, DateTimeOffset? deleteTime) : base(recipientId, transactionId, threadId, createTime, version) + internal AcsChatThreadWithUserDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel deletedByCommunicationIdentifier, DateTimeOffset? deleteTime) : base(recipientCommunicationIdentifier, transactionId, threadId, createTime, version) { - DeletedBy = deletedBy; + DeletedByCommunicationIdentifier = deletedByCommunicationIdentifier; DeleteTime = deleteTime; } - /// The MRI of the user who deleted the thread. - public string DeletedBy { get; } + /// The communication identifier of the user who deleted the thread. + public CommunicationIdentifierModel DeletedByCommunicationIdentifier { get; } /// The deletion time of the thread. public DateTimeOffset? DeleteTime { get; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatEventInThreadBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatEventInThreadBaseProperties.Serialization.cs new file mode 100644 index 0000000000000..799018bc8dd97 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatEventInThreadBaseProperties.Serialization.cs @@ -0,0 +1,45 @@ +// 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(AcsChatEventInThreadBasePropertiesConverter))] + public partial class AcsChatEventInThreadBaseProperties + { + internal static AcsChatEventInThreadBaseProperties DeserializeAcsChatEventInThreadBaseProperties(JsonElement element) + { + Optional threadId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("threadId")) + { + threadId = property.Value.GetString(); + continue; + } + } + return new AcsChatEventInThreadBaseProperties(threadId.Value); + } + + internal partial class AcsChatEventInThreadBasePropertiesConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatEventInThreadBaseProperties model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatEventInThreadBaseProperties Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatEventInThreadBaseProperties(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatEventInThreadBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatEventInThreadBaseProperties.cs new file mode 100644 index 0000000000000..b3d97eaa41500 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatEventInThreadBaseProperties.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 common properties of all thread-level chat events. + public partial class AcsChatEventInThreadBaseProperties + { + /// Initializes a new instance of AcsChatEventInThreadBaseProperties. + internal AcsChatEventInThreadBaseProperties() + { + } + + /// Initializes a new instance of AcsChatEventInThreadBaseProperties. + /// The chat thread id. + internal AcsChatEventInThreadBaseProperties(string threadId) + { + ThreadId = threadId; + } + + /// The chat thread id. + public string ThreadId { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageDeletedInThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageDeletedInThreadEventData.Serialization.cs new file mode 100644 index 0000000000000..afab9ab065935 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageDeletedInThreadEventData.Serialization.cs @@ -0,0 +1,107 @@ +// 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(AcsChatMessageDeletedInThreadEventDataConverter))] + public partial class AcsChatMessageDeletedInThreadEventData + { + internal static AcsChatMessageDeletedInThreadEventData DeserializeAcsChatMessageDeletedInThreadEventData(JsonElement element) + { + Optional deleteTime = default; + Optional messageId = default; + Optional senderCommunicationIdentifier = default; + Optional senderDisplayName = default; + Optional composeTime = default; + Optional type = default; + Optional version = default; + Optional threadId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("deleteTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + deleteTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("messageId")) + { + messageId = property.Value.GetString(); + continue; + } + if (property.NameEquals("senderCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("senderDisplayName")) + { + senderDisplayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("composeTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + composeTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("version")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + version = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("threadId")) + { + threadId = property.Value.GetString(); + continue; + } + } + return new AcsChatMessageDeletedInThreadEventData(threadId.Value, messageId.Value, senderCommunicationIdentifier.Value, senderDisplayName.Value, Optional.ToNullable(composeTime), type.Value, Optional.ToNullable(version), Optional.ToNullable(deleteTime)); + } + + internal partial class AcsChatMessageDeletedInThreadEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatMessageDeletedInThreadEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatMessageDeletedInThreadEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatMessageDeletedInThreadEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageDeletedInThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageDeletedInThreadEventData.cs new file mode 100644 index 0000000000000..e7ece17efa738 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageDeletedInThreadEventData.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageDeletedInThread event. + public partial class AcsChatMessageDeletedInThreadEventData : AcsChatMessageEventInThreadBaseProperties + { + /// Initializes a new instance of AcsChatMessageDeletedInThreadEventData. + internal AcsChatMessageDeletedInThreadEventData() + { + } + + /// Initializes a new instance of AcsChatMessageDeletedInThreadEventData. + /// The chat thread id. + /// The chat message id. + /// The communication identifier of the sender. + /// The display name of the sender. + /// The original compose time of the message. + /// The type of the message. + /// The version of the message. + /// The time at which the message was deleted. + internal AcsChatMessageDeletedInThreadEventData(string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, DateTimeOffset? deleteTime) : base(threadId, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) + { + DeleteTime = deleteTime; + } + + /// The time at which the message was deleted. + public DateTimeOffset? DeleteTime { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEditedInThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEditedInThreadEventData.Serialization.cs new file mode 100644 index 0000000000000..60c1b78063ec2 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEditedInThreadEventData.Serialization.cs @@ -0,0 +1,113 @@ +// 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(AcsChatMessageEditedInThreadEventDataConverter))] + public partial class AcsChatMessageEditedInThreadEventData + { + internal static AcsChatMessageEditedInThreadEventData DeserializeAcsChatMessageEditedInThreadEventData(JsonElement element) + { + Optional messageBody = default; + Optional editTime = default; + Optional messageId = default; + Optional senderCommunicationIdentifier = default; + Optional senderDisplayName = default; + Optional composeTime = default; + Optional type = default; + Optional version = default; + Optional threadId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("messageBody")) + { + messageBody = property.Value.GetString(); + continue; + } + if (property.NameEquals("editTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + editTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("messageId")) + { + messageId = property.Value.GetString(); + continue; + } + if (property.NameEquals("senderCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("senderDisplayName")) + { + senderDisplayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("composeTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + composeTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("version")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + version = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("threadId")) + { + threadId = property.Value.GetString(); + continue; + } + } + return new AcsChatMessageEditedInThreadEventData(threadId.Value, messageId.Value, senderCommunicationIdentifier.Value, senderDisplayName.Value, Optional.ToNullable(composeTime), type.Value, Optional.ToNullable(version), messageBody.Value, Optional.ToNullable(editTime)); + } + + internal partial class AcsChatMessageEditedInThreadEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatMessageEditedInThreadEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatMessageEditedInThreadEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatMessageEditedInThreadEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEditedInThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEditedInThreadEventData.cs new file mode 100644 index 0000000000000..6a3fdcc256ee5 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEditedInThreadEventData.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageEditedInThread event. + public partial class AcsChatMessageEditedInThreadEventData : AcsChatMessageEventInThreadBaseProperties + { + /// Initializes a new instance of AcsChatMessageEditedInThreadEventData. + internal AcsChatMessageEditedInThreadEventData() + { + } + + /// Initializes a new instance of AcsChatMessageEditedInThreadEventData. + /// The chat thread id. + /// The chat message id. + /// The communication identifier of the sender. + /// The display name of the sender. + /// The original compose time of the message. + /// The type of the message. + /// The version of the message. + /// The body of the chat message. + /// The time at which the message was edited. + internal AcsChatMessageEditedInThreadEventData(string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, string messageBody, DateTimeOffset? editTime) : base(threadId, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) + { + MessageBody = messageBody; + EditTime = editTime; + } + + /// The body of the chat message. + public string MessageBody { get; } + /// The time at which the message was edited. + public DateTimeOffset? EditTime { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEventInThreadBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEventInThreadBaseProperties.Serialization.cs new file mode 100644 index 0000000000000..a027048a8dbe4 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEventInThreadBaseProperties.Serialization.cs @@ -0,0 +1,96 @@ +// 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(AcsChatMessageEventInThreadBasePropertiesConverter))] + public partial class AcsChatMessageEventInThreadBaseProperties + { + internal static AcsChatMessageEventInThreadBaseProperties DeserializeAcsChatMessageEventInThreadBaseProperties(JsonElement element) + { + Optional messageId = default; + Optional senderCommunicationIdentifier = default; + Optional senderDisplayName = default; + Optional composeTime = default; + Optional type = default; + Optional version = default; + Optional threadId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("messageId")) + { + messageId = property.Value.GetString(); + continue; + } + if (property.NameEquals("senderCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("senderDisplayName")) + { + senderDisplayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("composeTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + composeTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("version")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + version = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("threadId")) + { + threadId = property.Value.GetString(); + continue; + } + } + return new AcsChatMessageEventInThreadBaseProperties(threadId.Value, messageId.Value, senderCommunicationIdentifier.Value, senderDisplayName.Value, Optional.ToNullable(composeTime), type.Value, Optional.ToNullable(version)); + } + + internal partial class AcsChatMessageEventInThreadBasePropertiesConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatMessageEventInThreadBaseProperties model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatMessageEventInThreadBaseProperties Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatMessageEventInThreadBaseProperties(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEventInThreadBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEventInThreadBaseProperties.cs new file mode 100644 index 0000000000000..86318931600f7 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEventInThreadBaseProperties.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of common properties of all thread-level chat message events. + public partial class AcsChatMessageEventInThreadBaseProperties : AcsChatEventInThreadBaseProperties + { + /// Initializes a new instance of AcsChatMessageEventInThreadBaseProperties. + internal AcsChatMessageEventInThreadBaseProperties() + { + } + + /// Initializes a new instance of AcsChatMessageEventInThreadBaseProperties. + /// The chat thread id. + /// The chat message id. + /// The communication identifier of the sender. + /// The display name of the sender. + /// The original compose time of the message. + /// The type of the message. + /// The version of the message. + internal AcsChatMessageEventInThreadBaseProperties(string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version) : base(threadId) + { + MessageId = messageId; + SenderCommunicationIdentifier = senderCommunicationIdentifier; + SenderDisplayName = senderDisplayName; + ComposeTime = composeTime; + Type = type; + Version = version; + } + + /// The chat message id. + public string MessageId { get; } + /// The communication identifier of the sender. + public CommunicationIdentifierModel SenderCommunicationIdentifier { get; } + /// The display name of the sender. + public string SenderDisplayName { get; } + /// The original compose time of the message. + public DateTimeOffset? ComposeTime { get; } + /// The type of the message. + public string Type { get; } + /// The version of the message. + public long? Version { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageReceivedInThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageReceivedInThreadEventData.Serialization.cs new file mode 100644 index 0000000000000..3cd1c21704d20 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageReceivedInThreadEventData.Serialization.cs @@ -0,0 +1,102 @@ +// 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(AcsChatMessageReceivedInThreadEventDataConverter))] + public partial class AcsChatMessageReceivedInThreadEventData + { + internal static AcsChatMessageReceivedInThreadEventData DeserializeAcsChatMessageReceivedInThreadEventData(JsonElement element) + { + Optional messageBody = default; + Optional messageId = default; + Optional senderCommunicationIdentifier = default; + Optional senderDisplayName = default; + Optional composeTime = default; + Optional type = default; + Optional version = default; + Optional threadId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("messageBody")) + { + messageBody = property.Value.GetString(); + continue; + } + if (property.NameEquals("messageId")) + { + messageId = property.Value.GetString(); + continue; + } + if (property.NameEquals("senderCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("senderDisplayName")) + { + senderDisplayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("composeTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + composeTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("version")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + version = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("threadId")) + { + threadId = property.Value.GetString(); + continue; + } + } + return new AcsChatMessageReceivedInThreadEventData(threadId.Value, messageId.Value, senderCommunicationIdentifier.Value, senderDisplayName.Value, Optional.ToNullable(composeTime), type.Value, Optional.ToNullable(version), messageBody.Value); + } + + internal partial class AcsChatMessageReceivedInThreadEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatMessageReceivedInThreadEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatMessageReceivedInThreadEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatMessageReceivedInThreadEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageReceivedInThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageReceivedInThreadEventData.cs new file mode 100644 index 0000000000000..8e5880a60767c --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageReceivedInThreadEventData.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageReceivedInThread event. + public partial class AcsChatMessageReceivedInThreadEventData : AcsChatMessageEventInThreadBaseProperties + { + /// Initializes a new instance of AcsChatMessageReceivedInThreadEventData. + internal AcsChatMessageReceivedInThreadEventData() + { + } + + /// Initializes a new instance of AcsChatMessageReceivedInThreadEventData. + /// The chat thread id. + /// The chat message id. + /// The communication identifier of the sender. + /// The display name of the sender. + /// The original compose time of the message. + /// The type of the message. + /// The version of the message. + /// The body of the chat message. + internal AcsChatMessageReceivedInThreadEventData(string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, string messageBody) : base(threadId, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) + { + MessageBody = messageBody; + } + + /// The body of the chat message. + public string MessageBody { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMemberRemovedFromThreadWithUserEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantAddedToThreadEventData.Serialization.cs similarity index 52% rename from sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMemberRemovedFromThreadWithUserEventData.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantAddedToThreadEventData.Serialization.cs index 01063b6c5dd7a..7c7694d3a6350 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMemberRemovedFromThreadWithUserEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantAddedToThreadEventData.Serialization.cs @@ -7,21 +7,20 @@ using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ACSChatMemberRemovedFromThreadWithUserEventData + [JsonConverter(typeof(AcsChatParticipantAddedToThreadEventDataConverter))] + public partial class AcsChatParticipantAddedToThreadEventData { - internal static ACSChatMemberRemovedFromThreadWithUserEventData DeserializeACSChatMemberRemovedFromThreadWithUserEventData(JsonElement element) + internal static AcsChatParticipantAddedToThreadEventData DeserializeAcsChatParticipantAddedToThreadEventData(JsonElement element) { Optional time = default; - Optional removedBy = default; - Optional memberRemoved = default; - Optional createTime = default; + Optional addedByCommunicationIdentifier = default; + Optional participantAdded = default; Optional version = default; - Optional recipientId = default; - Optional transactionId = default; Optional threadId = default; foreach (var property in element.EnumerateObject()) { @@ -35,29 +34,24 @@ internal static ACSChatMemberRemovedFromThreadWithUserEventData DeserializeACSCh time = property.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("removedBy")) - { - removedBy = property.Value.GetString(); - continue; - } - if (property.NameEquals("memberRemoved")) + if (property.NameEquals("addedByCommunicationIdentifier")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } - memberRemoved = ACSChatThreadMemberProperties.DeserializeACSChatThreadMemberProperties(property.Value); + addedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); continue; } - if (property.NameEquals("createTime")) + if (property.NameEquals("participantAdded")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } - createTime = property.Value.GetDateTimeOffset("O"); + participantAdded = AcsChatThreadParticipantProperties.DeserializeAcsChatThreadParticipantProperties(property.Value); continue; } if (property.NameEquals("version")) @@ -70,23 +64,26 @@ internal static ACSChatMemberRemovedFromThreadWithUserEventData DeserializeACSCh version = property.Value.GetInt64(); continue; } - if (property.NameEquals("recipientId")) - { - recipientId = property.Value.GetString(); - continue; - } - if (property.NameEquals("transactionId")) - { - transactionId = property.Value.GetString(); - continue; - } if (property.NameEquals("threadId")) { threadId = property.Value.GetString(); continue; } } - return new ACSChatMemberRemovedFromThreadWithUserEventData(recipientId.Value, transactionId.Value, threadId.Value, Optional.ToNullable(createTime), Optional.ToNullable(version), Optional.ToNullable(time), removedBy.Value, memberRemoved.Value); + return new AcsChatParticipantAddedToThreadEventData(threadId.Value, Optional.ToNullable(time), addedByCommunicationIdentifier.Value, participantAdded.Value, Optional.ToNullable(version)); + } + + internal partial class AcsChatParticipantAddedToThreadEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatParticipantAddedToThreadEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatParticipantAddedToThreadEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatParticipantAddedToThreadEventData(document.RootElement); + } } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantAddedToThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantAddedToThreadEventData.cs new file mode 100644 index 0000000000000..d4415cdbc770f --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantAddedToThreadEventData.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatParticipantAddedToThread event. + public partial class AcsChatParticipantAddedToThreadEventData : AcsChatEventInThreadBaseProperties + { + /// Initializes a new instance of AcsChatParticipantAddedToThreadEventData. + internal AcsChatParticipantAddedToThreadEventData() + { + } + + /// Initializes a new instance of AcsChatParticipantAddedToThreadEventData. + /// The chat thread id. + /// The time at which the user was added to the thread. + /// The communication identifier of the user who added the user. + /// The details of the user who was added. + /// The version of the thread. + internal AcsChatParticipantAddedToThreadEventData(string threadId, DateTimeOffset? time, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded, long? version) : base(threadId) + { + Time = time; + AddedByCommunicationIdentifier = addedByCommunicationIdentifier; + ParticipantAdded = participantAdded; + Version = version; + } + + /// The time at which the user was added to the thread. + public DateTimeOffset? Time { get; } + /// The communication identifier of the user who added the user. + public CommunicationIdentifierModel AddedByCommunicationIdentifier { get; } + /// The details of the user who was added. + public AcsChatThreadParticipantProperties ParticipantAdded { get; } + /// The version of the thread. + public long? Version { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantAddedToThreadWithUserEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantAddedToThreadWithUserEventData.Serialization.cs new file mode 100644 index 0000000000000..80943a67e812d --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantAddedToThreadWithUserEventData.Serialization.cs @@ -0,0 +1,117 @@ +// 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(AcsChatParticipantAddedToThreadWithUserEventDataConverter))] + public partial class AcsChatParticipantAddedToThreadWithUserEventData + { + internal static AcsChatParticipantAddedToThreadWithUserEventData DeserializeAcsChatParticipantAddedToThreadWithUserEventData(JsonElement element) + { + Optional time = default; + Optional addedByCommunicationIdentifier = default; + Optional participantAdded = default; + Optional createTime = default; + Optional version = default; + Optional recipientCommunicationIdentifier = default; + Optional transactionId = default; + Optional threadId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("time")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + time = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("addedByCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + addedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("participantAdded")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + participantAdded = AcsChatThreadParticipantProperties.DeserializeAcsChatThreadParticipantProperties(property.Value); + continue; + } + if (property.NameEquals("createTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + createTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("version")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + version = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("recipientCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("transactionId")) + { + transactionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("threadId")) + { + threadId = property.Value.GetString(); + continue; + } + } + return new AcsChatParticipantAddedToThreadWithUserEventData(recipientCommunicationIdentifier.Value, transactionId.Value, threadId.Value, Optional.ToNullable(createTime), Optional.ToNullable(version), Optional.ToNullable(time), addedByCommunicationIdentifier.Value, participantAdded.Value); + } + + internal partial class AcsChatParticipantAddedToThreadWithUserEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatParticipantAddedToThreadWithUserEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatParticipantAddedToThreadWithUserEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatParticipantAddedToThreadWithUserEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantAddedToThreadWithUserEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantAddedToThreadWithUserEventData.cs new file mode 100644 index 0000000000000..ded0684fd7885 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantAddedToThreadWithUserEventData.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatParticipantAddedToThreadWithUser event. + public partial class AcsChatParticipantAddedToThreadWithUserEventData : AcsChatThreadEventBaseProperties + { + /// Initializes a new instance of AcsChatParticipantAddedToThreadWithUserEventData. + internal AcsChatParticipantAddedToThreadWithUserEventData() + { + } + + /// Initializes a new instance of AcsChatParticipantAddedToThreadWithUserEventData. + /// The communication identifier of the target user. + /// The transaction id will be used as co-relation vector. + /// The chat thread id. + /// The original creation time of the thread. + /// The version of the thread. + /// The time at which the user was added to the thread. + /// The communication identifier of the user who added the user. + /// The details of the user who was added. + internal AcsChatParticipantAddedToThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, DateTimeOffset? createTime, long? version, DateTimeOffset? time, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded) : base(recipientCommunicationIdentifier, transactionId, threadId, createTime, version) + { + Time = time; + AddedByCommunicationIdentifier = addedByCommunicationIdentifier; + ParticipantAdded = participantAdded; + } + + /// The time at which the user was added to the thread. + public DateTimeOffset? Time { get; } + /// The communication identifier of the user who added the user. + public CommunicationIdentifierModel AddedByCommunicationIdentifier { get; } + /// The details of the user who was added. + public AcsChatThreadParticipantProperties ParticipantAdded { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantRemovedFromThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantRemovedFromThreadEventData.Serialization.cs new file mode 100644 index 0000000000000..b1d7b1cdd1903 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantRemovedFromThreadEventData.Serialization.cs @@ -0,0 +1,89 @@ +// 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(AcsChatParticipantRemovedFromThreadEventDataConverter))] + public partial class AcsChatParticipantRemovedFromThreadEventData + { + internal static AcsChatParticipantRemovedFromThreadEventData DeserializeAcsChatParticipantRemovedFromThreadEventData(JsonElement element) + { + Optional time = default; + Optional removedByCommunicationIdentifier = default; + Optional participantRemoved = default; + Optional version = default; + Optional threadId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("time")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + time = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("removedByCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + removedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("participantRemoved")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + participantRemoved = AcsChatThreadParticipantProperties.DeserializeAcsChatThreadParticipantProperties(property.Value); + continue; + } + if (property.NameEquals("version")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + version = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("threadId")) + { + threadId = property.Value.GetString(); + continue; + } + } + return new AcsChatParticipantRemovedFromThreadEventData(threadId.Value, Optional.ToNullable(time), removedByCommunicationIdentifier.Value, participantRemoved.Value, Optional.ToNullable(version)); + } + + internal partial class AcsChatParticipantRemovedFromThreadEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatParticipantRemovedFromThreadEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatParticipantRemovedFromThreadEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatParticipantRemovedFromThreadEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantRemovedFromThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantRemovedFromThreadEventData.cs new file mode 100644 index 0000000000000..9ca616697fad7 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantRemovedFromThreadEventData.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatParticipantRemovedFromThread event. + public partial class AcsChatParticipantRemovedFromThreadEventData : AcsChatEventInThreadBaseProperties + { + /// Initializes a new instance of AcsChatParticipantRemovedFromThreadEventData. + internal AcsChatParticipantRemovedFromThreadEventData() + { + } + + /// Initializes a new instance of AcsChatParticipantRemovedFromThreadEventData. + /// The chat thread id. + /// The time at which the user was removed to the thread. + /// The communication identifier of the user who removed the user. + /// The details of the user who was removed. + /// The version of the thread. + internal AcsChatParticipantRemovedFromThreadEventData(string threadId, DateTimeOffset? time, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved, long? version) : base(threadId) + { + Time = time; + RemovedByCommunicationIdentifier = removedByCommunicationIdentifier; + ParticipantRemoved = participantRemoved; + Version = version; + } + + /// The time at which the user was removed to the thread. + public DateTimeOffset? Time { get; } + /// The communication identifier of the user who removed the user. + public CommunicationIdentifierModel RemovedByCommunicationIdentifier { get; } + /// The details of the user who was removed. + public AcsChatThreadParticipantProperties ParticipantRemoved { get; } + /// The version of the thread. + public long? Version { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantRemovedFromThreadWithUserEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantRemovedFromThreadWithUserEventData.Serialization.cs new file mode 100644 index 0000000000000..3d4af0ab896ce --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantRemovedFromThreadWithUserEventData.Serialization.cs @@ -0,0 +1,117 @@ +// 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(AcsChatParticipantRemovedFromThreadWithUserEventDataConverter))] + public partial class AcsChatParticipantRemovedFromThreadWithUserEventData + { + internal static AcsChatParticipantRemovedFromThreadWithUserEventData DeserializeAcsChatParticipantRemovedFromThreadWithUserEventData(JsonElement element) + { + Optional time = default; + Optional removedByCommunicationIdentifier = default; + Optional participantRemoved = default; + Optional createTime = default; + Optional version = default; + Optional recipientCommunicationIdentifier = default; + Optional transactionId = default; + Optional threadId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("time")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + time = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("removedByCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + removedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("participantRemoved")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + participantRemoved = AcsChatThreadParticipantProperties.DeserializeAcsChatThreadParticipantProperties(property.Value); + continue; + } + if (property.NameEquals("createTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + createTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("version")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + version = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("recipientCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("transactionId")) + { + transactionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("threadId")) + { + threadId = property.Value.GetString(); + continue; + } + } + return new AcsChatParticipantRemovedFromThreadWithUserEventData(recipientCommunicationIdentifier.Value, transactionId.Value, threadId.Value, Optional.ToNullable(createTime), Optional.ToNullable(version), Optional.ToNullable(time), removedByCommunicationIdentifier.Value, participantRemoved.Value); + } + + internal partial class AcsChatParticipantRemovedFromThreadWithUserEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatParticipantRemovedFromThreadWithUserEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatParticipantRemovedFromThreadWithUserEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatParticipantRemovedFromThreadWithUserEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantRemovedFromThreadWithUserEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantRemovedFromThreadWithUserEventData.cs new file mode 100644 index 0000000000000..aa00b729a17a3 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatParticipantRemovedFromThreadWithUserEventData.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatParticipantRemovedFromThreadWithUser event. + public partial class AcsChatParticipantRemovedFromThreadWithUserEventData : AcsChatThreadEventBaseProperties + { + /// Initializes a new instance of AcsChatParticipantRemovedFromThreadWithUserEventData. + internal AcsChatParticipantRemovedFromThreadWithUserEventData() + { + } + + /// Initializes a new instance of AcsChatParticipantRemovedFromThreadWithUserEventData. + /// The communication identifier of the target user. + /// The transaction id will be used as co-relation vector. + /// The chat thread id. + /// The original creation time of the thread. + /// The version of the thread. + /// The time at which the user was removed to the thread. + /// The communication identifier of the user who removed the user. + /// The details of the user who was removed. + internal AcsChatParticipantRemovedFromThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, DateTimeOffset? createTime, long? version, DateTimeOffset? time, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved) : base(recipientCommunicationIdentifier, transactionId, threadId, createTime, version) + { + Time = time; + RemovedByCommunicationIdentifier = removedByCommunicationIdentifier; + ParticipantRemoved = participantRemoved; + } + + /// The time at which the user was removed to the thread. + public DateTimeOffset? Time { get; } + /// The communication identifier of the user who removed the user. + public CommunicationIdentifierModel RemovedByCommunicationIdentifier { get; } + /// The details of the user who was removed. + public AcsChatThreadParticipantProperties ParticipantRemoved { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadCreatedEventData.Serialization.cs new file mode 100644 index 0000000000000..5ab7d8eb9ed9b --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadCreatedEventData.Serialization.cs @@ -0,0 +1,111 @@ +// 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(AcsChatThreadCreatedEventDataConverter))] + public partial class AcsChatThreadCreatedEventData + { + internal static AcsChatThreadCreatedEventData DeserializeAcsChatThreadCreatedEventData(JsonElement element) + { + Optional createdByCommunicationIdentifier = default; + Optional> properties = default; + Optional> participants = default; + Optional createTime = default; + Optional version = default; + Optional threadId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("createdByCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + createdByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetObject()); + } + properties = dictionary; + continue; + } + if (property.NameEquals("participants")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AcsChatThreadParticipantProperties.DeserializeAcsChatThreadParticipantProperties(item)); + } + participants = array; + continue; + } + if (property.NameEquals("createTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + createTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("version")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + version = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("threadId")) + { + threadId = property.Value.GetString(); + continue; + } + } + return new AcsChatThreadCreatedEventData(threadId.Value, Optional.ToNullable(createTime), Optional.ToNullable(version), createdByCommunicationIdentifier.Value, Optional.ToDictionary(properties), Optional.ToList(participants)); + } + + internal partial class AcsChatThreadCreatedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatThreadCreatedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatThreadCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatThreadCreatedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadCreatedEventData.cs new file mode 100644 index 0000000000000..2eb0e6bbb65f1 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadCreatedEventData.cs @@ -0,0 +1,45 @@ +// 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 an Microsoft.Communication.ChatThreadCreatedWithUser event. + public partial class AcsChatThreadCreatedEventData : AcsChatThreadEventInThreadBaseProperties + { + /// Initializes a new instance of AcsChatThreadCreatedEventData. + internal AcsChatThreadCreatedEventData() + { + Properties = new ChangeTrackingDictionary(); + Participants = new ChangeTrackingList(); + } + + /// Initializes a new instance of AcsChatThreadCreatedEventData. + /// The chat thread id. + /// The original creation time of the thread. + /// The version of the thread. + /// The communication identifier of the user who created the thread. + /// The thread properties. + /// The list of properties of participants who are part of the thread. + internal AcsChatThreadCreatedEventData(string threadId, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyList participants) : base(threadId, createTime, version) + { + CreatedByCommunicationIdentifier = createdByCommunicationIdentifier; + Properties = properties; + Participants = participants; + } + + /// The communication identifier of the user who created the thread. + public CommunicationIdentifierModel CreatedByCommunicationIdentifier { get; } + /// The thread properties. + public IReadOnlyDictionary Properties { get; } + /// The list of properties of participants who are part of the thread. + public IReadOnlyList Participants { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMemberAddedToThreadWithUserEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadDeletedEventData.Serialization.cs similarity index 55% rename from sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMemberAddedToThreadWithUserEventData.Serialization.cs rename to sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadDeletedEventData.Serialization.cs index 840e2613dc500..a987da20bd693 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ACSChatMemberAddedToThreadWithUserEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadDeletedEventData.Serialization.cs @@ -7,47 +7,41 @@ using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { - public partial class ACSChatMemberAddedToThreadWithUserEventData + [JsonConverter(typeof(AcsChatThreadDeletedEventDataConverter))] + public partial class AcsChatThreadDeletedEventData { - internal static ACSChatMemberAddedToThreadWithUserEventData DeserializeACSChatMemberAddedToThreadWithUserEventData(JsonElement element) + internal static AcsChatThreadDeletedEventData DeserializeAcsChatThreadDeletedEventData(JsonElement element) { - Optional time = default; - Optional addedBy = default; - Optional memberAdded = default; + Optional deletedByCommunicationIdentifier = default; + Optional deleteTime = default; Optional createTime = default; Optional version = default; - Optional recipientId = default; - Optional transactionId = default; Optional threadId = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("time")) + if (property.NameEquals("deletedByCommunicationIdentifier")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } - time = property.Value.GetDateTimeOffset("O"); + deletedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); continue; } - if (property.NameEquals("addedBy")) - { - addedBy = property.Value.GetString(); - continue; - } - if (property.NameEquals("memberAdded")) + if (property.NameEquals("deleteTime")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } - memberAdded = ACSChatThreadMemberProperties.DeserializeACSChatThreadMemberProperties(property.Value); + deleteTime = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("createTime")) @@ -70,23 +64,26 @@ internal static ACSChatMemberAddedToThreadWithUserEventData DeserializeACSChatMe version = property.Value.GetInt64(); continue; } - if (property.NameEquals("recipientId")) - { - recipientId = property.Value.GetString(); - continue; - } - if (property.NameEquals("transactionId")) - { - transactionId = property.Value.GetString(); - continue; - } if (property.NameEquals("threadId")) { threadId = property.Value.GetString(); continue; } } - return new ACSChatMemberAddedToThreadWithUserEventData(recipientId.Value, transactionId.Value, threadId.Value, Optional.ToNullable(createTime), Optional.ToNullable(version), Optional.ToNullable(time), addedBy.Value, memberAdded.Value); + return new AcsChatThreadDeletedEventData(threadId.Value, Optional.ToNullable(createTime), Optional.ToNullable(version), deletedByCommunicationIdentifier.Value, Optional.ToNullable(deleteTime)); + } + + internal partial class AcsChatThreadDeletedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatThreadDeletedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatThreadDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatThreadDeletedEventData(document.RootElement); + } } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadDeletedEventData.cs new file mode 100644 index 0000000000000..94d4a87343001 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadDeletedEventData.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadDeleted event. + public partial class AcsChatThreadDeletedEventData : AcsChatThreadEventInThreadBaseProperties + { + /// Initializes a new instance of AcsChatThreadDeletedEventData. + internal AcsChatThreadDeletedEventData() + { + } + + /// Initializes a new instance of AcsChatThreadDeletedEventData. + /// The chat thread id. + /// The original creation time of the thread. + /// The version of the thread. + /// The communication identifier of the user who deleted the thread. + /// The deletion time of the thread. + internal AcsChatThreadDeletedEventData(string threadId, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel deletedByCommunicationIdentifier, DateTimeOffset? deleteTime) : base(threadId, createTime, version) + { + DeletedByCommunicationIdentifier = deletedByCommunicationIdentifier; + DeleteTime = deleteTime; + } + + /// The communication identifier of the user who deleted the thread. + public CommunicationIdentifierModel DeletedByCommunicationIdentifier { get; } + /// The deletion time of the thread. + public DateTimeOffset? DeleteTime { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadEventInThreadBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadEventInThreadBaseProperties.Serialization.cs new file mode 100644 index 0000000000000..d801bb31966a4 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadEventInThreadBaseProperties.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(AcsChatThreadEventInThreadBasePropertiesConverter))] + public partial class AcsChatThreadEventInThreadBaseProperties + { + internal static AcsChatThreadEventInThreadBaseProperties DeserializeAcsChatThreadEventInThreadBaseProperties(JsonElement element) + { + Optional createTime = default; + Optional version = default; + Optional threadId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("createTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + createTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("version")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + version = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("threadId")) + { + threadId = property.Value.GetString(); + continue; + } + } + return new AcsChatThreadEventInThreadBaseProperties(threadId.Value, Optional.ToNullable(createTime), Optional.ToNullable(version)); + } + + internal partial class AcsChatThreadEventInThreadBasePropertiesConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatThreadEventInThreadBaseProperties model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatThreadEventInThreadBaseProperties Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatThreadEventInThreadBaseProperties(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadEventInThreadBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadEventInThreadBaseProperties.cs new file mode 100644 index 0000000000000..77b923bddfb8a --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadEventInThreadBaseProperties.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of common properties of all chat thread events. + public partial class AcsChatThreadEventInThreadBaseProperties : AcsChatEventInThreadBaseProperties + { + /// Initializes a new instance of AcsChatThreadEventInThreadBaseProperties. + internal AcsChatThreadEventInThreadBaseProperties() + { + } + + /// Initializes a new instance of AcsChatThreadEventInThreadBaseProperties. + /// The chat thread id. + /// The original creation time of the thread. + /// The version of the thread. + internal AcsChatThreadEventInThreadBaseProperties(string threadId, DateTimeOffset? createTime, long? version) : base(threadId) + { + CreateTime = createTime; + Version = version; + } + + /// The original creation time of the thread. + public DateTimeOffset? CreateTime { get; } + /// The version of the thread. + public long? Version { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadParticipantProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadParticipantProperties.Serialization.cs new file mode 100644 index 0000000000000..69a8958a924c5 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadParticipantProperties.Serialization.cs @@ -0,0 +1,56 @@ +// 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(AcsChatThreadParticipantPropertiesConverter))] + public partial class AcsChatThreadParticipantProperties + { + internal static AcsChatThreadParticipantProperties DeserializeAcsChatThreadParticipantProperties(JsonElement element) + { + Optional displayName = default; + Optional participantCommunicationIdentifier = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("displayName")) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("participantCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + participantCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + } + return new AcsChatThreadParticipantProperties(displayName.Value, participantCommunicationIdentifier.Value); + } + + internal partial class AcsChatThreadParticipantPropertiesConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatThreadParticipantProperties model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatThreadParticipantProperties Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatThreadParticipantProperties(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadParticipantProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadParticipantProperties.cs new file mode 100644 index 0000000000000..b91008ed27187 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadParticipantProperties.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the chat thread participant. + public partial class AcsChatThreadParticipantProperties + { + /// Initializes a new instance of AcsChatThreadParticipantProperties. + internal AcsChatThreadParticipantProperties() + { + } + + /// Initializes a new instance of AcsChatThreadParticipantProperties. + /// The name of the user. + /// The communication identifier of the user. + internal AcsChatThreadParticipantProperties(string displayName, CommunicationIdentifierModel participantCommunicationIdentifier) + { + DisplayName = displayName; + ParticipantCommunicationIdentifier = participantCommunicationIdentifier; + } + + /// The name of the user. + public string DisplayName { get; } + /// The communication identifier of the user. + public CommunicationIdentifierModel ParticipantCommunicationIdentifier { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadPropertiesUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadPropertiesUpdatedEventData.Serialization.cs new file mode 100644 index 0000000000000..42f86212396be --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadPropertiesUpdatedEventData.Serialization.cs @@ -0,0 +1,106 @@ +// 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(AcsChatThreadPropertiesUpdatedEventDataConverter))] + public partial class AcsChatThreadPropertiesUpdatedEventData + { + internal static AcsChatThreadPropertiesUpdatedEventData DeserializeAcsChatThreadPropertiesUpdatedEventData(JsonElement element) + { + Optional editedByCommunicationIdentifier = default; + Optional editTime = default; + Optional> properties = default; + Optional createTime = default; + Optional version = default; + Optional threadId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("editedByCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + editedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("editTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + editTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetObject()); + } + properties = dictionary; + continue; + } + if (property.NameEquals("createTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + createTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("version")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + version = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("threadId")) + { + threadId = property.Value.GetString(); + continue; + } + } + return new AcsChatThreadPropertiesUpdatedEventData(threadId.Value, Optional.ToNullable(createTime), Optional.ToNullable(version), editedByCommunicationIdentifier.Value, Optional.ToNullable(editTime), Optional.ToDictionary(properties)); + } + + internal partial class AcsChatThreadPropertiesUpdatedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatThreadPropertiesUpdatedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatThreadPropertiesUpdatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatThreadPropertiesUpdatedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadPropertiesUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadPropertiesUpdatedEventData.cs new file mode 100644 index 0000000000000..81f679b3b017d --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadPropertiesUpdatedEventData.cs @@ -0,0 +1,44 @@ +// 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 an Microsoft.Communication.ChatThreadPropertiesUpdated event. + public partial class AcsChatThreadPropertiesUpdatedEventData : AcsChatThreadEventInThreadBaseProperties + { + /// Initializes a new instance of AcsChatThreadPropertiesUpdatedEventData. + internal AcsChatThreadPropertiesUpdatedEventData() + { + Properties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of AcsChatThreadPropertiesUpdatedEventData. + /// The chat thread id. + /// The original creation time of the thread. + /// The version of the thread. + /// The communication identifier of the user who updated the thread properties. + /// The time at which the properties of the thread were updated. + /// The updated thread properties. + internal AcsChatThreadPropertiesUpdatedEventData(string threadId, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel editedByCommunicationIdentifier, DateTimeOffset? editTime, IReadOnlyDictionary properties) : base(threadId, createTime, version) + { + EditedByCommunicationIdentifier = editedByCommunicationIdentifier; + EditTime = editTime; + Properties = properties; + } + + /// The communication identifier of the user who updated the thread properties. + public CommunicationIdentifierModel EditedByCommunicationIdentifier { get; } + /// The time at which the properties of the thread were updated. + public DateTimeOffset? EditTime { get; } + /// The updated thread properties. + public IReadOnlyDictionary Properties { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsSmsDeliveryAttemptProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsSmsDeliveryAttemptProperties.Serialization.cs index 0196a9f4af9af..1d662ad8133f5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsSmsDeliveryAttemptProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsSmsDeliveryAttemptProperties.Serialization.cs @@ -7,10 +7,12 @@ using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(AcsSmsDeliveryAttemptPropertiesConverter))] public partial class AcsSmsDeliveryAttemptProperties { internal static AcsSmsDeliveryAttemptProperties DeserializeAcsSmsDeliveryAttemptProperties(JsonElement element) @@ -53,5 +55,18 @@ internal static AcsSmsDeliveryAttemptProperties DeserializeAcsSmsDeliveryAttempt } return new AcsSmsDeliveryAttemptProperties(Optional.ToNullable(timestamp), Optional.ToNullable(segmentsSucceeded), Optional.ToNullable(segmentsFailed)); } + + internal partial class AcsSmsDeliveryAttemptPropertiesConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsSmsDeliveryAttemptProperties model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsSmsDeliveryAttemptProperties Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsSmsDeliveryAttemptProperties(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsSmsDeliveryReportReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsSmsDeliveryReportReceivedEventData.Serialization.cs index 281047ace8802..374642fe5667c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsSmsDeliveryReportReceivedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsSmsDeliveryReportReceivedEventData.Serialization.cs @@ -8,10 +8,12 @@ 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(AcsSmsDeliveryReportReceivedEventDataConverter))] public partial class AcsSmsDeliveryReportReceivedEventData { internal static AcsSmsDeliveryReportReceivedEventData DeserializeAcsSmsDeliveryReportReceivedEventData(JsonElement element) @@ -78,5 +80,18 @@ internal static AcsSmsDeliveryReportReceivedEventData DeserializeAcsSmsDeliveryR } return new AcsSmsDeliveryReportReceivedEventData(messageId.Value, @from.Value, to.Value, deliveryStatus.Value, deliveryStatusDetails.Value, Optional.ToList(deliveryAttempts), Optional.ToNullable(receivedTimestamp)); } + + internal partial class AcsSmsDeliveryReportReceivedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsSmsDeliveryReportReceivedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsSmsDeliveryReportReceivedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsSmsDeliveryReportReceivedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsSmsEventBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsSmsEventBaseProperties.Serialization.cs index 915a99ae74918..26649bd865ce2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsSmsEventBaseProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsSmsEventBaseProperties.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(AcsSmsEventBasePropertiesConverter))] public partial class AcsSmsEventBaseProperties { internal static AcsSmsEventBaseProperties DeserializeAcsSmsEventBaseProperties(JsonElement element) @@ -37,5 +40,18 @@ internal static AcsSmsEventBaseProperties DeserializeAcsSmsEventBaseProperties(J } return new AcsSmsEventBaseProperties(messageId.Value, @from.Value, to.Value); } + + internal partial class AcsSmsEventBasePropertiesConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsSmsEventBaseProperties model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsSmsEventBaseProperties Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsSmsEventBaseProperties(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsSmsReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsSmsReceivedEventData.Serialization.cs index 7f35349851f14..8f003c6e1e7f2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsSmsReceivedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsSmsReceivedEventData.Serialization.cs @@ -7,10 +7,12 @@ using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(AcsSmsReceivedEventDataConverter))] public partial class AcsSmsReceivedEventData { internal static AcsSmsReceivedEventData DeserializeAcsSmsReceivedEventData(JsonElement element) @@ -55,5 +57,18 @@ internal static AcsSmsReceivedEventData DeserializeAcsSmsReceivedEventData(JsonE } return new AcsSmsReceivedEventData(messageId.Value, @from.Value, to.Value, message.Value, Optional.ToNullable(receivedTimestamp)); } + + internal partial class AcsSmsReceivedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsSmsReceivedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsSmsReceivedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsSmsReceivedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationKeyValueDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationKeyValueDeletedEventData.Serialization.cs index e382e51e6e641..a86db79c1fef4 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationKeyValueDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationKeyValueDeletedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(AppConfigurationKeyValueDeletedEventDataConverter))] public partial class AppConfigurationKeyValueDeletedEventData { internal static AppConfigurationKeyValueDeletedEventData DeserializeAppConfigurationKeyValueDeletedEventData(JsonElement element) @@ -17,6 +20,7 @@ internal static AppConfigurationKeyValueDeletedEventData DeserializeAppConfigura Optional key = default; Optional label = default; Optional etag = default; + Optional syncToken = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("key")) @@ -34,8 +38,26 @@ internal static AppConfigurationKeyValueDeletedEventData DeserializeAppConfigura etag = property.Value.GetString(); continue; } + if (property.NameEquals("syncToken")) + { + syncToken = property.Value.GetString(); + continue; + } + } + return new AppConfigurationKeyValueDeletedEventData(key.Value, label.Value, etag.Value, syncToken.Value); + } + + internal partial class AppConfigurationKeyValueDeletedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AppConfigurationKeyValueDeletedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AppConfigurationKeyValueDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAppConfigurationKeyValueDeletedEventData(document.RootElement); } - return new AppConfigurationKeyValueDeletedEventData(key.Value, label.Value, etag.Value); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationKeyValueDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationKeyValueDeletedEventData.cs index b1a604411abaf..e477c374045c2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationKeyValueDeletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationKeyValueDeletedEventData.cs @@ -19,11 +19,13 @@ internal AppConfigurationKeyValueDeletedEventData() /// The key used to identify the key-value that was deleted. /// The label, if any, used to identify the key-value that was deleted. /// The etag representing the key-value that was deleted. - internal AppConfigurationKeyValueDeletedEventData(string key, string label, string etag) + /// The sync token representing the server state after the event. + internal AppConfigurationKeyValueDeletedEventData(string key, string label, string etag, string syncToken) { Key = key; Label = label; Etag = etag; + SyncToken = syncToken; } /// The key used to identify the key-value that was deleted. @@ -32,5 +34,7 @@ internal AppConfigurationKeyValueDeletedEventData(string key, string label, stri public string Label { get; } /// The etag representing the key-value that was deleted. public string Etag { get; } + /// The sync token representing the server state after the event. + public string SyncToken { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationKeyValueModifiedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationKeyValueModifiedEventData.Serialization.cs index f49c3a3da417e..93ea4fa3b8a5e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationKeyValueModifiedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationKeyValueModifiedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(AppConfigurationKeyValueModifiedEventDataConverter))] public partial class AppConfigurationKeyValueModifiedEventData { internal static AppConfigurationKeyValueModifiedEventData DeserializeAppConfigurationKeyValueModifiedEventData(JsonElement element) @@ -17,6 +20,7 @@ internal static AppConfigurationKeyValueModifiedEventData DeserializeAppConfigur Optional key = default; Optional label = default; Optional etag = default; + Optional syncToken = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("key")) @@ -34,8 +38,26 @@ internal static AppConfigurationKeyValueModifiedEventData DeserializeAppConfigur etag = property.Value.GetString(); continue; } + if (property.NameEquals("syncToken")) + { + syncToken = property.Value.GetString(); + continue; + } + } + return new AppConfigurationKeyValueModifiedEventData(key.Value, label.Value, etag.Value, syncToken.Value); + } + + internal partial class AppConfigurationKeyValueModifiedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AppConfigurationKeyValueModifiedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AppConfigurationKeyValueModifiedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAppConfigurationKeyValueModifiedEventData(document.RootElement); } - return new AppConfigurationKeyValueModifiedEventData(key.Value, label.Value, etag.Value); } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationKeyValueModifiedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationKeyValueModifiedEventData.cs index b2df444709f71..a0b273e057e39 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationKeyValueModifiedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppConfigurationKeyValueModifiedEventData.cs @@ -19,11 +19,13 @@ internal AppConfigurationKeyValueModifiedEventData() /// The key used to identify the key-value that was modified. /// The label, if any, used to identify the key-value that was modified. /// The etag representing the new state of the key-value. - internal AppConfigurationKeyValueModifiedEventData(string key, string label, string etag) + /// The sync token representing the server state after the event. + internal AppConfigurationKeyValueModifiedEventData(string key, string label, string etag, string syncToken) { Key = key; Label = label; Etag = etag; + SyncToken = syncToken; } /// The key used to identify the key-value that was modified. @@ -32,5 +34,7 @@ internal AppConfigurationKeyValueModifiedEventData(string key, string label, str public string Label { get; } /// The etag representing the new state of the key-value. public string Etag { get; } + /// The sync token representing the server state after the event. + public string SyncToken { get; } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppEventTypeDetail.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppEventTypeDetail.Serialization.cs index 2453eda2ed6f4..f73a1856efdaf 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppEventTypeDetail.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppEventTypeDetail.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(AppEventTypeDetailConverter))] public partial class AppEventTypeDetail { internal static AppEventTypeDetail DeserializeAppEventTypeDetail(JsonElement element) @@ -30,5 +33,18 @@ internal static AppEventTypeDetail DeserializeAppEventTypeDetail(JsonElement ele } return new AppEventTypeDetail(Optional.ToNullable(action)); } + + internal partial class AppEventTypeDetailConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AppEventTypeDetail model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AppEventTypeDetail Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAppEventTypeDetail(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppServicePlanEventTypeDetail.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppServicePlanEventTypeDetail.Serialization.cs index ae84dad24420a..4814a0f865ce4 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppServicePlanEventTypeDetail.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AppServicePlanEventTypeDetail.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(AppServicePlanEventTypeDetailConverter))] public partial class AppServicePlanEventTypeDetail { internal static AppServicePlanEventTypeDetail DeserializeAppServicePlanEventTypeDetail(JsonElement element) @@ -52,5 +55,18 @@ internal static AppServicePlanEventTypeDetail DeserializeAppServicePlanEventType } return new AppServicePlanEventTypeDetail(Optional.ToNullable(stampKind), Optional.ToNullable(action), Optional.ToNullable(status)); } + + internal partial class AppServicePlanEventTypeDetailConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AppServicePlanEventTypeDetail model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AppServicePlanEventTypeDetail Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAppServicePlanEventTypeDetail(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CloudEventInternal.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CloudEventInternal.Serialization.cs index adda092d3a2db..efc284b75ca9f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CloudEventInternal.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CloudEventInternal.Serialization.cs @@ -8,10 +8,12 @@ using System; using System.Collections.Generic; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.Models { + [JsonConverter(typeof(CloudEventInternalConverter))] internal partial class CloudEventInternal : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) @@ -144,5 +146,18 @@ internal static CloudEventInternal DeserializeCloudEventInternal(JsonElement ele additionalProperties = additionalPropertiesDictionary; return new CloudEventInternal(id, source, data, dataBase64.Value, type, Optional.ToNullable(time), specversion, dataschema.Value, datacontenttype.Value, subject.Value, additionalProperties); } + + internal partial class CloudEventInternalConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, CloudEventInternal model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override CloudEventInternal Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeCloudEventInternal(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CommunicationCloudEnvironmentModel.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CommunicationCloudEnvironmentModel.cs new file mode 100644 index 0000000000000..ba72ab8b0d572 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CommunicationCloudEnvironmentModel.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// The cloud that the identifier belongs to. + public readonly partial struct CommunicationCloudEnvironmentModel : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public CommunicationCloudEnvironmentModel(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PublicValue = "public"; + private const string DodValue = "dod"; + private const string GcchValue = "gcch"; + + /// public. + public static CommunicationCloudEnvironmentModel Public { get; } = new CommunicationCloudEnvironmentModel(PublicValue); + /// dod. + public static CommunicationCloudEnvironmentModel Dod { get; } = new CommunicationCloudEnvironmentModel(DodValue); + /// gcch. + public static CommunicationCloudEnvironmentModel Gcch { get; } = new CommunicationCloudEnvironmentModel(GcchValue); + /// Determines if two values are the same. + public static bool operator ==(CommunicationCloudEnvironmentModel left, CommunicationCloudEnvironmentModel right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CommunicationCloudEnvironmentModel left, CommunicationCloudEnvironmentModel right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator CommunicationCloudEnvironmentModel(string value) => new CommunicationCloudEnvironmentModel(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CommunicationCloudEnvironmentModel other && Equals(other); + /// + public bool Equals(CommunicationCloudEnvironmentModel 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/CommunicationIdentifierModel.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CommunicationIdentifierModel.Serialization.cs new file mode 100644 index 0000000000000..407b46b1d32a7 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CommunicationIdentifierModel.Serialization.cs @@ -0,0 +1,78 @@ +// 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(CommunicationIdentifierModelConverter))] + public partial class CommunicationIdentifierModel + { + internal static CommunicationIdentifierModel DeserializeCommunicationIdentifierModel(JsonElement element) + { + Optional rawId = default; + Optional communicationUser = default; + Optional phoneNumber = default; + Optional microsoftTeamsUser = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("rawId")) + { + rawId = property.Value.GetString(); + continue; + } + if (property.NameEquals("communicationUser")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + communicationUser = CommunicationUserIdentifierModel.DeserializeCommunicationUserIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("phoneNumber")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + phoneNumber = PhoneNumberIdentifierModel.DeserializePhoneNumberIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("microsoftTeamsUser")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + microsoftTeamsUser = MicrosoftTeamsUserIdentifierModel.DeserializeMicrosoftTeamsUserIdentifierModel(property.Value); + continue; + } + } + return new CommunicationIdentifierModel(rawId.Value, communicationUser.Value, phoneNumber.Value, microsoftTeamsUser.Value); + } + + internal partial class CommunicationIdentifierModelConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, CommunicationIdentifierModel model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override CommunicationIdentifierModel Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeCommunicationIdentifierModel(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CommunicationIdentifierModel.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CommunicationIdentifierModel.cs new file mode 100644 index 0000000000000..6a5e09b870494 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CommunicationIdentifierModel.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Identifies a participant in Azure Communication services. A participant is, for example, a phone number or an Azure communication user. This model must be interpreted as a union: Apart from rawId, at most one further property may be set. + public partial class CommunicationIdentifierModel + { + /// Initializes a new instance of CommunicationIdentifierModel. + internal CommunicationIdentifierModel() + { + } + + /// Initializes a new instance of CommunicationIdentifierModel. + /// Raw Id of the identifier. Optional in requests, required in responses. + /// The communication user. + /// The phone number. + /// The Microsoft Teams user. + internal CommunicationIdentifierModel(string rawId, CommunicationUserIdentifierModel communicationUser, PhoneNumberIdentifierModel phoneNumber, MicrosoftTeamsUserIdentifierModel microsoftTeamsUser) + { + RawId = rawId; + CommunicationUser = communicationUser; + PhoneNumber = phoneNumber; + MicrosoftTeamsUser = microsoftTeamsUser; + } + + /// Raw Id of the identifier. Optional in requests, required in responses. + public string RawId { get; } + /// The communication user. + public CommunicationUserIdentifierModel CommunicationUser { get; } + /// The phone number. + public PhoneNumberIdentifierModel PhoneNumber { get; } + /// The Microsoft Teams user. + public MicrosoftTeamsUserIdentifierModel MicrosoftTeamsUser { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CommunicationUserIdentifierModel.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CommunicationUserIdentifierModel.Serialization.cs new file mode 100644 index 0000000000000..ab00fd6822147 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CommunicationUserIdentifierModel.Serialization.cs @@ -0,0 +1,45 @@ +// 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(CommunicationUserIdentifierModelConverter))] + public partial class CommunicationUserIdentifierModel + { + internal static CommunicationUserIdentifierModel DeserializeCommunicationUserIdentifierModel(JsonElement element) + { + string id = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + } + return new CommunicationUserIdentifierModel(id); + } + + internal partial class CommunicationUserIdentifierModelConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, CommunicationUserIdentifierModel model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override CommunicationUserIdentifierModel Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeCommunicationUserIdentifierModel(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CommunicationUserIdentifierModel.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CommunicationUserIdentifierModel.cs new file mode 100644 index 0000000000000..fb54265978746 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CommunicationUserIdentifierModel.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// A user that got created with an Azure Communication Services resource. + public partial class CommunicationUserIdentifierModel + { + /// Initializes a new instance of CommunicationUserIdentifierModel. + /// The Id of the communication user. + /// is null. + internal CommunicationUserIdentifierModel(string id) + { + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + + Id = id; + } + + /// The Id of the communication user. + public string Id { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryArtifactEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryArtifactEventData.Serialization.cs index 35860779f03c0..17a7a852b9022 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryArtifactEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryArtifactEventData.Serialization.cs @@ -7,10 +7,12 @@ using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(ContainerRegistryArtifactEventDataConverter))] public partial class ContainerRegistryArtifactEventData { internal static ContainerRegistryArtifactEventData DeserializeContainerRegistryArtifactEventData(JsonElement element) @@ -54,5 +56,18 @@ internal static ContainerRegistryArtifactEventData DeserializeContainerRegistryA } return new ContainerRegistryArtifactEventData(id.Value, Optional.ToNullable(timestamp), action.Value, target.Value); } + + internal partial class ContainerRegistryArtifactEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ContainerRegistryArtifactEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override ContainerRegistryArtifactEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryArtifactEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryArtifactEventTarget.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryArtifactEventTarget.Serialization.cs index d1dfc12fe5d41..4a7f957d6148e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryArtifactEventTarget.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryArtifactEventTarget.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(ContainerRegistryArtifactEventTargetConverter))] public partial class ContainerRegistryArtifactEventTarget { internal static ContainerRegistryArtifactEventTarget DeserializeContainerRegistryArtifactEventTarget(JsonElement element) @@ -66,5 +69,18 @@ internal static ContainerRegistryArtifactEventTarget DeserializeContainerRegistr } return new ContainerRegistryArtifactEventTarget(mediaType.Value, Optional.ToNullable(size), digest.Value, repository.Value, tag.Value, name.Value, version.Value); } + + internal partial class ContainerRegistryArtifactEventTargetConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ContainerRegistryArtifactEventTarget model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override ContainerRegistryArtifactEventTarget Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryArtifactEventTarget(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryChartDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryChartDeletedEventData.Serialization.cs index 879b17880352d..76e71a1b6e6e5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryChartDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryChartDeletedEventData.Serialization.cs @@ -7,10 +7,12 @@ using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(ContainerRegistryChartDeletedEventDataConverter))] public partial class ContainerRegistryChartDeletedEventData { internal static ContainerRegistryChartDeletedEventData DeserializeContainerRegistryChartDeletedEventData(JsonElement element) @@ -54,5 +56,18 @@ internal static ContainerRegistryChartDeletedEventData DeserializeContainerRegis } return new ContainerRegistryChartDeletedEventData(id.Value, Optional.ToNullable(timestamp), action.Value, target.Value); } + + internal partial class ContainerRegistryChartDeletedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ContainerRegistryChartDeletedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override ContainerRegistryChartDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryChartDeletedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryChartPushedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryChartPushedEventData.Serialization.cs index ac9d65acfcc24..2b08f253a04fe 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryChartPushedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryChartPushedEventData.Serialization.cs @@ -7,10 +7,12 @@ using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(ContainerRegistryChartPushedEventDataConverter))] public partial class ContainerRegistryChartPushedEventData { internal static ContainerRegistryChartPushedEventData DeserializeContainerRegistryChartPushedEventData(JsonElement element) @@ -54,5 +56,18 @@ internal static ContainerRegistryChartPushedEventData DeserializeContainerRegist } return new ContainerRegistryChartPushedEventData(id.Value, Optional.ToNullable(timestamp), action.Value, target.Value); } + + internal partial class ContainerRegistryChartPushedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ContainerRegistryChartPushedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override ContainerRegistryChartPushedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryChartPushedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryEventActor.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryEventActor.Serialization.cs index 8c5b1f1812e52..8a7ccec64c177 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryEventActor.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryEventActor.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(ContainerRegistryEventActorConverter))] public partial class ContainerRegistryEventActor { internal static ContainerRegistryEventActor DeserializeContainerRegistryEventActor(JsonElement element) @@ -25,5 +28,18 @@ internal static ContainerRegistryEventActor DeserializeContainerRegistryEventAct } return new ContainerRegistryEventActor(name.Value); } + + internal partial class ContainerRegistryEventActorConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ContainerRegistryEventActor model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override ContainerRegistryEventActor Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryEventActor(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryEventData.Serialization.cs index 312cfa7b2ef8f..9f8c32edbc047 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryEventData.Serialization.cs @@ -7,10 +7,12 @@ using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(ContainerRegistryEventDataConverter))] public partial class ContainerRegistryEventData { internal static ContainerRegistryEventData DeserializeContainerRegistryEventData(JsonElement element) @@ -87,5 +89,18 @@ internal static ContainerRegistryEventData DeserializeContainerRegistryEventData } return new ContainerRegistryEventData(id.Value, Optional.ToNullable(timestamp), action.Value, target.Value, request.Value, actor.Value, source.Value); } + + internal partial class ContainerRegistryEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ContainerRegistryEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override ContainerRegistryEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryEventRequest.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryEventRequest.Serialization.cs index 5e57843c28518..a5afa183cfe4f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryEventRequest.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryEventRequest.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(ContainerRegistryEventRequestConverter))] public partial class ContainerRegistryEventRequest { internal static ContainerRegistryEventRequest DeserializeContainerRegistryEventRequest(JsonElement element) @@ -49,5 +52,18 @@ internal static ContainerRegistryEventRequest DeserializeContainerRegistryEventR } return new ContainerRegistryEventRequest(id.Value, addr.Value, host.Value, method.Value, useragent.Value); } + + internal partial class ContainerRegistryEventRequestConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ContainerRegistryEventRequest model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override ContainerRegistryEventRequest Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryEventRequest(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryEventSource.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryEventSource.Serialization.cs index 60423fcad4ea1..1a5e3f680f257 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryEventSource.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryEventSource.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(ContainerRegistryEventSourceConverter))] public partial class ContainerRegistryEventSource { internal static ContainerRegistryEventSource DeserializeContainerRegistryEventSource(JsonElement element) @@ -31,5 +34,18 @@ internal static ContainerRegistryEventSource DeserializeContainerRegistryEventSo } return new ContainerRegistryEventSource(addr.Value, instanceID.Value); } + + internal partial class ContainerRegistryEventSourceConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ContainerRegistryEventSource model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override ContainerRegistryEventSource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryEventSource(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryEventTarget.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryEventTarget.Serialization.cs index 55d85eb44ced8..ba79817c3ad47 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryEventTarget.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryEventTarget.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(ContainerRegistryEventTargetConverter))] public partial class ContainerRegistryEventTarget { internal static ContainerRegistryEventTarget DeserializeContainerRegistryEventTarget(JsonElement element) @@ -71,5 +74,18 @@ internal static ContainerRegistryEventTarget DeserializeContainerRegistryEventTa } return new ContainerRegistryEventTarget(mediaType.Value, Optional.ToNullable(size), digest.Value, Optional.ToNullable(length), repository.Value, url.Value, tag.Value); } + + internal partial class ContainerRegistryEventTargetConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ContainerRegistryEventTarget model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override ContainerRegistryEventTarget Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryEventTarget(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryImageDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryImageDeletedEventData.Serialization.cs index 509ec21350578..15df7b952a918 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryImageDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryImageDeletedEventData.Serialization.cs @@ -7,10 +7,12 @@ using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(ContainerRegistryImageDeletedEventDataConverter))] public partial class ContainerRegistryImageDeletedEventData { internal static ContainerRegistryImageDeletedEventData DeserializeContainerRegistryImageDeletedEventData(JsonElement element) @@ -87,5 +89,18 @@ internal static ContainerRegistryImageDeletedEventData DeserializeContainerRegis } return new ContainerRegistryImageDeletedEventData(id.Value, Optional.ToNullable(timestamp), action.Value, target.Value, request.Value, actor.Value, source.Value); } + + internal partial class ContainerRegistryImageDeletedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ContainerRegistryImageDeletedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override ContainerRegistryImageDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryImageDeletedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryImagePushedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryImagePushedEventData.Serialization.cs index e40443a5045a2..b72180ebe878b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryImagePushedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ContainerRegistryImagePushedEventData.Serialization.cs @@ -7,10 +7,12 @@ using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(ContainerRegistryImagePushedEventDataConverter))] public partial class ContainerRegistryImagePushedEventData { internal static ContainerRegistryImagePushedEventData DeserializeContainerRegistryImagePushedEventData(JsonElement element) @@ -87,5 +89,18 @@ internal static ContainerRegistryImagePushedEventData DeserializeContainerRegist } return new ContainerRegistryImagePushedEventData(id.Value, Optional.ToNullable(timestamp), action.Value, target.Value, request.Value, actor.Value, source.Value); } + + internal partial class ContainerRegistryImagePushedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ContainerRegistryImagePushedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override ContainerRegistryImagePushedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryImagePushedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceConnectionStateEventInfo.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceConnectionStateEventInfo.Serialization.cs index c76aeaf44642a..c4433580eb0b0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceConnectionStateEventInfo.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceConnectionStateEventInfo.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(DeviceConnectionStateEventInfoConverter))] public partial class DeviceConnectionStateEventInfo { internal static DeviceConnectionStateEventInfo DeserializeDeviceConnectionStateEventInfo(JsonElement element) @@ -25,5 +28,18 @@ internal static DeviceConnectionStateEventInfo DeserializeDeviceConnectionStateE } return new DeviceConnectionStateEventInfo(sequenceNumber.Value); } + + internal partial class DeviceConnectionStateEventInfoConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, DeviceConnectionStateEventInfo model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override DeviceConnectionStateEventInfo Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceConnectionStateEventInfo(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceConnectionStateEventProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceConnectionStateEventProperties.Serialization.cs index 8bc610b4aef33..cdc56fb28cc04 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceConnectionStateEventProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceConnectionStateEventProperties.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(DeviceConnectionStateEventPropertiesConverter))] public partial class DeviceConnectionStateEventProperties { internal static DeviceConnectionStateEventProperties DeserializeDeviceConnectionStateEventProperties(JsonElement element) @@ -48,5 +51,18 @@ internal static DeviceConnectionStateEventProperties DeserializeDeviceConnection } return new DeviceConnectionStateEventProperties(deviceId.Value, moduleId.Value, hubName.Value, deviceConnectionStateEventInfo.Value); } + + internal partial class DeviceConnectionStateEventPropertiesConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, DeviceConnectionStateEventProperties model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override DeviceConnectionStateEventProperties Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceConnectionStateEventProperties(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceLifeCycleEventProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceLifeCycleEventProperties.Serialization.cs index 26cdf14586c54..2896f5cb0ec9c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceLifeCycleEventProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceLifeCycleEventProperties.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(DeviceLifeCycleEventPropertiesConverter))] public partial class DeviceLifeCycleEventProperties { internal static DeviceLifeCycleEventProperties DeserializeDeviceLifeCycleEventProperties(JsonElement element) @@ -42,5 +45,18 @@ internal static DeviceLifeCycleEventProperties DeserializeDeviceLifeCycleEventPr } return new DeviceLifeCycleEventProperties(deviceId.Value, hubName.Value, twin.Value); } + + internal partial class DeviceLifeCycleEventPropertiesConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, DeviceLifeCycleEventProperties model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override DeviceLifeCycleEventProperties Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceLifeCycleEventProperties(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceTelemetryEventProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceTelemetryEventProperties.Serialization.cs index 640a09a9c0902..23ed4f89dcea6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceTelemetryEventProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceTelemetryEventProperties.Serialization.cs @@ -5,12 +5,15 @@ #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(DeviceTelemetryEventPropertiesConverter))] public partial class DeviceTelemetryEventProperties { internal static DeviceTelemetryEventProperties DeserializeDeviceTelemetryEventProperties(JsonElement element) @@ -63,5 +66,18 @@ internal static DeviceTelemetryEventProperties DeserializeDeviceTelemetryEventPr } return new DeviceTelemetryEventProperties(body.Value, Optional.ToDictionary(properties), Optional.ToDictionary(systemProperties)); } + + internal partial class DeviceTelemetryEventPropertiesConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, DeviceTelemetryEventProperties model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override DeviceTelemetryEventProperties Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceTelemetryEventProperties(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceTwinInfo.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceTwinInfo.Serialization.cs index 4aa4ea283981e..cc6d724c1e785 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceTwinInfo.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceTwinInfo.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(DeviceTwinInfoConverter))] public partial class DeviceTwinInfo { internal static DeviceTwinInfo DeserializeDeviceTwinInfo(JsonElement element) @@ -105,5 +108,18 @@ internal static DeviceTwinInfo DeserializeDeviceTwinInfo(JsonElement element) } return new DeviceTwinInfo(authenticationType.Value, Optional.ToNullable(cloudToDeviceMessageCount), connectionState.Value, deviceId.Value, etag.Value, lastActivityTime.Value, properties.Value, status.Value, statusUpdateTime.Value, Optional.ToNullable(version), x509Thumbprint.Value); } + + internal partial class DeviceTwinInfoConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, DeviceTwinInfo model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override DeviceTwinInfo Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceTwinInfo(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceTwinInfoProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceTwinInfoProperties.Serialization.cs index 51b077fbb18c6..41376965deb5e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceTwinInfoProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceTwinInfoProperties.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(DeviceTwinInfoPropertiesConverter))] public partial class DeviceTwinInfoProperties { internal static DeviceTwinInfoProperties DeserializeDeviceTwinInfoProperties(JsonElement element) @@ -41,5 +44,18 @@ internal static DeviceTwinInfoProperties DeserializeDeviceTwinInfoProperties(Jso } return new DeviceTwinInfoProperties(desired.Value, reported.Value); } + + internal partial class DeviceTwinInfoPropertiesConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, DeviceTwinInfoProperties model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override DeviceTwinInfoProperties Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceTwinInfoProperties(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceTwinInfoX509Thumbprint.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceTwinInfoX509Thumbprint.Serialization.cs index 079e86f4fcf47..dc5f4025eed20 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceTwinInfoX509Thumbprint.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceTwinInfoX509Thumbprint.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(DeviceTwinInfoX509ThumbprintConverter))] public partial class DeviceTwinInfoX509Thumbprint { internal static DeviceTwinInfoX509Thumbprint DeserializeDeviceTwinInfoX509Thumbprint(JsonElement element) @@ -31,5 +34,18 @@ internal static DeviceTwinInfoX509Thumbprint DeserializeDeviceTwinInfoX509Thumbp } return new DeviceTwinInfoX509Thumbprint(primaryThumbprint.Value, secondaryThumbprint.Value); } + + internal partial class DeviceTwinInfoX509ThumbprintConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, DeviceTwinInfoX509Thumbprint model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override DeviceTwinInfoX509Thumbprint Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceTwinInfoX509Thumbprint(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceTwinMetadata.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceTwinMetadata.Serialization.cs index f13abd827e663..1b654f766a627 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceTwinMetadata.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceTwinMetadata.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(DeviceTwinMetadataConverter))] public partial class DeviceTwinMetadata { internal static DeviceTwinMetadata DeserializeDeviceTwinMetadata(JsonElement element) @@ -25,5 +28,18 @@ internal static DeviceTwinMetadata DeserializeDeviceTwinMetadata(JsonElement ele } return new DeviceTwinMetadata(lastUpdated.Value); } + + internal partial class DeviceTwinMetadataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, DeviceTwinMetadata model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override DeviceTwinMetadata Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceTwinMetadata(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceTwinProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceTwinProperties.Serialization.cs index 403a0e32f0dce..81658c53c726d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceTwinProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/DeviceTwinProperties.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(DeviceTwinPropertiesConverter))] public partial class DeviceTwinProperties { internal static DeviceTwinProperties DeserializeDeviceTwinProperties(JsonElement element) @@ -41,5 +44,18 @@ internal static DeviceTwinProperties DeserializeDeviceTwinProperties(JsonElement } return new DeviceTwinProperties(metadata.Value, Optional.ToNullable(version)); } + + internal partial class DeviceTwinPropertiesConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, DeviceTwinProperties model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override DeviceTwinProperties Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeDeviceTwinProperties(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridEventInternal.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridEventInternal.Serialization.cs index f73d8578c802c..359bc5f948c70 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridEventInternal.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridEventInternal.Serialization.cs @@ -7,10 +7,12 @@ using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.Models { + [JsonConverter(typeof(EventGridEventInternalConverter))] internal partial class EventGridEventInternal : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) @@ -91,5 +93,18 @@ internal static EventGridEventInternal DeserializeEventGridEventInternal(JsonEle } return new EventGridEventInternal(id, topic.Value, subject, data, eventType, eventTime, metadataVersion.Value, dataVersion); } + + internal partial class EventGridEventInternalConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, EventGridEventInternal model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override EventGridEventInternal Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeEventGridEventInternal(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventHubCaptureFileCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventHubCaptureFileCreatedEventData.Serialization.cs index 17ab624ecbc17..9185cf6b37d29 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventHubCaptureFileCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventHubCaptureFileCreatedEventData.Serialization.cs @@ -7,10 +7,12 @@ using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(EventHubCaptureFileCreatedEventDataConverter))] public partial class EventHubCaptureFileCreatedEventData { internal static EventHubCaptureFileCreatedEventData DeserializeEventHubCaptureFileCreatedEventData(JsonElement element) @@ -104,5 +106,18 @@ internal static EventHubCaptureFileCreatedEventData DeserializeEventHubCaptureFi } return new EventHubCaptureFileCreatedEventData(fileurl.Value, fileType.Value, partitionId.Value, Optional.ToNullable(sizeInBytes), Optional.ToNullable(eventCount), Optional.ToNullable(firstSequenceNumber), Optional.ToNullable(lastSequenceNumber), Optional.ToNullable(firstEnqueueTime), Optional.ToNullable(lastEnqueueTime)); } + + internal partial class EventHubCaptureFileCreatedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, EventHubCaptureFileCreatedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override EventHubCaptureFileCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeEventHubCaptureFileCreatedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/IotHubDeviceConnectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/IotHubDeviceConnectedEventData.Serialization.cs index 475032ccc9217..2689fe8df5700 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/IotHubDeviceConnectedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/IotHubDeviceConnectedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(IotHubDeviceConnectedEventDataConverter))] public partial class IotHubDeviceConnectedEventData { internal static IotHubDeviceConnectedEventData DeserializeIotHubDeviceConnectedEventData(JsonElement element) @@ -48,5 +51,18 @@ internal static IotHubDeviceConnectedEventData DeserializeIotHubDeviceConnectedE } return new IotHubDeviceConnectedEventData(deviceId.Value, moduleId.Value, hubName.Value, deviceConnectionStateEventInfo.Value); } + + internal partial class IotHubDeviceConnectedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, IotHubDeviceConnectedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override IotHubDeviceConnectedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeIotHubDeviceConnectedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/IotHubDeviceCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/IotHubDeviceCreatedEventData.Serialization.cs index 1d0f648ea6478..f0831564bdc64 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/IotHubDeviceCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/IotHubDeviceCreatedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(IotHubDeviceCreatedEventDataConverter))] public partial class IotHubDeviceCreatedEventData { internal static IotHubDeviceCreatedEventData DeserializeIotHubDeviceCreatedEventData(JsonElement element) @@ -42,5 +45,18 @@ internal static IotHubDeviceCreatedEventData DeserializeIotHubDeviceCreatedEvent } return new IotHubDeviceCreatedEventData(deviceId.Value, hubName.Value, twin.Value); } + + internal partial class IotHubDeviceCreatedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, IotHubDeviceCreatedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override IotHubDeviceCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeIotHubDeviceCreatedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/IotHubDeviceDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/IotHubDeviceDeletedEventData.Serialization.cs index 3f57ddc5e89bc..801c980fea6a1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/IotHubDeviceDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/IotHubDeviceDeletedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(IotHubDeviceDeletedEventDataConverter))] public partial class IotHubDeviceDeletedEventData { internal static IotHubDeviceDeletedEventData DeserializeIotHubDeviceDeletedEventData(JsonElement element) @@ -42,5 +45,18 @@ internal static IotHubDeviceDeletedEventData DeserializeIotHubDeviceDeletedEvent } return new IotHubDeviceDeletedEventData(deviceId.Value, hubName.Value, twin.Value); } + + internal partial class IotHubDeviceDeletedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, IotHubDeviceDeletedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override IotHubDeviceDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeIotHubDeviceDeletedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/IotHubDeviceDisconnectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/IotHubDeviceDisconnectedEventData.Serialization.cs index acd98720e3fbb..813ca3c676d42 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/IotHubDeviceDisconnectedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/IotHubDeviceDisconnectedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(IotHubDeviceDisconnectedEventDataConverter))] public partial class IotHubDeviceDisconnectedEventData { internal static IotHubDeviceDisconnectedEventData DeserializeIotHubDeviceDisconnectedEventData(JsonElement element) @@ -48,5 +51,18 @@ internal static IotHubDeviceDisconnectedEventData DeserializeIotHubDeviceDisconn } return new IotHubDeviceDisconnectedEventData(deviceId.Value, moduleId.Value, hubName.Value, deviceConnectionStateEventInfo.Value); } + + internal partial class IotHubDeviceDisconnectedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, IotHubDeviceDisconnectedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override IotHubDeviceDisconnectedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeIotHubDeviceDisconnectedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/IotHubDeviceTelemetryEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/IotHubDeviceTelemetryEventData.Serialization.cs index 6da315e6c3170..e2fe35f652584 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/IotHubDeviceTelemetryEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/IotHubDeviceTelemetryEventData.Serialization.cs @@ -5,12 +5,15 @@ #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(IotHubDeviceTelemetryEventDataConverter))] public partial class IotHubDeviceTelemetryEventData { internal static IotHubDeviceTelemetryEventData DeserializeIotHubDeviceTelemetryEventData(JsonElement element) @@ -63,5 +66,18 @@ internal static IotHubDeviceTelemetryEventData DeserializeIotHubDeviceTelemetryE } return new IotHubDeviceTelemetryEventData(body.Value, Optional.ToDictionary(properties), Optional.ToDictionary(systemProperties)); } + + internal partial class IotHubDeviceTelemetryEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, IotHubDeviceTelemetryEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override IotHubDeviceTelemetryEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeIotHubDeviceTelemetryEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultAccessPolicyChangedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultAccessPolicyChangedEventData.Serialization.cs index bf0970fae5496..21c9c815c8814 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultAccessPolicyChangedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultAccessPolicyChangedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(KeyVaultAccessPolicyChangedEventDataConverter))] public partial class KeyVaultAccessPolicyChangedEventData { internal static KeyVaultAccessPolicyChangedEventData DeserializeKeyVaultAccessPolicyChangedEventData(JsonElement element) @@ -71,5 +74,18 @@ internal static KeyVaultAccessPolicyChangedEventData DeserializeKeyVaultAccessPo } return new KeyVaultAccessPolicyChangedEventData(id.Value, vaultName.Value, objectType.Value, objectName.Value, version.Value, Optional.ToNullable(nbf), Optional.ToNullable(exp)); } + + internal partial class KeyVaultAccessPolicyChangedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, KeyVaultAccessPolicyChangedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override KeyVaultAccessPolicyChangedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyVaultAccessPolicyChangedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultCertificateExpiredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultCertificateExpiredEventData.Serialization.cs index 5d2aed1f1f95a..c0f9c8e97be69 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultCertificateExpiredEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultCertificateExpiredEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(KeyVaultCertificateExpiredEventDataConverter))] public partial class KeyVaultCertificateExpiredEventData { internal static KeyVaultCertificateExpiredEventData DeserializeKeyVaultCertificateExpiredEventData(JsonElement element) @@ -71,5 +74,18 @@ internal static KeyVaultCertificateExpiredEventData DeserializeKeyVaultCertifica } return new KeyVaultCertificateExpiredEventData(id.Value, vaultName.Value, objectType.Value, objectName.Value, version.Value, Optional.ToNullable(nbf), Optional.ToNullable(exp)); } + + internal partial class KeyVaultCertificateExpiredEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, KeyVaultCertificateExpiredEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override KeyVaultCertificateExpiredEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyVaultCertificateExpiredEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultCertificateNearExpiryEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultCertificateNearExpiryEventData.Serialization.cs index ab8fb90047425..ee9c747cf24dc 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultCertificateNearExpiryEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultCertificateNearExpiryEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(KeyVaultCertificateNearExpiryEventDataConverter))] public partial class KeyVaultCertificateNearExpiryEventData { internal static KeyVaultCertificateNearExpiryEventData DeserializeKeyVaultCertificateNearExpiryEventData(JsonElement element) @@ -71,5 +74,18 @@ internal static KeyVaultCertificateNearExpiryEventData DeserializeKeyVaultCertif } return new KeyVaultCertificateNearExpiryEventData(id.Value, vaultName.Value, objectType.Value, objectName.Value, version.Value, Optional.ToNullable(nbf), Optional.ToNullable(exp)); } + + internal partial class KeyVaultCertificateNearExpiryEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, KeyVaultCertificateNearExpiryEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override KeyVaultCertificateNearExpiryEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyVaultCertificateNearExpiryEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultCertificateNewVersionCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultCertificateNewVersionCreatedEventData.Serialization.cs index 90c03fb2a423a..a939a4a59b581 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultCertificateNewVersionCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultCertificateNewVersionCreatedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(KeyVaultCertificateNewVersionCreatedEventDataConverter))] public partial class KeyVaultCertificateNewVersionCreatedEventData { internal static KeyVaultCertificateNewVersionCreatedEventData DeserializeKeyVaultCertificateNewVersionCreatedEventData(JsonElement element) @@ -71,5 +74,18 @@ internal static KeyVaultCertificateNewVersionCreatedEventData DeserializeKeyVaul } return new KeyVaultCertificateNewVersionCreatedEventData(id.Value, vaultName.Value, objectType.Value, objectName.Value, version.Value, Optional.ToNullable(nbf), Optional.ToNullable(exp)); } + + internal partial class KeyVaultCertificateNewVersionCreatedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, KeyVaultCertificateNewVersionCreatedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override KeyVaultCertificateNewVersionCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyVaultCertificateNewVersionCreatedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultKeyExpiredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultKeyExpiredEventData.Serialization.cs index 36d0b6a15251a..1ab5c59ca2388 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultKeyExpiredEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultKeyExpiredEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(KeyVaultKeyExpiredEventDataConverter))] public partial class KeyVaultKeyExpiredEventData { internal static KeyVaultKeyExpiredEventData DeserializeKeyVaultKeyExpiredEventData(JsonElement element) @@ -71,5 +74,18 @@ internal static KeyVaultKeyExpiredEventData DeserializeKeyVaultKeyExpiredEventDa } return new KeyVaultKeyExpiredEventData(id.Value, vaultName.Value, objectType.Value, objectName.Value, version.Value, Optional.ToNullable(nbf), Optional.ToNullable(exp)); } + + internal partial class KeyVaultKeyExpiredEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, KeyVaultKeyExpiredEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override KeyVaultKeyExpiredEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyVaultKeyExpiredEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultKeyNearExpiryEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultKeyNearExpiryEventData.Serialization.cs index a0e604203d5e1..ee87e46cdac54 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultKeyNearExpiryEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultKeyNearExpiryEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(KeyVaultKeyNearExpiryEventDataConverter))] public partial class KeyVaultKeyNearExpiryEventData { internal static KeyVaultKeyNearExpiryEventData DeserializeKeyVaultKeyNearExpiryEventData(JsonElement element) @@ -71,5 +74,18 @@ internal static KeyVaultKeyNearExpiryEventData DeserializeKeyVaultKeyNearExpiryE } return new KeyVaultKeyNearExpiryEventData(id.Value, vaultName.Value, objectType.Value, objectName.Value, version.Value, Optional.ToNullable(nbf), Optional.ToNullable(exp)); } + + internal partial class KeyVaultKeyNearExpiryEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, KeyVaultKeyNearExpiryEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override KeyVaultKeyNearExpiryEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyVaultKeyNearExpiryEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultKeyNewVersionCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultKeyNewVersionCreatedEventData.Serialization.cs index 20a2802e74bbc..c3b8882e4913c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultKeyNewVersionCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultKeyNewVersionCreatedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(KeyVaultKeyNewVersionCreatedEventDataConverter))] public partial class KeyVaultKeyNewVersionCreatedEventData { internal static KeyVaultKeyNewVersionCreatedEventData DeserializeKeyVaultKeyNewVersionCreatedEventData(JsonElement element) @@ -71,5 +74,18 @@ internal static KeyVaultKeyNewVersionCreatedEventData DeserializeKeyVaultKeyNewV } return new KeyVaultKeyNewVersionCreatedEventData(id.Value, vaultName.Value, objectType.Value, objectName.Value, version.Value, Optional.ToNullable(nbf), Optional.ToNullable(exp)); } + + internal partial class KeyVaultKeyNewVersionCreatedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, KeyVaultKeyNewVersionCreatedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override KeyVaultKeyNewVersionCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyVaultKeyNewVersionCreatedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultSecretExpiredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultSecretExpiredEventData.Serialization.cs index 1723f331c5aba..a3f4304ab10af 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultSecretExpiredEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultSecretExpiredEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(KeyVaultSecretExpiredEventDataConverter))] public partial class KeyVaultSecretExpiredEventData { internal static KeyVaultSecretExpiredEventData DeserializeKeyVaultSecretExpiredEventData(JsonElement element) @@ -71,5 +74,18 @@ internal static KeyVaultSecretExpiredEventData DeserializeKeyVaultSecretExpiredE } return new KeyVaultSecretExpiredEventData(id.Value, vaultName.Value, objectType.Value, objectName.Value, version.Value, Optional.ToNullable(nbf), Optional.ToNullable(exp)); } + + internal partial class KeyVaultSecretExpiredEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, KeyVaultSecretExpiredEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override KeyVaultSecretExpiredEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyVaultSecretExpiredEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultSecretNearExpiryEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultSecretNearExpiryEventData.Serialization.cs index 3d24e2d9beb86..ade90ed64c3e1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultSecretNearExpiryEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultSecretNearExpiryEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(KeyVaultSecretNearExpiryEventDataConverter))] public partial class KeyVaultSecretNearExpiryEventData { internal static KeyVaultSecretNearExpiryEventData DeserializeKeyVaultSecretNearExpiryEventData(JsonElement element) @@ -71,5 +74,18 @@ internal static KeyVaultSecretNearExpiryEventData DeserializeKeyVaultSecretNearE } return new KeyVaultSecretNearExpiryEventData(id.Value, vaultName.Value, objectType.Value, objectName.Value, version.Value, Optional.ToNullable(nbf), Optional.ToNullable(exp)); } + + internal partial class KeyVaultSecretNearExpiryEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, KeyVaultSecretNearExpiryEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override KeyVaultSecretNearExpiryEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyVaultSecretNearExpiryEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultSecretNewVersionCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultSecretNewVersionCreatedEventData.Serialization.cs index f57f2361848d4..123677daf2107 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultSecretNewVersionCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/KeyVaultSecretNewVersionCreatedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(KeyVaultSecretNewVersionCreatedEventDataConverter))] public partial class KeyVaultSecretNewVersionCreatedEventData { internal static KeyVaultSecretNewVersionCreatedEventData DeserializeKeyVaultSecretNewVersionCreatedEventData(JsonElement element) @@ -71,5 +74,18 @@ internal static KeyVaultSecretNewVersionCreatedEventData DeserializeKeyVaultSecr } return new KeyVaultSecretNewVersionCreatedEventData(id.Value, vaultName.Value, objectType.Value, objectName.Value, version.Value, Optional.ToNullable(nbf), Optional.ToNullable(exp)); } + + internal partial class KeyVaultSecretNewVersionCreatedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, KeyVaultSecretNewVersionCreatedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override KeyVaultSecretNewVersionCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyVaultSecretNewVersionCreatedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MachineLearningServicesDatasetDriftDetectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MachineLearningServicesDatasetDriftDetectedEventData.Serialization.cs index abdf21e9349e5..8925b74e03abd 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MachineLearningServicesDatasetDriftDetectedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MachineLearningServicesDatasetDriftDetectedEventData.Serialization.cs @@ -7,10 +7,12 @@ using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(MachineLearningServicesDatasetDriftDetectedEventDataConverter))] public partial class MachineLearningServicesDatasetDriftDetectedEventData { internal static MachineLearningServicesDatasetDriftDetectedEventData DeserializeMachineLearningServicesDatasetDriftDetectedEventData(JsonElement element) @@ -83,5 +85,18 @@ internal static MachineLearningServicesDatasetDriftDetectedEventData Deserialize } return new MachineLearningServicesDatasetDriftDetectedEventData(dataDriftId.Value, dataDriftName.Value, runId.Value, baseDatasetId.Value, targetDatasetId.Value, Optional.ToNullable(driftCoefficient), Optional.ToNullable(startTime), Optional.ToNullable(endTime)); } + + internal partial class MachineLearningServicesDatasetDriftDetectedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MachineLearningServicesDatasetDriftDetectedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MachineLearningServicesDatasetDriftDetectedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMachineLearningServicesDatasetDriftDetectedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MachineLearningServicesModelDeployedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MachineLearningServicesModelDeployedEventData.Serialization.cs index 49e7000b414a9..3feb5adb92409 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MachineLearningServicesModelDeployedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MachineLearningServicesModelDeployedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(MachineLearningServicesModelDeployedEventDataConverter))] public partial class MachineLearningServicesModelDeployedEventData { internal static MachineLearningServicesModelDeployedEventData DeserializeMachineLearningServicesModelDeployedEventData(JsonElement element) @@ -59,5 +62,18 @@ internal static MachineLearningServicesModelDeployedEventData DeserializeMachine } return new MachineLearningServicesModelDeployedEventData(serviceName.Value, serviceComputeType.Value, modelIds.Value, serviceTags.Value, serviceProperties.Value); } + + internal partial class MachineLearningServicesModelDeployedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MachineLearningServicesModelDeployedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MachineLearningServicesModelDeployedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMachineLearningServicesModelDeployedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MachineLearningServicesModelRegisteredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MachineLearningServicesModelRegisteredEventData.Serialization.cs index eb0250d53dbf4..daa255c1b5b45 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MachineLearningServicesModelRegisteredEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MachineLearningServicesModelRegisteredEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(MachineLearningServicesModelRegisteredEventDataConverter))] public partial class MachineLearningServicesModelRegisteredEventData { internal static MachineLearningServicesModelRegisteredEventData DeserializeMachineLearningServicesModelRegisteredEventData(JsonElement element) @@ -53,5 +56,18 @@ internal static MachineLearningServicesModelRegisteredEventData DeserializeMachi } return new MachineLearningServicesModelRegisteredEventData(modelName.Value, modelVersion.Value, modelTags.Value, modelProperties.Value); } + + internal partial class MachineLearningServicesModelRegisteredEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MachineLearningServicesModelRegisteredEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MachineLearningServicesModelRegisteredEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMachineLearningServicesModelRegisteredEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MachineLearningServicesRunCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MachineLearningServicesRunCompletedEventData.Serialization.cs index 7f4da5acac986..733b780206ffa 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MachineLearningServicesRunCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MachineLearningServicesRunCompletedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(MachineLearningServicesRunCompletedEventDataConverter))] public partial class MachineLearningServicesRunCompletedEventData { internal static MachineLearningServicesRunCompletedEventData DeserializeMachineLearningServicesRunCompletedEventData(JsonElement element) @@ -65,5 +68,18 @@ internal static MachineLearningServicesRunCompletedEventData DeserializeMachineL } return new MachineLearningServicesRunCompletedEventData(experimentId.Value, experimentName.Value, runId.Value, runType.Value, runTags.Value, runProperties.Value); } + + internal partial class MachineLearningServicesRunCompletedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MachineLearningServicesRunCompletedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MachineLearningServicesRunCompletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMachineLearningServicesRunCompletedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MachineLearningServicesRunStatusChangedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MachineLearningServicesRunStatusChangedEventData.Serialization.cs index 1341754fe49de..4b5d9233af690 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MachineLearningServicesRunStatusChangedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MachineLearningServicesRunStatusChangedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(MachineLearningServicesRunStatusChangedEventDataConverter))] public partial class MachineLearningServicesRunStatusChangedEventData { internal static MachineLearningServicesRunStatusChangedEventData DeserializeMachineLearningServicesRunStatusChangedEventData(JsonElement element) @@ -71,5 +74,18 @@ internal static MachineLearningServicesRunStatusChangedEventData DeserializeMach } return new MachineLearningServicesRunStatusChangedEventData(experimentId.Value, experimentName.Value, runId.Value, runType.Value, runTags.Value, runProperties.Value, runStatus.Value); } + + internal partial class MachineLearningServicesRunStatusChangedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MachineLearningServicesRunStatusChangedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MachineLearningServicesRunStatusChangedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMachineLearningServicesRunStatusChangedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MapsGeofenceEnteredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MapsGeofenceEnteredEventData.Serialization.cs index 62983783c2b6e..f9a2168857c07 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MapsGeofenceEnteredEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MapsGeofenceEnteredEventData.Serialization.cs @@ -5,12 +5,15 @@ #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(MapsGeofenceEnteredEventDataConverter))] public partial class MapsGeofenceEnteredEventData { internal static MapsGeofenceEnteredEventData DeserializeMapsGeofenceEnteredEventData(JsonElement element) @@ -79,5 +82,18 @@ internal static MapsGeofenceEnteredEventData DeserializeMapsGeofenceEnteredEvent } return new MapsGeofenceEnteredEventData(Optional.ToList(expiredGeofenceGeometryId), Optional.ToList(geometries), Optional.ToList(invalidPeriodGeofenceGeometryId), Optional.ToNullable(isEventPublished)); } + + internal partial class MapsGeofenceEnteredEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MapsGeofenceEnteredEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MapsGeofenceEnteredEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMapsGeofenceEnteredEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MapsGeofenceEventProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MapsGeofenceEventProperties.Serialization.cs index 25644bb50dd5c..517555f705845 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MapsGeofenceEventProperties.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MapsGeofenceEventProperties.Serialization.cs @@ -5,12 +5,15 @@ #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(MapsGeofenceEventPropertiesConverter))] public partial class MapsGeofenceEventProperties { internal static MapsGeofenceEventProperties DeserializeMapsGeofenceEventProperties(JsonElement element) @@ -79,5 +82,18 @@ internal static MapsGeofenceEventProperties DeserializeMapsGeofenceEventProperti } return new MapsGeofenceEventProperties(Optional.ToList(expiredGeofenceGeometryId), Optional.ToList(geometries), Optional.ToList(invalidPeriodGeofenceGeometryId), Optional.ToNullable(isEventPublished)); } + + internal partial class MapsGeofenceEventPropertiesConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MapsGeofenceEventProperties model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MapsGeofenceEventProperties Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMapsGeofenceEventProperties(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MapsGeofenceExitedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MapsGeofenceExitedEventData.Serialization.cs index 7aa4e76492632..8c8a42a44b768 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MapsGeofenceExitedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MapsGeofenceExitedEventData.Serialization.cs @@ -5,12 +5,15 @@ #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(MapsGeofenceExitedEventDataConverter))] public partial class MapsGeofenceExitedEventData { internal static MapsGeofenceExitedEventData DeserializeMapsGeofenceExitedEventData(JsonElement element) @@ -79,5 +82,18 @@ internal static MapsGeofenceExitedEventData DeserializeMapsGeofenceExitedEventDa } return new MapsGeofenceExitedEventData(Optional.ToList(expiredGeofenceGeometryId), Optional.ToList(geometries), Optional.ToList(invalidPeriodGeofenceGeometryId), Optional.ToNullable(isEventPublished)); } + + internal partial class MapsGeofenceExitedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MapsGeofenceExitedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MapsGeofenceExitedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMapsGeofenceExitedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MapsGeofenceGeometry.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MapsGeofenceGeometry.Serialization.cs index f3de9bee202e6..03874a455f129 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MapsGeofenceGeometry.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MapsGeofenceGeometry.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(MapsGeofenceGeometryConverter))] public partial class MapsGeofenceGeometry { internal static MapsGeofenceGeometry DeserializeMapsGeofenceGeometry(JsonElement element) @@ -70,5 +73,18 @@ internal static MapsGeofenceGeometry DeserializeMapsGeofenceGeometry(JsonElement } return new MapsGeofenceGeometry(deviceId.Value, Optional.ToNullable(distance), geometryId.Value, Optional.ToNullable(nearestLat), Optional.ToNullable(nearestLon), udId.Value); } + + internal partial class MapsGeofenceGeometryConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MapsGeofenceGeometry model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MapsGeofenceGeometry Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMapsGeofenceGeometry(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MapsGeofenceResultEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MapsGeofenceResultEventData.Serialization.cs index 5a7234dff386e..76aac41831b64 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MapsGeofenceResultEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MapsGeofenceResultEventData.Serialization.cs @@ -5,12 +5,15 @@ #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(MapsGeofenceResultEventDataConverter))] public partial class MapsGeofenceResultEventData { internal static MapsGeofenceResultEventData DeserializeMapsGeofenceResultEventData(JsonElement element) @@ -79,5 +82,18 @@ internal static MapsGeofenceResultEventData DeserializeMapsGeofenceResultEventDa } return new MapsGeofenceResultEventData(Optional.ToList(expiredGeofenceGeometryId), Optional.ToList(geometries), Optional.ToList(invalidPeriodGeofenceGeometryId), Optional.ToNullable(isEventPublished)); } + + internal partial class MapsGeofenceResultEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MapsGeofenceResultEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MapsGeofenceResultEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMapsGeofenceResultEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobCanceledEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobCanceledEventData.Serialization.cs index 9722f63cc5421..6f4454f4240a9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobCanceledEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobCanceledEventData.Serialization.cs @@ -5,12 +5,15 @@ #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(MediaJobCanceledEventDataConverter))] public partial class MediaJobCanceledEventData { internal static MediaJobCanceledEventData DeserializeMediaJobCanceledEventData(JsonElement element) @@ -74,5 +77,18 @@ internal static MediaJobCanceledEventData DeserializeMediaJobCanceledEventData(J } return new MediaJobCanceledEventData(Optional.ToNullable(previousState), Optional.ToNullable(state), Optional.ToDictionary(correlationData), Optional.ToList(outputs)); } + + internal partial class MediaJobCanceledEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaJobCanceledEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaJobCanceledEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaJobCanceledEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobCancelingEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobCancelingEventData.Serialization.cs index a2d5519b32b8c..66343fae0e1f5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobCancelingEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobCancelingEventData.Serialization.cs @@ -5,12 +5,15 @@ #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(MediaJobCancelingEventDataConverter))] public partial class MediaJobCancelingEventData { internal static MediaJobCancelingEventData DeserializeMediaJobCancelingEventData(JsonElement element) @@ -58,5 +61,18 @@ internal static MediaJobCancelingEventData DeserializeMediaJobCancelingEventData } return new MediaJobCancelingEventData(Optional.ToNullable(previousState), Optional.ToNullable(state), Optional.ToDictionary(correlationData)); } + + internal partial class MediaJobCancelingEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaJobCancelingEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaJobCancelingEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaJobCancelingEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobError.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobError.Serialization.cs index a095040fbb902..95e2dc2f84755 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobError.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobError.Serialization.cs @@ -5,12 +5,15 @@ #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(MediaJobErrorConverter))] public partial class MediaJobError { internal static MediaJobError DeserializeMediaJobError(JsonElement element) @@ -75,5 +78,18 @@ internal static MediaJobError DeserializeMediaJobError(JsonElement element) } return new MediaJobError(Optional.ToNullable(code), message.Value, Optional.ToNullable(category), Optional.ToNullable(retry), Optional.ToList(details)); } + + internal partial class MediaJobErrorConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaJobError model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaJobError Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaJobError(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobErrorDetail.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobErrorDetail.Serialization.cs index e5df240af5183..b20e881a0c238 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobErrorDetail.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobErrorDetail.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(MediaJobErrorDetailConverter))] public partial class MediaJobErrorDetail { internal static MediaJobErrorDetail DeserializeMediaJobErrorDetail(JsonElement element) @@ -31,5 +34,18 @@ internal static MediaJobErrorDetail DeserializeMediaJobErrorDetail(JsonElement e } return new MediaJobErrorDetail(code.Value, message.Value); } + + internal partial class MediaJobErrorDetailConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaJobErrorDetail model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaJobErrorDetail Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaJobErrorDetail(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobErroredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobErroredEventData.Serialization.cs index 9ae5be33bc426..de42143b8ebf7 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobErroredEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobErroredEventData.Serialization.cs @@ -5,12 +5,15 @@ #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(MediaJobErroredEventDataConverter))] public partial class MediaJobErroredEventData { internal static MediaJobErroredEventData DeserializeMediaJobErroredEventData(JsonElement element) @@ -74,5 +77,18 @@ internal static MediaJobErroredEventData DeserializeMediaJobErroredEventData(Jso } return new MediaJobErroredEventData(Optional.ToNullable(previousState), Optional.ToNullable(state), Optional.ToDictionary(correlationData), Optional.ToList(outputs)); } + + internal partial class MediaJobErroredEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaJobErroredEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaJobErroredEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaJobErroredEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobFinishedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobFinishedEventData.Serialization.cs index 31a778dff8eb9..db3ab3c3db685 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobFinishedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobFinishedEventData.Serialization.cs @@ -5,12 +5,15 @@ #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(MediaJobFinishedEventDataConverter))] public partial class MediaJobFinishedEventData { internal static MediaJobFinishedEventData DeserializeMediaJobFinishedEventData(JsonElement element) @@ -74,5 +77,18 @@ internal static MediaJobFinishedEventData DeserializeMediaJobFinishedEventData(J } return new MediaJobFinishedEventData(Optional.ToNullable(previousState), Optional.ToNullable(state), Optional.ToDictionary(correlationData), Optional.ToList(outputs)); } + + internal partial class MediaJobFinishedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaJobFinishedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaJobFinishedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaJobFinishedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutput.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutput.Serialization.cs index fc3777f4e1a84..e8cd998da7b7d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutput.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutput.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(MediaJobOutputConverter))] public partial class MediaJobOutput { internal static MediaJobOutput DeserializeMediaJobOutput(JsonElement element) @@ -61,5 +64,18 @@ internal static MediaJobOutput DeserializeMediaJobOutput(JsonElement element) } return new MediaJobOutput(odataType.Value, error.Value, label.Value, progress, state); } + + internal partial class MediaJobOutputConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaJobOutput model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaJobOutput Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaJobOutput(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputAsset.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputAsset.Serialization.cs index 6b534a9aa6533..3549710d65602 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputAsset.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputAsset.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(MediaJobOutputAssetConverter))] public partial class MediaJobOutputAsset { internal static MediaJobOutputAsset DeserializeMediaJobOutputAsset(JsonElement element) @@ -60,5 +63,18 @@ internal static MediaJobOutputAsset DeserializeMediaJobOutputAsset(JsonElement e } return new MediaJobOutputAsset(odataType.Value, error.Value, label.Value, progress, state, assetName.Value); } + + internal partial class MediaJobOutputAssetConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaJobOutputAsset model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaJobOutputAsset Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaJobOutputAsset(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputCanceledEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputCanceledEventData.Serialization.cs index 658c2fdf6ff8d..04a1b4aa562d9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputCanceledEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputCanceledEventData.Serialization.cs @@ -5,12 +5,15 @@ #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(MediaJobOutputCanceledEventDataConverter))] public partial class MediaJobOutputCanceledEventData { internal static MediaJobOutputCanceledEventData DeserializeMediaJobOutputCanceledEventData(JsonElement element) @@ -58,5 +61,18 @@ internal static MediaJobOutputCanceledEventData DeserializeMediaJobOutputCancele } return new MediaJobOutputCanceledEventData(Optional.ToNullable(previousState), output.Value, Optional.ToDictionary(jobCorrelationData)); } + + internal partial class MediaJobOutputCanceledEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaJobOutputCanceledEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaJobOutputCanceledEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaJobOutputCanceledEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputCancelingEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputCancelingEventData.Serialization.cs index dcf39b8be35b3..ccd330ce214e1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputCancelingEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputCancelingEventData.Serialization.cs @@ -5,12 +5,15 @@ #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(MediaJobOutputCancelingEventDataConverter))] public partial class MediaJobOutputCancelingEventData { internal static MediaJobOutputCancelingEventData DeserializeMediaJobOutputCancelingEventData(JsonElement element) @@ -58,5 +61,18 @@ internal static MediaJobOutputCancelingEventData DeserializeMediaJobOutputCancel } return new MediaJobOutputCancelingEventData(Optional.ToNullable(previousState), output.Value, Optional.ToDictionary(jobCorrelationData)); } + + internal partial class MediaJobOutputCancelingEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaJobOutputCancelingEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaJobOutputCancelingEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaJobOutputCancelingEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputErroredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputErroredEventData.Serialization.cs index ee70ed84e3db1..a49fdaeead15a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputErroredEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputErroredEventData.Serialization.cs @@ -5,12 +5,15 @@ #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(MediaJobOutputErroredEventDataConverter))] public partial class MediaJobOutputErroredEventData { internal static MediaJobOutputErroredEventData DeserializeMediaJobOutputErroredEventData(JsonElement element) @@ -58,5 +61,18 @@ internal static MediaJobOutputErroredEventData DeserializeMediaJobOutputErroredE } return new MediaJobOutputErroredEventData(Optional.ToNullable(previousState), output.Value, Optional.ToDictionary(jobCorrelationData)); } + + internal partial class MediaJobOutputErroredEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaJobOutputErroredEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaJobOutputErroredEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaJobOutputErroredEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputFinishedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputFinishedEventData.Serialization.cs index 7df9bb77eb3ea..6adf62da332c2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputFinishedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputFinishedEventData.Serialization.cs @@ -5,12 +5,15 @@ #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(MediaJobOutputFinishedEventDataConverter))] public partial class MediaJobOutputFinishedEventData { internal static MediaJobOutputFinishedEventData DeserializeMediaJobOutputFinishedEventData(JsonElement element) @@ -58,5 +61,18 @@ internal static MediaJobOutputFinishedEventData DeserializeMediaJobOutputFinishe } return new MediaJobOutputFinishedEventData(Optional.ToNullable(previousState), output.Value, Optional.ToDictionary(jobCorrelationData)); } + + internal partial class MediaJobOutputFinishedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaJobOutputFinishedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaJobOutputFinishedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaJobOutputFinishedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputProcessingEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputProcessingEventData.Serialization.cs index 76e1a2d5c8107..4ce015dcfc67a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputProcessingEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputProcessingEventData.Serialization.cs @@ -5,12 +5,15 @@ #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(MediaJobOutputProcessingEventDataConverter))] public partial class MediaJobOutputProcessingEventData { internal static MediaJobOutputProcessingEventData DeserializeMediaJobOutputProcessingEventData(JsonElement element) @@ -58,5 +61,18 @@ internal static MediaJobOutputProcessingEventData DeserializeMediaJobOutputProce } return new MediaJobOutputProcessingEventData(Optional.ToNullable(previousState), output.Value, Optional.ToDictionary(jobCorrelationData)); } + + internal partial class MediaJobOutputProcessingEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaJobOutputProcessingEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaJobOutputProcessingEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaJobOutputProcessingEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputProgressEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputProgressEventData.Serialization.cs index a519c00ada0ac..7b6ec63f93a1a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputProgressEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputProgressEventData.Serialization.cs @@ -5,12 +5,15 @@ #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(MediaJobOutputProgressEventDataConverter))] public partial class MediaJobOutputProgressEventData { internal static MediaJobOutputProgressEventData DeserializeMediaJobOutputProgressEventData(JsonElement element) @@ -53,5 +56,18 @@ internal static MediaJobOutputProgressEventData DeserializeMediaJobOutputProgres } return new MediaJobOutputProgressEventData(label.Value, Optional.ToNullable(progress), Optional.ToDictionary(jobCorrelationData)); } + + internal partial class MediaJobOutputProgressEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaJobOutputProgressEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaJobOutputProgressEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaJobOutputProgressEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputScheduledEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputScheduledEventData.Serialization.cs index e90f65d3bbf94..21a34504006c0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputScheduledEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputScheduledEventData.Serialization.cs @@ -5,12 +5,15 @@ #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(MediaJobOutputScheduledEventDataConverter))] public partial class MediaJobOutputScheduledEventData { internal static MediaJobOutputScheduledEventData DeserializeMediaJobOutputScheduledEventData(JsonElement element) @@ -58,5 +61,18 @@ internal static MediaJobOutputScheduledEventData DeserializeMediaJobOutputSchedu } return new MediaJobOutputScheduledEventData(Optional.ToNullable(previousState), output.Value, Optional.ToDictionary(jobCorrelationData)); } + + internal partial class MediaJobOutputScheduledEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaJobOutputScheduledEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaJobOutputScheduledEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaJobOutputScheduledEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputStateChangeEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputStateChangeEventData.Serialization.cs index 910e299878a14..e6a086d7be163 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputStateChangeEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobOutputStateChangeEventData.Serialization.cs @@ -5,12 +5,15 @@ #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(MediaJobOutputStateChangeEventDataConverter))] public partial class MediaJobOutputStateChangeEventData { internal static MediaJobOutputStateChangeEventData DeserializeMediaJobOutputStateChangeEventData(JsonElement element) @@ -58,5 +61,18 @@ internal static MediaJobOutputStateChangeEventData DeserializeMediaJobOutputStat } return new MediaJobOutputStateChangeEventData(Optional.ToNullable(previousState), output.Value, Optional.ToDictionary(jobCorrelationData)); } + + internal partial class MediaJobOutputStateChangeEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaJobOutputStateChangeEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaJobOutputStateChangeEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaJobOutputStateChangeEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobProcessingEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobProcessingEventData.Serialization.cs index 46cca0e6b9d0c..a66ef8b745d74 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobProcessingEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobProcessingEventData.Serialization.cs @@ -5,12 +5,15 @@ #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(MediaJobProcessingEventDataConverter))] public partial class MediaJobProcessingEventData { internal static MediaJobProcessingEventData DeserializeMediaJobProcessingEventData(JsonElement element) @@ -58,5 +61,18 @@ internal static MediaJobProcessingEventData DeserializeMediaJobProcessingEventDa } return new MediaJobProcessingEventData(Optional.ToNullable(previousState), Optional.ToNullable(state), Optional.ToDictionary(correlationData)); } + + internal partial class MediaJobProcessingEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaJobProcessingEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaJobProcessingEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaJobProcessingEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobScheduledEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobScheduledEventData.Serialization.cs index 0407bf14d16d4..3c3bd29b2adc8 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobScheduledEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobScheduledEventData.Serialization.cs @@ -5,12 +5,15 @@ #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(MediaJobScheduledEventDataConverter))] public partial class MediaJobScheduledEventData { internal static MediaJobScheduledEventData DeserializeMediaJobScheduledEventData(JsonElement element) @@ -58,5 +61,18 @@ internal static MediaJobScheduledEventData DeserializeMediaJobScheduledEventData } return new MediaJobScheduledEventData(Optional.ToNullable(previousState), Optional.ToNullable(state), Optional.ToDictionary(correlationData)); } + + internal partial class MediaJobScheduledEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaJobScheduledEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaJobScheduledEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaJobScheduledEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobStateChangeEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobStateChangeEventData.Serialization.cs index 5093fae6d53ef..1d9d57448ff9f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobStateChangeEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaJobStateChangeEventData.Serialization.cs @@ -5,12 +5,15 @@ #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(MediaJobStateChangeEventDataConverter))] public partial class MediaJobStateChangeEventData { internal static MediaJobStateChangeEventData DeserializeMediaJobStateChangeEventData(JsonElement element) @@ -58,5 +61,18 @@ internal static MediaJobStateChangeEventData DeserializeMediaJobStateChangeEvent } return new MediaJobStateChangeEventData(Optional.ToNullable(previousState), Optional.ToNullable(state), Optional.ToDictionary(correlationData)); } + + internal partial class MediaJobStateChangeEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaJobStateChangeEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaJobStateChangeEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaJobStateChangeEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventConnectionRejectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventConnectionRejectedEventData.Serialization.cs index 1536fe7be2896..0b53d574ba008 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventConnectionRejectedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventConnectionRejectedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(MediaLiveEventConnectionRejectedEventDataConverter))] public partial class MediaLiveEventConnectionRejectedEventData { internal static MediaLiveEventConnectionRejectedEventData DeserializeMediaLiveEventConnectionRejectedEventData(JsonElement element) @@ -49,5 +52,18 @@ internal static MediaLiveEventConnectionRejectedEventData DeserializeMediaLiveEv } return new MediaLiveEventConnectionRejectedEventData(ingestUrl.Value, streamId.Value, encoderIp.Value, encoderPort.Value, resultCode.Value); } + + internal partial class MediaLiveEventConnectionRejectedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaLiveEventConnectionRejectedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaLiveEventConnectionRejectedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaLiveEventConnectionRejectedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventEncoderConnectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventEncoderConnectedEventData.Serialization.cs index 1b68e5bfe5c05..de3fe579433f9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventEncoderConnectedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventEncoderConnectedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(MediaLiveEventEncoderConnectedEventDataConverter))] public partial class MediaLiveEventEncoderConnectedEventData { internal static MediaLiveEventEncoderConnectedEventData DeserializeMediaLiveEventEncoderConnectedEventData(JsonElement element) @@ -43,5 +46,18 @@ internal static MediaLiveEventEncoderConnectedEventData DeserializeMediaLiveEven } return new MediaLiveEventEncoderConnectedEventData(ingestUrl.Value, streamId.Value, encoderIp.Value, encoderPort.Value); } + + internal partial class MediaLiveEventEncoderConnectedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaLiveEventEncoderConnectedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaLiveEventEncoderConnectedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaLiveEventEncoderConnectedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventEncoderDisconnectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventEncoderDisconnectedEventData.Serialization.cs index bc087c7b8ebc1..63451121fb3b6 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventEncoderDisconnectedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventEncoderDisconnectedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(MediaLiveEventEncoderDisconnectedEventDataConverter))] public partial class MediaLiveEventEncoderDisconnectedEventData { internal static MediaLiveEventEncoderDisconnectedEventData DeserializeMediaLiveEventEncoderDisconnectedEventData(JsonElement element) @@ -49,5 +52,18 @@ internal static MediaLiveEventEncoderDisconnectedEventData DeserializeMediaLiveE } return new MediaLiveEventEncoderDisconnectedEventData(ingestUrl.Value, streamId.Value, encoderIp.Value, encoderPort.Value, resultCode.Value); } + + internal partial class MediaLiveEventEncoderDisconnectedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaLiveEventEncoderDisconnectedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaLiveEventEncoderDisconnectedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaLiveEventEncoderDisconnectedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventIncomingDataChunkDroppedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventIncomingDataChunkDroppedEventData.Serialization.cs index 38adbcbe69545..089a20fd2d875 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventIncomingDataChunkDroppedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventIncomingDataChunkDroppedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(MediaLiveEventIncomingDataChunkDroppedEventDataConverter))] public partial class MediaLiveEventIncomingDataChunkDroppedEventData { internal static MediaLiveEventIncomingDataChunkDroppedEventData DeserializeMediaLiveEventIncomingDataChunkDroppedEventData(JsonElement element) @@ -60,5 +63,18 @@ internal static MediaLiveEventIncomingDataChunkDroppedEventData DeserializeMedia } return new MediaLiveEventIncomingDataChunkDroppedEventData(timestamp.Value, trackType.Value, Optional.ToNullable(bitrate), timescale.Value, resultCode.Value, trackName.Value); } + + internal partial class MediaLiveEventIncomingDataChunkDroppedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaLiveEventIncomingDataChunkDroppedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaLiveEventIncomingDataChunkDroppedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaLiveEventIncomingDataChunkDroppedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventIncomingStreamReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventIncomingStreamReceivedEventData.Serialization.cs index f7869b3be4d9f..043bc638c4a45 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventIncomingStreamReceivedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventIncomingStreamReceivedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(MediaLiveEventIncomingStreamReceivedEventDataConverter))] public partial class MediaLiveEventIncomingStreamReceivedEventData { internal static MediaLiveEventIncomingStreamReceivedEventData DeserializeMediaLiveEventIncomingStreamReceivedEventData(JsonElement element) @@ -78,5 +81,18 @@ internal static MediaLiveEventIncomingStreamReceivedEventData DeserializeMediaLi } return new MediaLiveEventIncomingStreamReceivedEventData(ingestUrl.Value, trackType.Value, trackName.Value, Optional.ToNullable(bitrate), encoderIp.Value, encoderPort.Value, timestamp.Value, duration.Value, timescale.Value); } + + internal partial class MediaLiveEventIncomingStreamReceivedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaLiveEventIncomingStreamReceivedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaLiveEventIncomingStreamReceivedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaLiveEventIncomingStreamReceivedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventIncomingStreamsOutOfSyncEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventIncomingStreamsOutOfSyncEventData.Serialization.cs index 322ba21f3a441..7b534474889be 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventIncomingStreamsOutOfSyncEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventIncomingStreamsOutOfSyncEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(MediaLiveEventIncomingStreamsOutOfSyncEventDataConverter))] public partial class MediaLiveEventIncomingStreamsOutOfSyncEventData { internal static MediaLiveEventIncomingStreamsOutOfSyncEventData DeserializeMediaLiveEventIncomingStreamsOutOfSyncEventData(JsonElement element) @@ -55,5 +58,18 @@ internal static MediaLiveEventIncomingStreamsOutOfSyncEventData DeserializeMedia } return new MediaLiveEventIncomingStreamsOutOfSyncEventData(minLastTimestamp.Value, typeOfStreamWithMinLastTimestamp.Value, maxLastTimestamp.Value, typeOfStreamWithMaxLastTimestamp.Value, timescaleOfMinLastTimestamp.Value, timescaleOfMaxLastTimestamp.Value); } + + internal partial class MediaLiveEventIncomingStreamsOutOfSyncEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaLiveEventIncomingStreamsOutOfSyncEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaLiveEventIncomingStreamsOutOfSyncEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaLiveEventIncomingStreamsOutOfSyncEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventIncomingVideoStreamsOutOfSyncEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventIncomingVideoStreamsOutOfSyncEventData.Serialization.cs index eff619006aa56..d6643e3747949 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventIncomingVideoStreamsOutOfSyncEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventIncomingVideoStreamsOutOfSyncEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(MediaLiveEventIncomingVideoStreamsOutOfSyncEventDataConverter))] public partial class MediaLiveEventIncomingVideoStreamsOutOfSyncEventData { internal static MediaLiveEventIncomingVideoStreamsOutOfSyncEventData DeserializeMediaLiveEventIncomingVideoStreamsOutOfSyncEventData(JsonElement element) @@ -49,5 +52,18 @@ internal static MediaLiveEventIncomingVideoStreamsOutOfSyncEventData Deserialize } return new MediaLiveEventIncomingVideoStreamsOutOfSyncEventData(firstTimestamp.Value, firstDuration.Value, secondTimestamp.Value, secondDuration.Value, timescale.Value); } + + internal partial class MediaLiveEventIncomingVideoStreamsOutOfSyncEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaLiveEventIncomingVideoStreamsOutOfSyncEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaLiveEventIncomingVideoStreamsOutOfSyncEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaLiveEventIncomingVideoStreamsOutOfSyncEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventIngestHeartbeatEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventIngestHeartbeatEventData.Serialization.cs index f095b360e2822..29ce1d41d48cd 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventIngestHeartbeatEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventIngestHeartbeatEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(MediaLiveEventIngestHeartbeatEventDataConverter))] public partial class MediaLiveEventIngestHeartbeatEventData { internal static MediaLiveEventIngestHeartbeatEventData DeserializeMediaLiveEventIngestHeartbeatEventData(JsonElement element) @@ -126,5 +129,18 @@ internal static MediaLiveEventIngestHeartbeatEventData DeserializeMediaLiveEvent } return new MediaLiveEventIngestHeartbeatEventData(trackType.Value, trackName.Value, Optional.ToNullable(bitrate), Optional.ToNullable(incomingBitrate), lastTimestamp.Value, timescale.Value, Optional.ToNullable(overlapCount), Optional.ToNullable(discontinuityCount), Optional.ToNullable(nonincreasingCount), Optional.ToNullable(unexpectedBitrate), state.Value, Optional.ToNullable(healthy)); } + + internal partial class MediaLiveEventIngestHeartbeatEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaLiveEventIngestHeartbeatEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaLiveEventIngestHeartbeatEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaLiveEventIngestHeartbeatEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventTrackDiscontinuityDetectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventTrackDiscontinuityDetectedEventData.Serialization.cs index f0d2cbb6784ce..d15035ca45c06 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventTrackDiscontinuityDetectedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MediaLiveEventTrackDiscontinuityDetectedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(MediaLiveEventTrackDiscontinuityDetectedEventDataConverter))] public partial class MediaLiveEventTrackDiscontinuityDetectedEventData { internal static MediaLiveEventTrackDiscontinuityDetectedEventData DeserializeMediaLiveEventTrackDiscontinuityDetectedEventData(JsonElement element) @@ -66,5 +69,18 @@ internal static MediaLiveEventTrackDiscontinuityDetectedEventData DeserializeMed } return new MediaLiveEventTrackDiscontinuityDetectedEventData(trackType.Value, trackName.Value, Optional.ToNullable(bitrate), previousTimestamp.Value, newTimestamp.Value, timescale.Value, discontinuityGap.Value); } + + internal partial class MediaLiveEventTrackDiscontinuityDetectedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MediaLiveEventTrackDiscontinuityDetectedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MediaLiveEventTrackDiscontinuityDetectedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMediaLiveEventTrackDiscontinuityDetectedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MicrosoftTeamsUserIdentifierModel.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MicrosoftTeamsUserIdentifierModel.Serialization.cs new file mode 100644 index 0000000000000..f9e3db31a8340 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MicrosoftTeamsUserIdentifierModel.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(MicrosoftTeamsUserIdentifierModelConverter))] + public partial class MicrosoftTeamsUserIdentifierModel + { + internal static MicrosoftTeamsUserIdentifierModel DeserializeMicrosoftTeamsUserIdentifierModel(JsonElement element) + { + string userId = default; + Optional isAnonymous = default; + Optional cloud = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("userId")) + { + userId = property.Value.GetString(); + continue; + } + if (property.NameEquals("isAnonymous")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isAnonymous = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("cloud")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + cloud = new CommunicationCloudEnvironmentModel(property.Value.GetString()); + continue; + } + } + return new MicrosoftTeamsUserIdentifierModel(userId, Optional.ToNullable(isAnonymous), Optional.ToNullable(cloud)); + } + + internal partial class MicrosoftTeamsUserIdentifierModelConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, MicrosoftTeamsUserIdentifierModel model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override MicrosoftTeamsUserIdentifierModel Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeMicrosoftTeamsUserIdentifierModel(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MicrosoftTeamsUserIdentifierModel.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MicrosoftTeamsUserIdentifierModel.cs new file mode 100644 index 0000000000000..638fe7f0d1817 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/MicrosoftTeamsUserIdentifierModel.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// A Microsoft Teams user. + public partial class MicrosoftTeamsUserIdentifierModel + { + /// Initializes a new instance of MicrosoftTeamsUserIdentifierModel. + /// The Id of the Microsoft Teams user. If not anonymous, this is the AAD object Id of the user. + /// is null. + internal MicrosoftTeamsUserIdentifierModel(string userId) + { + if (userId == null) + { + throw new ArgumentNullException(nameof(userId)); + } + + UserId = userId; + } + + /// Initializes a new instance of MicrosoftTeamsUserIdentifierModel. + /// The Id of the Microsoft Teams user. If not anonymous, this is the AAD object Id of the user. + /// True if the Microsoft Teams user is anonymous. By default false if missing. + /// The cloud that the Microsoft Teams user belongs to. By default 'public' if missing. + internal MicrosoftTeamsUserIdentifierModel(string userId, bool? isAnonymous, CommunicationCloudEnvironmentModel? cloud) + { + UserId = userId; + IsAnonymous = isAnonymous; + Cloud = cloud; + } + + /// The Id of the Microsoft Teams user. If not anonymous, this is the AAD object Id of the user. + public string UserId { get; } + /// True if the Microsoft Teams user is anonymous. By default false if missing. + public bool? IsAnonymous { get; } + /// The cloud that the Microsoft Teams user belongs to. By default 'public' if missing. + public CommunicationCloudEnvironmentModel? Cloud { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/PhoneNumberIdentifierModel.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/PhoneNumberIdentifierModel.Serialization.cs new file mode 100644 index 0000000000000..ce6bdd27e00f0 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/PhoneNumberIdentifierModel.Serialization.cs @@ -0,0 +1,45 @@ +// 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(PhoneNumberIdentifierModelConverter))] + public partial class PhoneNumberIdentifierModel + { + internal static PhoneNumberIdentifierModel DeserializePhoneNumberIdentifierModel(JsonElement element) + { + string value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + value = property.Value.GetString(); + continue; + } + } + return new PhoneNumberIdentifierModel(value); + } + + internal partial class PhoneNumberIdentifierModelConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, PhoneNumberIdentifierModel model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override PhoneNumberIdentifierModel Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializePhoneNumberIdentifierModel(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/PhoneNumberIdentifierModel.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/PhoneNumberIdentifierModel.cs new file mode 100644 index 0000000000000..767f668b48d8a --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/PhoneNumberIdentifierModel.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// A phone number. + public partial class PhoneNumberIdentifierModel + { + /// Initializes a new instance of PhoneNumberIdentifierModel. + /// The phone number in E.164 format. + /// is null. + internal PhoneNumberIdentifierModel(string value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value; + } + + /// The phone number in E.164 format. + public string Value { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/RedisExportRDBCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/RedisExportRDBCompletedEventData.Serialization.cs index b152fd26885bf..93ad6a3f23d56 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/RedisExportRDBCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/RedisExportRDBCompletedEventData.Serialization.cs @@ -7,10 +7,12 @@ using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(RedisExportRDBCompletedEventDataConverter))] public partial class RedisExportRDBCompletedEventData { internal static RedisExportRDBCompletedEventData DeserializeRedisExportRDBCompletedEventData(JsonElement element) @@ -43,5 +45,18 @@ internal static RedisExportRDBCompletedEventData DeserializeRedisExportRDBComple } return new RedisExportRDBCompletedEventData(Optional.ToNullable(timestamp), name.Value, status.Value); } + + internal partial class RedisExportRDBCompletedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, RedisExportRDBCompletedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override RedisExportRDBCompletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeRedisExportRDBCompletedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/RedisImportRDBCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/RedisImportRDBCompletedEventData.Serialization.cs index d8d4740278d3f..1d68aed548c65 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/RedisImportRDBCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/RedisImportRDBCompletedEventData.Serialization.cs @@ -7,10 +7,12 @@ using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(RedisImportRDBCompletedEventDataConverter))] public partial class RedisImportRDBCompletedEventData { internal static RedisImportRDBCompletedEventData DeserializeRedisImportRDBCompletedEventData(JsonElement element) @@ -43,5 +45,18 @@ internal static RedisImportRDBCompletedEventData DeserializeRedisImportRDBComple } return new RedisImportRDBCompletedEventData(Optional.ToNullable(timestamp), name.Value, status.Value); } + + internal partial class RedisImportRDBCompletedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, RedisImportRDBCompletedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override RedisImportRDBCompletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeRedisImportRDBCompletedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/RedisPatchingCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/RedisPatchingCompletedEventData.Serialization.cs index c9747c7a81169..451e0834d49bc 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/RedisPatchingCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/RedisPatchingCompletedEventData.Serialization.cs @@ -7,10 +7,12 @@ using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(RedisPatchingCompletedEventDataConverter))] public partial class RedisPatchingCompletedEventData { internal static RedisPatchingCompletedEventData DeserializeRedisPatchingCompletedEventData(JsonElement element) @@ -43,5 +45,18 @@ internal static RedisPatchingCompletedEventData DeserializeRedisPatchingComplete } return new RedisPatchingCompletedEventData(Optional.ToNullable(timestamp), name.Value, status.Value); } + + internal partial class RedisPatchingCompletedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, RedisPatchingCompletedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override RedisPatchingCompletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeRedisPatchingCompletedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/RedisScalingCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/RedisScalingCompletedEventData.Serialization.cs index 750427ae737f8..d48088aba2445 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/RedisScalingCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/RedisScalingCompletedEventData.Serialization.cs @@ -7,10 +7,12 @@ using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(RedisScalingCompletedEventDataConverter))] public partial class RedisScalingCompletedEventData { internal static RedisScalingCompletedEventData DeserializeRedisScalingCompletedEventData(JsonElement element) @@ -43,5 +45,18 @@ internal static RedisScalingCompletedEventData DeserializeRedisScalingCompletedE } return new RedisScalingCompletedEventData(Optional.ToNullable(timestamp), name.Value, status.Value); } + + internal partial class RedisScalingCompletedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, RedisScalingCompletedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override RedisScalingCompletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeRedisScalingCompletedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceActionCancelData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceActionCancelData.Serialization.cs index c1ff4b4ee7a1a..2b475edcde7b5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceActionCancelData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceActionCancelData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(ResourceActionCancelDataConverter))] public partial class ResourceActionCancelData { internal static ResourceActionCancelData DeserializeResourceActionCancelData(JsonElement element) @@ -85,5 +88,18 @@ internal static ResourceActionCancelData DeserializeResourceActionCancelData(Jso } return new ResourceActionCancelData(tenantId.Value, subscriptionId.Value, resourceGroup.Value, resourceProvider.Value, resourceUri.Value, operationName.Value, status.Value, authorization.Value, claims.Value, correlationId.Value, httpRequest.Value); } + + internal partial class ResourceActionCancelDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ResourceActionCancelData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override ResourceActionCancelData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceActionCancelData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceActionFailureData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceActionFailureData.Serialization.cs index 4c50d5168ef7f..2ae98da320a00 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceActionFailureData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceActionFailureData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(ResourceActionFailureDataConverter))] public partial class ResourceActionFailureData { internal static ResourceActionFailureData DeserializeResourceActionFailureData(JsonElement element) @@ -85,5 +88,18 @@ internal static ResourceActionFailureData DeserializeResourceActionFailureData(J } return new ResourceActionFailureData(tenantId.Value, subscriptionId.Value, resourceGroup.Value, resourceProvider.Value, resourceUri.Value, operationName.Value, status.Value, authorization.Value, claims.Value, correlationId.Value, httpRequest.Value); } + + internal partial class ResourceActionFailureDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ResourceActionFailureData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override ResourceActionFailureData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceActionFailureData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceActionSuccessData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceActionSuccessData.Serialization.cs index 33e3bb49a975e..1a2ed93ca79b1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceActionSuccessData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceActionSuccessData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(ResourceActionSuccessDataConverter))] public partial class ResourceActionSuccessData { internal static ResourceActionSuccessData DeserializeResourceActionSuccessData(JsonElement element) @@ -85,5 +88,18 @@ internal static ResourceActionSuccessData DeserializeResourceActionSuccessData(J } return new ResourceActionSuccessData(tenantId.Value, subscriptionId.Value, resourceGroup.Value, resourceProvider.Value, resourceUri.Value, operationName.Value, status.Value, authorization.Value, claims.Value, correlationId.Value, httpRequest.Value); } + + internal partial class ResourceActionSuccessDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ResourceActionSuccessData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override ResourceActionSuccessData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceActionSuccessData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceDeleteCancelData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceDeleteCancelData.Serialization.cs index dee582df6f45b..f92b68b2d5d1d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceDeleteCancelData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceDeleteCancelData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(ResourceDeleteCancelDataConverter))] public partial class ResourceDeleteCancelData { internal static ResourceDeleteCancelData DeserializeResourceDeleteCancelData(JsonElement element) @@ -85,5 +88,18 @@ internal static ResourceDeleteCancelData DeserializeResourceDeleteCancelData(Jso } return new ResourceDeleteCancelData(tenantId.Value, subscriptionId.Value, resourceGroup.Value, resourceProvider.Value, resourceUri.Value, operationName.Value, status.Value, authorization.Value, claims.Value, correlationId.Value, httpRequest.Value); } + + internal partial class ResourceDeleteCancelDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ResourceDeleteCancelData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override ResourceDeleteCancelData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceDeleteCancelData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceDeleteFailureData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceDeleteFailureData.Serialization.cs index 7eaeb655a6a73..089ced44e1ff3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceDeleteFailureData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceDeleteFailureData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(ResourceDeleteFailureDataConverter))] public partial class ResourceDeleteFailureData { internal static ResourceDeleteFailureData DeserializeResourceDeleteFailureData(JsonElement element) @@ -85,5 +88,18 @@ internal static ResourceDeleteFailureData DeserializeResourceDeleteFailureData(J } return new ResourceDeleteFailureData(tenantId.Value, subscriptionId.Value, resourceGroup.Value, resourceProvider.Value, resourceUri.Value, operationName.Value, status.Value, authorization.Value, claims.Value, correlationId.Value, httpRequest.Value); } + + internal partial class ResourceDeleteFailureDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ResourceDeleteFailureData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override ResourceDeleteFailureData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceDeleteFailureData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceDeleteSuccessData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceDeleteSuccessData.Serialization.cs index 014b51f0bcd8b..f3a6f4d2a4e70 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceDeleteSuccessData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceDeleteSuccessData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(ResourceDeleteSuccessDataConverter))] public partial class ResourceDeleteSuccessData { internal static ResourceDeleteSuccessData DeserializeResourceDeleteSuccessData(JsonElement element) @@ -85,5 +88,18 @@ internal static ResourceDeleteSuccessData DeserializeResourceDeleteSuccessData(J } return new ResourceDeleteSuccessData(tenantId.Value, subscriptionId.Value, resourceGroup.Value, resourceProvider.Value, resourceUri.Value, operationName.Value, status.Value, authorization.Value, claims.Value, correlationId.Value, httpRequest.Value); } + + internal partial class ResourceDeleteSuccessDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ResourceDeleteSuccessData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override ResourceDeleteSuccessData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceDeleteSuccessData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceWriteCancelData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceWriteCancelData.Serialization.cs index e4acd21955150..5c45f7357caea 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceWriteCancelData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceWriteCancelData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(ResourceWriteCancelDataConverter))] public partial class ResourceWriteCancelData { internal static ResourceWriteCancelData DeserializeResourceWriteCancelData(JsonElement element) @@ -85,5 +88,18 @@ internal static ResourceWriteCancelData DeserializeResourceWriteCancelData(JsonE } return new ResourceWriteCancelData(tenantId.Value, subscriptionId.Value, resourceGroup.Value, resourceProvider.Value, resourceUri.Value, operationName.Value, status.Value, authorization.Value, claims.Value, correlationId.Value, httpRequest.Value); } + + internal partial class ResourceWriteCancelDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ResourceWriteCancelData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override ResourceWriteCancelData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceWriteCancelData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceWriteFailureData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceWriteFailureData.Serialization.cs index 7e6b192a4d3b8..8e93e95b2346b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceWriteFailureData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceWriteFailureData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(ResourceWriteFailureDataConverter))] public partial class ResourceWriteFailureData { internal static ResourceWriteFailureData DeserializeResourceWriteFailureData(JsonElement element) @@ -85,5 +88,18 @@ internal static ResourceWriteFailureData DeserializeResourceWriteFailureData(Jso } return new ResourceWriteFailureData(tenantId.Value, subscriptionId.Value, resourceGroup.Value, resourceProvider.Value, resourceUri.Value, operationName.Value, status.Value, authorization.Value, claims.Value, correlationId.Value, httpRequest.Value); } + + internal partial class ResourceWriteFailureDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ResourceWriteFailureData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override ResourceWriteFailureData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceWriteFailureData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceWriteSuccessData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceWriteSuccessData.Serialization.cs index b9713aabe7209..996c6bfcb0e5f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceWriteSuccessData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceWriteSuccessData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(ResourceWriteSuccessDataConverter))] public partial class ResourceWriteSuccessData { internal static ResourceWriteSuccessData DeserializeResourceWriteSuccessData(JsonElement element) @@ -85,5 +88,18 @@ internal static ResourceWriteSuccessData DeserializeResourceWriteSuccessData(Jso } return new ResourceWriteSuccessData(tenantId.Value, subscriptionId.Value, resourceGroup.Value, resourceProvider.Value, resourceUri.Value, operationName.Value, status.Value, authorization.Value, claims.Value, correlationId.Value, httpRequest.Value); } + + internal partial class ResourceWriteSuccessDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ResourceWriteSuccessData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override ResourceWriteSuccessData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceWriteSuccessData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData.Serialization.cs new file mode 100644 index 0000000000000..a456f54d51c8c --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData.Serialization.cs @@ -0,0 +1,75 @@ +// 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(ServiceBusActiveMessagesAvailablePeriodicNotificationsEventDataConverter))] + public partial class ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData + { + internal static ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData DeserializeServiceBusActiveMessagesAvailablePeriodicNotificationsEventData(JsonElement element) + { + Optional namespaceName = default; + Optional requestUri = default; + Optional entityType = default; + Optional queueName = default; + Optional topicName = default; + Optional subscriptionName = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("namespaceName")) + { + namespaceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("requestUri")) + { + requestUri = property.Value.GetString(); + continue; + } + if (property.NameEquals("entityType")) + { + entityType = property.Value.GetString(); + continue; + } + if (property.NameEquals("queueName")) + { + queueName = property.Value.GetString(); + continue; + } + if (property.NameEquals("topicName")) + { + topicName = property.Value.GetString(); + continue; + } + if (property.NameEquals("subscriptionName")) + { + subscriptionName = property.Value.GetString(); + continue; + } + } + return new ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData(namespaceName.Value, requestUri.Value, entityType.Value, queueName.Value, topicName.Value, subscriptionName.Value); + } + + internal partial class ServiceBusActiveMessagesAvailablePeriodicNotificationsEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeServiceBusActiveMessagesAvailablePeriodicNotificationsEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData.cs new file mode 100644 index 0000000000000..793a05f8ab6b6 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData.cs @@ -0,0 +1,48 @@ +// 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.ServiceBus.ActiveMessagesAvailablePeriodicNotifications event. + public partial class ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData + { + /// Initializes a new instance of ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData. + internal ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData() + { + } + + /// Initializes a new instance of ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData. + /// The namespace name of the Microsoft.ServiceBus resource. + /// The endpoint of the Microsoft.ServiceBus resource. + /// The entity type of the Microsoft.ServiceBus resource. Could be one of 'queue' or 'subscriber'. + /// The name of the Microsoft.ServiceBus queue. If the entity type is of type 'subscriber', then this value will be null. + /// The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null. + /// The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null. + internal ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData(string namespaceName, string requestUri, string entityType, string queueName, string topicName, string subscriptionName) + { + NamespaceName = namespaceName; + RequestUri = requestUri; + EntityType = entityType; + QueueName = queueName; + TopicName = topicName; + SubscriptionName = subscriptionName; + } + + /// The namespace name of the Microsoft.ServiceBus resource. + public string NamespaceName { get; } + /// The endpoint of the Microsoft.ServiceBus resource. + public string RequestUri { get; } + /// The entity type of the Microsoft.ServiceBus resource. Could be one of 'queue' or 'subscriber'. + public string EntityType { get; } + /// The name of the Microsoft.ServiceBus queue. If the entity type is of type 'subscriber', then this value will be null. + public string QueueName { get; } + /// The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null. + public string TopicName { get; } + /// The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null. + public string SubscriptionName { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ServiceBusActiveMessagesAvailableWithNoListenersEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ServiceBusActiveMessagesAvailableWithNoListenersEventData.Serialization.cs index 6b29f20846444..527c77e1f676b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ServiceBusActiveMessagesAvailableWithNoListenersEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ServiceBusActiveMessagesAvailableWithNoListenersEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(ServiceBusActiveMessagesAvailableWithNoListenersEventDataConverter))] public partial class ServiceBusActiveMessagesAvailableWithNoListenersEventData { internal static ServiceBusActiveMessagesAvailableWithNoListenersEventData DeserializeServiceBusActiveMessagesAvailableWithNoListenersEventData(JsonElement element) @@ -55,5 +58,18 @@ internal static ServiceBusActiveMessagesAvailableWithNoListenersEventData Deseri } return new ServiceBusActiveMessagesAvailableWithNoListenersEventData(namespaceName.Value, requestUri.Value, entityType.Value, queueName.Value, topicName.Value, subscriptionName.Value); } + + internal partial class ServiceBusActiveMessagesAvailableWithNoListenersEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ServiceBusActiveMessagesAvailableWithNoListenersEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override ServiceBusActiveMessagesAvailableWithNoListenersEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeServiceBusActiveMessagesAvailableWithNoListenersEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData.Serialization.cs new file mode 100644 index 0000000000000..0e0546082fde8 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData.Serialization.cs @@ -0,0 +1,75 @@ +// 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(ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventDataConverter))] + public partial class ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData + { + internal static ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData DeserializeServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData(JsonElement element) + { + Optional namespaceName = default; + Optional requestUri = default; + Optional entityType = default; + Optional queueName = default; + Optional topicName = default; + Optional subscriptionName = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("namespaceName")) + { + namespaceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("requestUri")) + { + requestUri = property.Value.GetString(); + continue; + } + if (property.NameEquals("entityType")) + { + entityType = property.Value.GetString(); + continue; + } + if (property.NameEquals("queueName")) + { + queueName = property.Value.GetString(); + continue; + } + if (property.NameEquals("topicName")) + { + topicName = property.Value.GetString(); + continue; + } + if (property.NameEquals("subscriptionName")) + { + subscriptionName = property.Value.GetString(); + continue; + } + } + return new ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData(namespaceName.Value, requestUri.Value, entityType.Value, queueName.Value, topicName.Value, subscriptionName.Value); + } + + internal partial class ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData.cs new file mode 100644 index 0000000000000..0fb1c55c325dc --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData.cs @@ -0,0 +1,48 @@ +// 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.ServiceBus.DeadletterMessagesAvailablePeriodicNotifications event. + public partial class ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData + { + /// Initializes a new instance of ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData. + internal ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData() + { + } + + /// Initializes a new instance of ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData. + /// The namespace name of the Microsoft.ServiceBus resource. + /// The endpoint of the Microsoft.ServiceBus resource. + /// The entity type of the Microsoft.ServiceBus resource. Could be one of 'queue' or 'subscriber'. + /// The name of the Microsoft.ServiceBus queue. If the entity type is of type 'subscriber', then this value will be null. + /// The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null. + /// The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null. + internal ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData(string namespaceName, string requestUri, string entityType, string queueName, string topicName, string subscriptionName) + { + NamespaceName = namespaceName; + RequestUri = requestUri; + EntityType = entityType; + QueueName = queueName; + TopicName = topicName; + SubscriptionName = subscriptionName; + } + + /// The namespace name of the Microsoft.ServiceBus resource. + public string NamespaceName { get; } + /// The endpoint of the Microsoft.ServiceBus resource. + public string RequestUri { get; } + /// The entity type of the Microsoft.ServiceBus resource. Could be one of 'queue' or 'subscriber'. + public string EntityType { get; } + /// The name of the Microsoft.ServiceBus queue. If the entity type is of type 'subscriber', then this value will be null. + public string QueueName { get; } + /// The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null. + public string TopicName { get; } + /// The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null. + public string SubscriptionName { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ServiceBusDeadletterMessagesAvailableWithNoListenersEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ServiceBusDeadletterMessagesAvailableWithNoListenersEventData.Serialization.cs index 8b9f05afb187d..3135a5b4add1d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ServiceBusDeadletterMessagesAvailableWithNoListenersEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ServiceBusDeadletterMessagesAvailableWithNoListenersEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(ServiceBusDeadletterMessagesAvailableWithNoListenersEventDataConverter))] public partial class ServiceBusDeadletterMessagesAvailableWithNoListenersEventData { internal static ServiceBusDeadletterMessagesAvailableWithNoListenersEventData DeserializeServiceBusDeadletterMessagesAvailableWithNoListenersEventData(JsonElement element) @@ -55,5 +58,18 @@ internal static ServiceBusDeadletterMessagesAvailableWithNoListenersEventData De } return new ServiceBusDeadletterMessagesAvailableWithNoListenersEventData(namespaceName.Value, requestUri.Value, entityType.Value, queueName.Value, topicName.Value, subscriptionName.Value); } + + internal partial class ServiceBusDeadletterMessagesAvailableWithNoListenersEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ServiceBusDeadletterMessagesAvailableWithNoListenersEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override ServiceBusDeadletterMessagesAvailableWithNoListenersEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeServiceBusDeadletterMessagesAvailableWithNoListenersEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SignalRServiceClientConnectionConnectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SignalRServiceClientConnectionConnectedEventData.Serialization.cs index e2e31b7e2e264..72526b41ee20d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SignalRServiceClientConnectionConnectedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SignalRServiceClientConnectionConnectedEventData.Serialization.cs @@ -7,10 +7,12 @@ using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(SignalRServiceClientConnectionConnectedEventDataConverter))] public partial class SignalRServiceClientConnectionConnectedEventData { internal static SignalRServiceClientConnectionConnectedEventData DeserializeSignalRServiceClientConnectionConnectedEventData(JsonElement element) @@ -49,5 +51,18 @@ internal static SignalRServiceClientConnectionConnectedEventData DeserializeSign } return new SignalRServiceClientConnectionConnectedEventData(Optional.ToNullable(timestamp), hubName.Value, connectionId.Value, userId.Value); } + + internal partial class SignalRServiceClientConnectionConnectedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, SignalRServiceClientConnectionConnectedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override SignalRServiceClientConnectionConnectedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeSignalRServiceClientConnectionConnectedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SignalRServiceClientConnectionDisconnectedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SignalRServiceClientConnectionDisconnectedEventData.Serialization.cs index 46200883b5edf..d89c528c8a6b2 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SignalRServiceClientConnectionDisconnectedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SignalRServiceClientConnectionDisconnectedEventData.Serialization.cs @@ -7,10 +7,12 @@ using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(SignalRServiceClientConnectionDisconnectedEventDataConverter))] public partial class SignalRServiceClientConnectionDisconnectedEventData { internal static SignalRServiceClientConnectionDisconnectedEventData DeserializeSignalRServiceClientConnectionDisconnectedEventData(JsonElement element) @@ -55,5 +57,18 @@ internal static SignalRServiceClientConnectionDisconnectedEventData DeserializeS } return new SignalRServiceClientConnectionDisconnectedEventData(Optional.ToNullable(timestamp), hubName.Value, connectionId.Value, userId.Value, errorMessage.Value); } + + internal partial class SignalRServiceClientConnectionDisconnectedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, SignalRServiceClientConnectionDisconnectedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override SignalRServiceClientConnectionDisconnectedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeSignalRServiceClientConnectionDisconnectedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobCreatedEventData.Serialization.cs index 5db77012b0af7..89cb7ab80722d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobCreatedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(StorageBlobCreatedEventDataConverter))] public partial class StorageBlobCreatedEventData { internal static StorageBlobCreatedEventData DeserializeStorageBlobCreatedEventData(JsonElement element) @@ -106,5 +109,18 @@ internal static StorageBlobCreatedEventData DeserializeStorageBlobCreatedEventDa } return new StorageBlobCreatedEventData(api.Value, clientRequestId.Value, requestId.Value, eTag.Value, contentType.Value, Optional.ToNullable(contentLength), Optional.ToNullable(contentOffset), blobType.Value, url.Value, sequencer.Value, identity.Value, storageDiagnostics.Value); } + + internal partial class StorageBlobCreatedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, StorageBlobCreatedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override StorageBlobCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageBlobCreatedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobDeletedEventData.Serialization.cs index 33eeba5da8d38..282230d7a33f4 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobDeletedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(StorageBlobDeletedEventDataConverter))] public partial class StorageBlobDeletedEventData { internal static StorageBlobDeletedEventData DeserializeStorageBlobDeletedEventData(JsonElement element) @@ -78,5 +81,18 @@ internal static StorageBlobDeletedEventData DeserializeStorageBlobDeletedEventDa } return new StorageBlobDeletedEventData(api.Value, clientRequestId.Value, requestId.Value, contentType.Value, blobType.Value, url.Value, sequencer.Value, identity.Value, storageDiagnostics.Value); } + + internal partial class StorageBlobDeletedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, StorageBlobDeletedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override StorageBlobDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageBlobDeletedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobRenamedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobRenamedEventData.Serialization.cs index bcc7e56b85174..2ad77aba5e735 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobRenamedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobRenamedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(StorageBlobRenamedEventDataConverter))] public partial class StorageBlobRenamedEventData { internal static StorageBlobRenamedEventData DeserializeStorageBlobRenamedEventData(JsonElement element) @@ -72,5 +75,18 @@ internal static StorageBlobRenamedEventData DeserializeStorageBlobRenamedEventDa } return new StorageBlobRenamedEventData(api.Value, clientRequestId.Value, requestId.Value, sourceUrl.Value, destinationUrl.Value, sequencer.Value, identity.Value, storageDiagnostics.Value); } + + internal partial class StorageBlobRenamedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, StorageBlobRenamedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override StorageBlobRenamedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageBlobRenamedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageDirectoryCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageDirectoryCreatedEventData.Serialization.cs index a239880de6ad2..d1a460f103973 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageDirectoryCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageDirectoryCreatedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(StorageDirectoryCreatedEventDataConverter))] public partial class StorageDirectoryCreatedEventData { internal static StorageDirectoryCreatedEventData DeserializeStorageDirectoryCreatedEventData(JsonElement element) @@ -72,5 +75,18 @@ internal static StorageDirectoryCreatedEventData DeserializeStorageDirectoryCrea } return new StorageDirectoryCreatedEventData(api.Value, clientRequestId.Value, requestId.Value, eTag.Value, url.Value, sequencer.Value, identity.Value, storageDiagnostics.Value); } + + internal partial class StorageDirectoryCreatedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, StorageDirectoryCreatedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override StorageDirectoryCreatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageDirectoryCreatedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageDirectoryDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageDirectoryDeletedEventData.Serialization.cs index 6af4e87659abd..74d6d7d5af95c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageDirectoryDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageDirectoryDeletedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(StorageDirectoryDeletedEventDataConverter))] public partial class StorageDirectoryDeletedEventData { internal static StorageDirectoryDeletedEventData DeserializeStorageDirectoryDeletedEventData(JsonElement element) @@ -77,5 +80,18 @@ internal static StorageDirectoryDeletedEventData DeserializeStorageDirectoryDele } return new StorageDirectoryDeletedEventData(api.Value, clientRequestId.Value, requestId.Value, url.Value, Optional.ToNullable(recursive), sequencer.Value, identity.Value, storageDiagnostics.Value); } + + internal partial class StorageDirectoryDeletedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, StorageDirectoryDeletedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override StorageDirectoryDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageDirectoryDeletedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageDirectoryRenamedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageDirectoryRenamedEventData.Serialization.cs index 915cd7a3287cf..fb6583fa274a1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageDirectoryRenamedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageDirectoryRenamedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(StorageDirectoryRenamedEventDataConverter))] public partial class StorageDirectoryRenamedEventData { internal static StorageDirectoryRenamedEventData DeserializeStorageDirectoryRenamedEventData(JsonElement element) @@ -72,5 +75,18 @@ internal static StorageDirectoryRenamedEventData DeserializeStorageDirectoryRena } return new StorageDirectoryRenamedEventData(api.Value, clientRequestId.Value, requestId.Value, sourceUrl.Value, destinationUrl.Value, sequencer.Value, identity.Value, storageDiagnostics.Value); } + + internal partial class StorageDirectoryRenamedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, StorageDirectoryRenamedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override StorageDirectoryRenamedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageDirectoryRenamedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageLifecyclePolicyActionSummaryDetail.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageLifecyclePolicyActionSummaryDetail.Serialization.cs index 52a96141c3a58..4d2291ae43eee 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageLifecyclePolicyActionSummaryDetail.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageLifecyclePolicyActionSummaryDetail.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(StorageLifecyclePolicyActionSummaryDetailConverter))] public partial class StorageLifecyclePolicyActionSummaryDetail { internal static StorageLifecyclePolicyActionSummaryDetail DeserializeStorageLifecyclePolicyActionSummaryDetail(JsonElement element) @@ -47,5 +50,18 @@ internal static StorageLifecyclePolicyActionSummaryDetail DeserializeStorageLife } return new StorageLifecyclePolicyActionSummaryDetail(Optional.ToNullable(totalObjectsCount), Optional.ToNullable(successCount), errorList.Value); } + + internal partial class StorageLifecyclePolicyActionSummaryDetailConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, StorageLifecyclePolicyActionSummaryDetail model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override StorageLifecyclePolicyActionSummaryDetail Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageLifecyclePolicyActionSummaryDetail(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageLifecyclePolicyCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageLifecyclePolicyCompletedEventData.Serialization.cs index 5c5e2ef1c25f5..7678a53c65c33 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageLifecyclePolicyCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageLifecyclePolicyCompletedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(StorageLifecyclePolicyCompletedEventDataConverter))] public partial class StorageLifecyclePolicyCompletedEventData { internal static StorageLifecyclePolicyCompletedEventData DeserializeStorageLifecyclePolicyCompletedEventData(JsonElement element) @@ -58,5 +61,18 @@ internal static StorageLifecyclePolicyCompletedEventData DeserializeStorageLifec } return new StorageLifecyclePolicyCompletedEventData(scheduleTime.Value, deleteSummary.Value, tierToCoolSummary.Value, tierToArchiveSummary.Value); } + + internal partial class StorageLifecyclePolicyCompletedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, StorageLifecyclePolicyCompletedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override StorageLifecyclePolicyCompletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageLifecyclePolicyCompletedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SubscriptionDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SubscriptionDeletedEventData.Serialization.cs index 7e1dd4891ecae..362ece4bd21e7 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SubscriptionDeletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SubscriptionDeletedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(SubscriptionDeletedEventDataConverter))] public partial class SubscriptionDeletedEventData { internal static SubscriptionDeletedEventData DeserializeSubscriptionDeletedEventData(JsonElement element) @@ -25,5 +28,18 @@ internal static SubscriptionDeletedEventData DeserializeSubscriptionDeletedEvent } return new SubscriptionDeletedEventData(eventSubscriptionId.Value); } + + internal partial class SubscriptionDeletedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, SubscriptionDeletedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override SubscriptionDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeSubscriptionDeletedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SubscriptionValidationEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SubscriptionValidationEventData.Serialization.cs index c8dba77000d3c..9041c503b0eb9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SubscriptionValidationEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SubscriptionValidationEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(SubscriptionValidationEventDataConverter))] public partial class SubscriptionValidationEventData { internal static SubscriptionValidationEventData DeserializeSubscriptionValidationEventData(JsonElement element) @@ -31,5 +34,18 @@ internal static SubscriptionValidationEventData DeserializeSubscriptionValidatio } return new SubscriptionValidationEventData(validationCode.Value, validationUrl.Value); } + + internal partial class SubscriptionValidationEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, SubscriptionValidationEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override SubscriptionValidationEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeSubscriptionValidationEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SubscriptionValidationResponse.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SubscriptionValidationResponse.Serialization.cs index 6e987ff98ed17..44643bd64ad82 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SubscriptionValidationResponse.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SubscriptionValidationResponse.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(SubscriptionValidationResponseConverter))] public partial class SubscriptionValidationResponse { internal static SubscriptionValidationResponse DeserializeSubscriptionValidationResponse(JsonElement element) @@ -25,5 +28,18 @@ internal static SubscriptionValidationResponse DeserializeSubscriptionValidation } return new SubscriptionValidationResponse(validationResponse.Value); } + + internal partial class SubscriptionValidationResponseConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, SubscriptionValidationResponse model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override SubscriptionValidationResponse Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeSubscriptionValidationResponse(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebAppServicePlanUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebAppServicePlanUpdatedEventData.Serialization.cs index 89770bc1d1bb0..45fe1b61ad115 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebAppServicePlanUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebAppServicePlanUpdatedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(WebAppServicePlanUpdatedEventDataConverter))] public partial class WebAppServicePlanUpdatedEventData { internal static WebAppServicePlanUpdatedEventData DeserializeWebAppServicePlanUpdatedEventData(JsonElement element) @@ -77,5 +80,18 @@ internal static WebAppServicePlanUpdatedEventData DeserializeWebAppServicePlanUp } return new WebAppServicePlanUpdatedEventData(appServicePlanEventTypeDetail.Value, sku.Value, name.Value, clientRequestId.Value, correlationRequestId.Value, requestId.Value, address.Value, verb.Value); } + + internal partial class WebAppServicePlanUpdatedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, WebAppServicePlanUpdatedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override WebAppServicePlanUpdatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeWebAppServicePlanUpdatedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebAppServicePlanUpdatedEventDataSku.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebAppServicePlanUpdatedEventDataSku.Serialization.cs index fd3c485c0ed5a..19f0e0c9de2d3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebAppServicePlanUpdatedEventDataSku.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebAppServicePlanUpdatedEventDataSku.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(WebAppServicePlanUpdatedEventDataSkuConverter))] public partial class WebAppServicePlanUpdatedEventDataSku { internal static WebAppServicePlanUpdatedEventDataSku DeserializeWebAppServicePlanUpdatedEventDataSku(JsonElement element) @@ -49,5 +52,18 @@ internal static WebAppServicePlanUpdatedEventDataSku DeserializeWebAppServicePla } return new WebAppServicePlanUpdatedEventDataSku(name.Value, tier.Value, size.Value, family.Value, capacity.Value); } + + internal partial class WebAppServicePlanUpdatedEventDataSkuConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, WebAppServicePlanUpdatedEventDataSku model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override WebAppServicePlanUpdatedEventDataSku Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeWebAppServicePlanUpdatedEventDataSku(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebAppUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebAppUpdatedEventData.Serialization.cs index 755e8f8b46ace..ff6c9092541c9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebAppUpdatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebAppUpdatedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(WebAppUpdatedEventDataConverter))] public partial class WebAppUpdatedEventData { internal static WebAppUpdatedEventData DeserializeWebAppUpdatedEventData(JsonElement element) @@ -66,5 +69,18 @@ internal static WebAppUpdatedEventData DeserializeWebAppUpdatedEventData(JsonEle } return new WebAppUpdatedEventData(appEventTypeDetail.Value, name.Value, clientRequestId.Value, correlationRequestId.Value, requestId.Value, address.Value, verb.Value); } + + internal partial class WebAppUpdatedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, WebAppUpdatedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override WebAppUpdatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeWebAppUpdatedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebBackupOperationCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebBackupOperationCompletedEventData.Serialization.cs index e84b0cd89e5c0..ac1265342067d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebBackupOperationCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebBackupOperationCompletedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(WebBackupOperationCompletedEventDataConverter))] public partial class WebBackupOperationCompletedEventData { internal static WebBackupOperationCompletedEventData DeserializeWebBackupOperationCompletedEventData(JsonElement element) @@ -66,5 +69,18 @@ internal static WebBackupOperationCompletedEventData DeserializeWebBackupOperati } return new WebBackupOperationCompletedEventData(appEventTypeDetail.Value, name.Value, clientRequestId.Value, correlationRequestId.Value, requestId.Value, address.Value, verb.Value); } + + internal partial class WebBackupOperationCompletedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, WebBackupOperationCompletedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override WebBackupOperationCompletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeWebBackupOperationCompletedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebBackupOperationFailedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebBackupOperationFailedEventData.Serialization.cs index fcc40518e11e0..fdd5561f9a201 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebBackupOperationFailedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebBackupOperationFailedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(WebBackupOperationFailedEventDataConverter))] public partial class WebBackupOperationFailedEventData { internal static WebBackupOperationFailedEventData DeserializeWebBackupOperationFailedEventData(JsonElement element) @@ -66,5 +69,18 @@ internal static WebBackupOperationFailedEventData DeserializeWebBackupOperationF } return new WebBackupOperationFailedEventData(appEventTypeDetail.Value, name.Value, clientRequestId.Value, correlationRequestId.Value, requestId.Value, address.Value, verb.Value); } + + internal partial class WebBackupOperationFailedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, WebBackupOperationFailedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override WebBackupOperationFailedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeWebBackupOperationFailedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebBackupOperationStartedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebBackupOperationStartedEventData.Serialization.cs index 31122bb836386..f4dd1f82ddb83 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebBackupOperationStartedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebBackupOperationStartedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(WebBackupOperationStartedEventDataConverter))] public partial class WebBackupOperationStartedEventData { internal static WebBackupOperationStartedEventData DeserializeWebBackupOperationStartedEventData(JsonElement element) @@ -66,5 +69,18 @@ internal static WebBackupOperationStartedEventData DeserializeWebBackupOperation } return new WebBackupOperationStartedEventData(appEventTypeDetail.Value, name.Value, clientRequestId.Value, correlationRequestId.Value, requestId.Value, address.Value, verb.Value); } + + internal partial class WebBackupOperationStartedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, WebBackupOperationStartedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override WebBackupOperationStartedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeWebBackupOperationStartedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebRestoreOperationCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebRestoreOperationCompletedEventData.Serialization.cs index 59be41f0f0c40..a28dedf96567e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebRestoreOperationCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebRestoreOperationCompletedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(WebRestoreOperationCompletedEventDataConverter))] public partial class WebRestoreOperationCompletedEventData { internal static WebRestoreOperationCompletedEventData DeserializeWebRestoreOperationCompletedEventData(JsonElement element) @@ -66,5 +69,18 @@ internal static WebRestoreOperationCompletedEventData DeserializeWebRestoreOpera } return new WebRestoreOperationCompletedEventData(appEventTypeDetail.Value, name.Value, clientRequestId.Value, correlationRequestId.Value, requestId.Value, address.Value, verb.Value); } + + internal partial class WebRestoreOperationCompletedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, WebRestoreOperationCompletedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override WebRestoreOperationCompletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeWebRestoreOperationCompletedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebRestoreOperationFailedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebRestoreOperationFailedEventData.Serialization.cs index bd7bb55f1a2ba..3d0a2b59f732a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebRestoreOperationFailedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebRestoreOperationFailedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(WebRestoreOperationFailedEventDataConverter))] public partial class WebRestoreOperationFailedEventData { internal static WebRestoreOperationFailedEventData DeserializeWebRestoreOperationFailedEventData(JsonElement element) @@ -66,5 +69,18 @@ internal static WebRestoreOperationFailedEventData DeserializeWebRestoreOperatio } return new WebRestoreOperationFailedEventData(appEventTypeDetail.Value, name.Value, clientRequestId.Value, correlationRequestId.Value, requestId.Value, address.Value, verb.Value); } + + internal partial class WebRestoreOperationFailedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, WebRestoreOperationFailedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override WebRestoreOperationFailedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeWebRestoreOperationFailedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebRestoreOperationStartedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebRestoreOperationStartedEventData.Serialization.cs index 1d59dee92047a..44bdafec740f1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebRestoreOperationStartedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebRestoreOperationStartedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(WebRestoreOperationStartedEventDataConverter))] public partial class WebRestoreOperationStartedEventData { internal static WebRestoreOperationStartedEventData DeserializeWebRestoreOperationStartedEventData(JsonElement element) @@ -66,5 +69,18 @@ internal static WebRestoreOperationStartedEventData DeserializeWebRestoreOperati } return new WebRestoreOperationStartedEventData(appEventTypeDetail.Value, name.Value, clientRequestId.Value, correlationRequestId.Value, requestId.Value, address.Value, verb.Value); } + + internal partial class WebRestoreOperationStartedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, WebRestoreOperationStartedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override WebRestoreOperationStartedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeWebRestoreOperationStartedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebSlotSwapCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebSlotSwapCompletedEventData.Serialization.cs index 53e40f1c240c0..6c1366a147bea 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebSlotSwapCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebSlotSwapCompletedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(WebSlotSwapCompletedEventDataConverter))] public partial class WebSlotSwapCompletedEventData { internal static WebSlotSwapCompletedEventData DeserializeWebSlotSwapCompletedEventData(JsonElement element) @@ -66,5 +69,18 @@ internal static WebSlotSwapCompletedEventData DeserializeWebSlotSwapCompletedEve } return new WebSlotSwapCompletedEventData(appEventTypeDetail.Value, name.Value, clientRequestId.Value, correlationRequestId.Value, requestId.Value, address.Value, verb.Value); } + + internal partial class WebSlotSwapCompletedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, WebSlotSwapCompletedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override WebSlotSwapCompletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeWebSlotSwapCompletedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebSlotSwapFailedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebSlotSwapFailedEventData.Serialization.cs index f1270a63865d2..6a4613c98aab9 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebSlotSwapFailedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebSlotSwapFailedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(WebSlotSwapFailedEventDataConverter))] public partial class WebSlotSwapFailedEventData { internal static WebSlotSwapFailedEventData DeserializeWebSlotSwapFailedEventData(JsonElement element) @@ -66,5 +69,18 @@ internal static WebSlotSwapFailedEventData DeserializeWebSlotSwapFailedEventData } return new WebSlotSwapFailedEventData(appEventTypeDetail.Value, name.Value, clientRequestId.Value, correlationRequestId.Value, requestId.Value, address.Value, verb.Value); } + + internal partial class WebSlotSwapFailedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, WebSlotSwapFailedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override WebSlotSwapFailedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeWebSlotSwapFailedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebSlotSwapStartedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebSlotSwapStartedEventData.Serialization.cs index 54b736674de3a..efa15558edcb1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebSlotSwapStartedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebSlotSwapStartedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(WebSlotSwapStartedEventDataConverter))] public partial class WebSlotSwapStartedEventData { internal static WebSlotSwapStartedEventData DeserializeWebSlotSwapStartedEventData(JsonElement element) @@ -66,5 +69,18 @@ internal static WebSlotSwapStartedEventData DeserializeWebSlotSwapStartedEventDa } return new WebSlotSwapStartedEventData(appEventTypeDetail.Value, name.Value, clientRequestId.Value, correlationRequestId.Value, requestId.Value, address.Value, verb.Value); } + + internal partial class WebSlotSwapStartedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, WebSlotSwapStartedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override WebSlotSwapStartedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeWebSlotSwapStartedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebSlotSwapWithPreviewCancelledEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebSlotSwapWithPreviewCancelledEventData.Serialization.cs index c94172de069e5..decdcd15e3e8b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebSlotSwapWithPreviewCancelledEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebSlotSwapWithPreviewCancelledEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(WebSlotSwapWithPreviewCancelledEventDataConverter))] public partial class WebSlotSwapWithPreviewCancelledEventData { internal static WebSlotSwapWithPreviewCancelledEventData DeserializeWebSlotSwapWithPreviewCancelledEventData(JsonElement element) @@ -66,5 +69,18 @@ internal static WebSlotSwapWithPreviewCancelledEventData DeserializeWebSlotSwapW } return new WebSlotSwapWithPreviewCancelledEventData(appEventTypeDetail.Value, name.Value, clientRequestId.Value, correlationRequestId.Value, requestId.Value, address.Value, verb.Value); } + + internal partial class WebSlotSwapWithPreviewCancelledEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, WebSlotSwapWithPreviewCancelledEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override WebSlotSwapWithPreviewCancelledEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeWebSlotSwapWithPreviewCancelledEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebSlotSwapWithPreviewStartedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebSlotSwapWithPreviewStartedEventData.Serialization.cs index fcf72bfbceba0..4df7b6ef29c4d 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebSlotSwapWithPreviewStartedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/WebSlotSwapWithPreviewStartedEventData.Serialization.cs @@ -5,11 +5,14 @@ #nullable disable +using System; using System.Text.Json; +using System.Text.Json.Serialization; using Azure.Core; namespace Azure.Messaging.EventGrid.SystemEvents { + [JsonConverter(typeof(WebSlotSwapWithPreviewStartedEventDataConverter))] public partial class WebSlotSwapWithPreviewStartedEventData { internal static WebSlotSwapWithPreviewStartedEventData DeserializeWebSlotSwapWithPreviewStartedEventData(JsonElement element) @@ -66,5 +69,18 @@ internal static WebSlotSwapWithPreviewStartedEventData DeserializeWebSlotSwapWit } return new WebSlotSwapWithPreviewStartedEventData(appEventTypeDetail.Value, name.Value, clientRequestId.Value, correlationRequestId.Value, requestId.Value, address.Value, verb.Value); } + + internal partial class WebSlotSwapWithPreviewStartedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, WebSlotSwapWithPreviewStartedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override WebSlotSwapWithPreviewStartedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeWebSlotSwapWithPreviewStartedEventData(document.RootElement); + } + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/autorest.md b/sdk/eventgrid/Azure.Messaging.EventGrid/src/autorest.md index 001c5b3707499..309da54853032 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/autorest.md +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/autorest.md @@ -14,27 +14,27 @@ directive: { $[path]["x-namespace"] = namespace; } - $[path]["x-csharp-usage"] = "model,output"; + $[path]["x-csharp-usage"] = "model,output,converter"; $[path]["x-csharp-formats"] = "json"; if (path.includes("WebAppServicePlanUpdatedEventData")) { $[path]["properties"]["sku"]["x-namespace"] = namespace; - $[path]["properties"]["sku"]["x-csharp-usage"] = "model,output"; + $[path]["properties"]["sku"]["x-csharp-usage"] = "model,output,converter"; $[path]["properties"]["sku"]["x-csharp-formats"] = "json"; } if (path.includes("DeviceTwinInfo")) { $[path]["properties"]["properties"]["x-namespace"] = namespace; - $[path]["properties"]["properties"]["x-csharp-usage"] = "model,output"; + $[path]["properties"]["properties"]["x-csharp-usage"] = "model,output,converter"; $[path]["properties"]["properties"]["x-csharp-formats"] = "json"; $[path]["properties"]["x509Thumbprint"]["x-namespace"] = namespace; - $[path]["properties"]["x509Thumbprint"]["x-csharp-usage"] = "model,output"; + $[path]["properties"]["x509Thumbprint"]["x-csharp-usage"] = "model,output,converter"; $[path]["properties"]["x509Thumbprint"]["x-csharp-formats"] = "json"; } } title: EventGridClient -require: https://github.com/Azure/azure-rest-api-specs/blob/3695f4ef3bf65c253509d2708c31c96b71822613/specification/eventgrid/data-plane/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/6c9d4fe7445b78db8336271895924379d95fbc6c/specification/eventgrid/data-plane/readme.md ``` diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/tests/ConsumeEventTests.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/tests/ConsumeEventTests.cs index a4ce8b9a1dc85..dd867165b4b40 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/tests/ConsumeEventTests.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/tests/ConsumeEventTests.cs @@ -31,91 +31,91 @@ public void ParsesEventGridEnvelope() Assert.AreEqual("1", egEvent.DataVersion); } - //[Test] - //public void ConsumeStorageBlobDeletedEventWithExtraProperty() - //{ - // string requestContent = "[{ \"topic\": \"/subscriptions/id/resourceGroups/Storage/providers/Microsoft.Storage/storageAccounts/xstoretestaccount\", \"subject\": \"/blobServices/default/containers/testcontainer/blobs/testfile.txt\", \"eventType\": \"Microsoft.Storage.BlobDeleted\", \"eventTime\": \"2017-11-07T20:09:22.5674003Z\", \"id\": \"4c2359fe-001e-00ba-0e04-58586806d298\", \"data\": { \"api\": \"DeleteBlob\", \"requestId\": \"4c2359fe-001e-00ba-0e04-585868000000\", \"contentType\": \"text/plain\", \"blobType\": \"BlockBlob\", \"url\": \"https://example.blob.core.windows.net/testcontainer/testfile.txt\", \"sequencer\": \"0000000000000281000000000002F5CA\", \"brandNewProperty\": \"0000000000000281000000000002F5CA\", \"storageDiagnostics\": { \"batchId\": \"b68529f3-68cd-4744-baa4-3c0498ec19f0\" } }, \"dataVersion\": \"\", \"metadataVersion\": \"1\"}]"; + [Test] + public void ConsumeStorageBlobDeletedEventWithExtraProperty() + { + string requestContent = "[{ \"topic\": \"/subscriptions/id/resourceGroups/Storage/providers/Microsoft.Storage/storageAccounts/xstoretestaccount\", \"subject\": \"/blobServices/default/containers/testcontainer/blobs/testfile.txt\", \"eventType\": \"Microsoft.Storage.BlobDeleted\", \"eventTime\": \"2017-11-07T20:09:22.5674003Z\", \"id\": \"4c2359fe-001e-00ba-0e04-58586806d298\", \"data\": { \"api\": \"DeleteBlob\", \"requestId\": \"4c2359fe-001e-00ba-0e04-585868000000\", \"contentType\": \"text/plain\", \"blobType\": \"BlockBlob\", \"url\": \"https://example.blob.core.windows.net/testcontainer/testfile.txt\", \"sequencer\": \"0000000000000281000000000002F5CA\", \"brandNewProperty\": \"0000000000000281000000000002F5CA\", \"storageDiagnostics\": { \"batchId\": \"b68529f3-68cd-4744-baa4-3c0498ec19f0\" } }, \"dataVersion\": \"\", \"metadataVersion\": \"1\"}]"; - // EventGridEvent[] events = EventGridEvent.Parse(requestContent); + EventGridEvent[] events = EventGridEvent.ParseEvents(requestContent); - // Assert.NotNull(events); - // foreach (EventGridEvent egEvent in events) - // { - // switch (egEvent.EventType) - // { - // case SystemEventNames.StorageBlobDeleted: - // StorageBlobDeletedEventData blobDeleted = egEvent.GetData(); - // Assert.AreEqual("https://example.blob.core.windows.net/testcontainer/testfile.txt", blobDeleted.Url); - // Assert.AreEqual("/subscriptions/id/resourceGroups/Storage/providers/Microsoft.Storage/storageAccounts/xstoretestaccount", egEvent.Topic); - // break; - // } - // } - //} + Assert.NotNull(events); + foreach (EventGridEvent egEvent in events) + { + switch (egEvent.EventType) + { + case SystemEventNames.StorageBlobDeleted: + StorageBlobDeletedEventData blobDeleted = egEvent.Data.ToObjectFromJson(); + Assert.AreEqual("https://example.blob.core.windows.net/testcontainer/testfile.txt", blobDeleted.Url); + Assert.AreEqual("/subscriptions/id/resourceGroups/Storage/providers/Microsoft.Storage/storageAccounts/xstoretestaccount", egEvent.Topic); + break; + } + } + } - //[Test] - //public void ConsumeEventNotWrappedInAnArray() - //{ - // string requestContent = "{ \"topic\": \"/subscriptions/id/resourceGroups/Storage/providers/Microsoft.Storage/storageAccounts/xstoretestaccount\", \"subject\": \"/blobServices/default/containers/testcontainer/blobs/testfile.txt\", \"eventType\": \"Microsoft.Storage.BlobDeleted\", \"eventTime\": \"2017-11-07T20:09:22.5674003Z\", \"id\": \"4c2359fe-001e-00ba-0e04-58586806d298\", \"data\": { \"api\": \"DeleteBlob\", \"requestId\": \"4c2359fe-001e-00ba-0e04-585868000000\", \"contentType\": \"text/plain\", \"blobType\": \"BlockBlob\", \"url\": \"https://example.blob.core.windows.net/testcontainer/testfile.txt\", \"sequencer\": \"0000000000000281000000000002F5CA\", \"brandNewProperty\": \"0000000000000281000000000002F5CA\", \"storageDiagnostics\": { \"batchId\": \"b68529f3-68cd-4744-baa4-3c0498ec19f0\" } }, \"dataVersion\": \"\", \"metadataVersion\": \"1\"}"; + [Test] + public void ConsumeEventNotWrappedInAnArray() + { + string requestContent = "{ \"topic\": \"/subscriptions/id/resourceGroups/Storage/providers/Microsoft.Storage/storageAccounts/xstoretestaccount\", \"subject\": \"/blobServices/default/containers/testcontainer/blobs/testfile.txt\", \"eventType\": \"Microsoft.Storage.BlobDeleted\", \"eventTime\": \"2017-11-07T20:09:22.5674003Z\", \"id\": \"4c2359fe-001e-00ba-0e04-58586806d298\", \"data\": { \"api\": \"DeleteBlob\", \"requestId\": \"4c2359fe-001e-00ba-0e04-585868000000\", \"contentType\": \"text/plain\", \"blobType\": \"BlockBlob\", \"url\": \"https://example.blob.core.windows.net/testcontainer/testfile.txt\", \"sequencer\": \"0000000000000281000000000002F5CA\", \"brandNewProperty\": \"0000000000000281000000000002F5CA\", \"storageDiagnostics\": { \"batchId\": \"b68529f3-68cd-4744-baa4-3c0498ec19f0\" } }, \"dataVersion\": \"\", \"metadataVersion\": \"1\"}"; - // EventGridEvent[] events = EventGridEvent.Parse(requestContent); + EventGridEvent[] events = EventGridEvent.ParseEvents(requestContent); - // Assert.NotNull(events); - // foreach (EventGridEvent egEvent in events) - // { - // switch (egEvent.EventType) - // { - // case SystemEventNames.StorageBlobDeleted: - // StorageBlobDeletedEventData blobDeleted = egEvent.GetData(); - // Assert.AreEqual("https://example.blob.core.windows.net/testcontainer/testfile.txt", blobDeleted.Url); - // break; - // } - // } - //} + Assert.NotNull(events); + foreach (EventGridEvent egEvent in events) + { + switch (egEvent.EventType) + { + case SystemEventNames.StorageBlobDeleted: + StorageBlobDeletedEventData blobDeleted = egEvent.Data.ToObjectFromJson(); + Assert.AreEqual("https://example.blob.core.windows.net/testcontainer/testfile.txt", blobDeleted.Url); + break; + } + } + } - //[Test] - //public void ConsumeMultipleEventsInSameBatch() - //{ - // string requestContent = "[ " + - // "{ \"topic\": \"/subscriptions/319a9601-1ec0-0000-aebc-8fe82724c81e/resourceGroups/testrg/providers/Microsoft.Storage/storageAccounts/myaccount\", \"subject\": \"/blobServices/default/containers/testcontainer/blobs/file1.txt\", \"eventType\": \"Microsoft.Storage.BlobCreated\", \"eventTime\": \"2017-08-16T01:57:26.005121Z\", \"id\": \"602a88ef-0001-00e6-1233-1646070610ea\", \"data\": { \"api\": \"PutBlockList\", \"clientRequestId\": \"799304a4-bbc5-45b6-9849-ec2c66be800a\", \"requestId\": \"602a88ef-0001-00e6-1233-164607000000\", \"eTag\": \"0x8D4E44A24ABE7F1\", \"contentType\": \"text/plain\", \"contentLength\": 447, \"blobType\": \"BlockBlob\", \"url\": \"https://myaccount.blob.core.windows.net/testcontainer/file1.txt\", \"sequencer\": \"00000000000000EB000000000000C65A\" }, \"dataVersion\": \"\", \"metadataVersion\": \"1\"}, " + - // "{ \"topic\": \"/subscriptions/id/resourceGroups/Storage/providers/Microsoft.Storage/storageAccounts/xstoretestaccount\", \"subject\": \"/blobServices/default/containers/testcontainer/blobs/testfile.txt\", \"eventType\": \"Microsoft.Storage.BlobDeleted\", \"eventTime\": \"2017-11-07T20:09:22.5674003Z\", \"id\": \"4c2359fe-001e-00ba-0e04-58586806d298\", \"data\": { \"api\": \"DeleteBlob\", \"requestId\": \"4c2359fe-001e-00ba-0e04-585868000000\", \"contentType\": \"text/plain\", \"blobType\": \"BlockBlob\", \"url\": \"https://example.blob.core.windows.net/testcontainer/testfile.txt\", \"sequencer\": \"0000000000000281000000000002F5CA\", \"storageDiagnostics\": { \"batchId\": \"b68529f3-68cd-4744-baa4-3c0498ec19f0\" } }, \"dataVersion\": \"\", \"metadataVersion\": \"1\"}, " + - // "{ \"topic\": \"/subscriptions/id/resourceGroups/Storage/providers/Microsoft.Storage/storageAccounts/xstoretestaccount\", \"subject\": \"/blobServices/default/containers/testcontainer/blobs/testfile.txt\", \"eventType\": \"Microsoft.Storage.BlobDeleted\", \"eventTime\": \"2017-11-07T20:09:22.5674003Z\", \"id\": \"4c2359fe-001e-00ba-0e04-58586806d298\", \"data\": { \"api\": \"DeleteBlob\", \"requestId\": \"4c2359fe-001e-00ba-0e04-585868000000\", \"contentType\": \"text/plain\", \"blobType\": \"BlockBlob\", \"url\": \"https://example.blob.core.windows.net/testcontainer/testfile.txt\", \"sequencer\": \"0000000000000281000000000002F5CA\", \"storageDiagnostics\": { \"batchId\": \"b68529f3-68cd-4744-baa4-3c0498ec19f0\" } }, \"dataVersion\": \"\", \"metadataVersion\": \"1\"}]"; + [Test] + public void ConsumeMultipleEventsInSameBatch() + { + string requestContent = "[ " + + "{ \"topic\": \"/subscriptions/319a9601-1ec0-0000-aebc-8fe82724c81e/resourceGroups/testrg/providers/Microsoft.Storage/storageAccounts/myaccount\", \"subject\": \"/blobServices/default/containers/testcontainer/blobs/file1.txt\", \"eventType\": \"Microsoft.Storage.BlobCreated\", \"eventTime\": \"2017-08-16T01:57:26.005121Z\", \"id\": \"602a88ef-0001-00e6-1233-1646070610ea\", \"data\": { \"api\": \"PutBlockList\", \"clientRequestId\": \"799304a4-bbc5-45b6-9849-ec2c66be800a\", \"requestId\": \"602a88ef-0001-00e6-1233-164607000000\", \"eTag\": \"0x8D4E44A24ABE7F1\", \"contentType\": \"text/plain\", \"contentLength\": 447, \"blobType\": \"BlockBlob\", \"url\": \"https://myaccount.blob.core.windows.net/testcontainer/file1.txt\", \"sequencer\": \"00000000000000EB000000000000C65A\" }, \"dataVersion\": \"\", \"metadataVersion\": \"1\"}, " + + "{ \"topic\": \"/subscriptions/id/resourceGroups/Storage/providers/Microsoft.Storage/storageAccounts/xstoretestaccount\", \"subject\": \"/blobServices/default/containers/testcontainer/blobs/testfile.txt\", \"eventType\": \"Microsoft.Storage.BlobDeleted\", \"eventTime\": \"2017-11-07T20:09:22.5674003Z\", \"id\": \"4c2359fe-001e-00ba-0e04-58586806d298\", \"data\": { \"api\": \"DeleteBlob\", \"requestId\": \"4c2359fe-001e-00ba-0e04-585868000000\", \"contentType\": \"text/plain\", \"blobType\": \"BlockBlob\", \"url\": \"https://example.blob.core.windows.net/testcontainer/testfile.txt\", \"sequencer\": \"0000000000000281000000000002F5CA\", \"storageDiagnostics\": { \"batchId\": \"b68529f3-68cd-4744-baa4-3c0498ec19f0\" } }, \"dataVersion\": \"\", \"metadataVersion\": \"1\"}, " + + "{ \"topic\": \"/subscriptions/id/resourceGroups/Storage/providers/Microsoft.Storage/storageAccounts/xstoretestaccount\", \"subject\": \"/blobServices/default/containers/testcontainer/blobs/testfile.txt\", \"eventType\": \"Microsoft.Storage.BlobDeleted\", \"eventTime\": \"2017-11-07T20:09:22.5674003Z\", \"id\": \"4c2359fe-001e-00ba-0e04-58586806d298\", \"data\": { \"api\": \"DeleteBlob\", \"requestId\": \"4c2359fe-001e-00ba-0e04-585868000000\", \"contentType\": \"text/plain\", \"blobType\": \"BlockBlob\", \"url\": \"https://example.blob.core.windows.net/testcontainer/testfile.txt\", \"sequencer\": \"0000000000000281000000000002F5CA\", \"storageDiagnostics\": { \"batchId\": \"b68529f3-68cd-4744-baa4-3c0498ec19f0\" } }, \"dataVersion\": \"\", \"metadataVersion\": \"1\"}]"; - // EventGridEvent[] events = EventGridEvent.Parse(requestContent); + EventGridEvent[] events = EventGridEvent.ParseEvents(requestContent); - // Assert.NotNull(events); - // Assert.AreEqual(3, events.Length); - // foreach (EventGridEvent egEvent in events) - // { - // switch (egEvent.EventType) - // { - // case SystemEventNames.StorageBlobCreated: - // StorageBlobCreatedEventData blobCreated = egEvent.GetData(); - // Assert.AreEqual("https://myaccount.blob.core.windows.net/testcontainer/file1.txt", blobCreated.Url); - // break; - // case SystemEventNames.StorageBlobDeleted: - // StorageBlobDeletedEventData blobDeleted = egEvent.GetData(); - // Assert.AreEqual("https://example.blob.core.windows.net/testcontainer/testfile.txt", blobDeleted.Url); - // break; - // } - // } - //} + Assert.NotNull(events); + Assert.AreEqual(3, events.Length); + foreach (EventGridEvent egEvent in events) + { + switch (egEvent.EventType) + { + case SystemEventNames.StorageBlobCreated: + StorageBlobCreatedEventData blobCreated = egEvent.Data.ToObjectFromJson(); + Assert.AreEqual("https://myaccount.blob.core.windows.net/testcontainer/file1.txt", blobCreated.Url); + break; + case SystemEventNames.StorageBlobDeleted: + StorageBlobDeletedEventData blobDeleted = egEvent.Data.ToObjectFromJson(); + Assert.AreEqual("https://example.blob.core.windows.net/testcontainer/testfile.txt", blobDeleted.Url); + break; + } + } + } - //[Test] - //public void ConsumeEventUsingBinaryDataExtensionMethod() - //{ - // BinaryData messageBody = new BinaryData("{ \"topic\": \"/subscriptions/id/resourceGroups/Storage/providers/Microsoft.Storage/storageAccounts/xstoretestaccount\", \"subject\": \"/blobServices/default/containers/testcontainer/blobs/testfile.txt\", \"eventType\": \"Microsoft.Storage.BlobDeleted\", \"eventTime\": \"2017-11-07T20:09:22.5674003Z\", \"id\": \"4c2359fe-001e-00ba-0e04-58586806d298\", \"data\": { \"api\": \"DeleteBlob\", \"requestId\": \"4c2359fe-001e-00ba-0e04-585868000000\", \"contentType\": \"text/plain\", \"blobType\": \"BlockBlob\", \"url\": \"https://example.blob.core.windows.net/testcontainer/testfile.txt\", \"sequencer\": \"0000000000000281000000000002F5CA\", \"brandNewProperty\": \"0000000000000281000000000002F5CA\", \"storageDiagnostics\": { \"batchId\": \"b68529f3-68cd-4744-baa4-3c0498ec19f0\" } }, \"dataVersion\": \"\", \"metadataVersion\": \"1\"}"); - - // EventGridEvent egEvent = messageBody.ToEventGridEvent(); - - // Assert.NotNull(egEvent); - // switch (egEvent.EventType) - // { - // case SystemEventNames.StorageBlobDeleted: - // StorageBlobDeletedEventData blobDeleted = egEvent.GetData(); - // Assert.AreEqual("https://example.blob.core.windows.net/testcontainer/testfile.txt", blobDeleted.Url); - // break; - // } - //} + [Test] + public void ConsumeEventUsingBinaryDataExtensionMethod() + { + BinaryData messageBody = new BinaryData("{ \"topic\": \"/subscriptions/id/resourceGroups/Storage/providers/Microsoft.Storage/storageAccounts/xstoretestaccount\", \"subject\": \"/blobServices/default/containers/testcontainer/blobs/testfile.txt\", \"eventType\": \"Microsoft.Storage.BlobDeleted\", \"eventTime\": \"2017-11-07T20:09:22.5674003Z\", \"id\": \"4c2359fe-001e-00ba-0e04-58586806d298\", \"data\": { \"api\": \"DeleteBlob\", \"requestId\": \"4c2359fe-001e-00ba-0e04-585868000000\", \"contentType\": \"text/plain\", \"blobType\": \"BlockBlob\", \"url\": \"https://example.blob.core.windows.net/testcontainer/testfile.txt\", \"sequencer\": \"0000000000000281000000000002F5CA\", \"brandNewProperty\": \"0000000000000281000000000002F5CA\", \"storageDiagnostics\": { \"batchId\": \"b68529f3-68cd-4744-baa4-3c0498ec19f0\" } }, \"dataVersion\": \"\", \"metadataVersion\": \"1\"}"); + + EventGridEvent egEvent = EventGridEvent.Parse(messageBody); + + Assert.NotNull(egEvent); + switch (egEvent.EventType) + { + case SystemEventNames.StorageBlobDeleted: + StorageBlobDeletedEventData blobDeleted = egEvent.Data.ToObjectFromJson(); + Assert.AreEqual("https://example.blob.core.windows.net/testcontainer/testfile.txt", blobDeleted.Url); + break; + } + } [Test] public void EGEventParseThrowsIfMissingRequiredProperties() @@ -1202,6 +1202,9 @@ public void ConsumeWebBackupOperationFailedEvent() Assert.NotNull(events); Assert.True(events[0].TryGetSystemEventData(out object eventData)); Assert.AreEqual(siteName, (eventData as WebBackupOperationFailedEventData).Name); + + var sysEvent = events[0].Data.ToObjectFromJson(); + Assert.AreEqual(siteName, sysEvent.Name); } [Test] @@ -1215,6 +1218,9 @@ public void ConsumeWebRestoreOperationStartedEvent() Assert.NotNull(events); Assert.True(events[0].TryGetSystemEventData(out object eventData)); Assert.AreEqual(siteName, (eventData as WebRestoreOperationStartedEventData).Name); + + var sysEvent = events[0].Data.ToObjectFromJson(); + Assert.AreEqual(siteName, sysEvent.Name); } [Test] @@ -1348,56 +1354,55 @@ public void ParsesCloudEventEnvelope() Assert.AreEqual("value", value); } - //[Test] - // TODO add back once https://github.com/Azure/autorest.csharp/issues/947 is fixed. - //public void ConsumeCloudEventsWithAdditionalProperties() - //{ - // string requestContent = "[{\"key\": \"value\", \"id\":\"994bc3f8-c90c-6fc3-9e83-6783db2221d5\",\"source\":\"Subject-0\", \"data\": { \"api\": \"DeleteBlob\", \"requestId\": \"4c2359fe-001e-00ba-0e04-585868000000\", \"contentType\": \"text/plain\", \"blobType\": \"BlockBlob\", \"url\": \"https://example.blob.core.windows.net/testcontainer/testfile.txt\", \"sequencer\": \"0000000000000281000000000002F5CA\", \"brandNewProperty\": \"0000000000000281000000000002F5CA\", \"storageDiagnostics\": { \"batchId\": \"b68529f3-68cd-4744-baa4-3c0498ec19f0\" } }, \"type\":\"Microsoft.Storage.BlobDeleted\",\"specversion\":\"1.0\"}]"; + [Test] + public void ConsumeCloudEventsWithAdditionalProperties() + { + string requestContent = "[{\"key\": \"value\", \"id\":\"994bc3f8-c90c-6fc3-9e83-6783db2221d5\",\"source\":\"Subject-0\", \"data\": { \"api\": \"DeleteBlob\", \"requestId\": \"4c2359fe-001e-00ba-0e04-585868000000\", \"contentType\": \"text/plain\", \"blobType\": \"BlockBlob\", \"url\": \"https://example.blob.core.windows.net/testcontainer/testfile.txt\", \"sequencer\": \"0000000000000281000000000002F5CA\", \"brandNewProperty\": \"0000000000000281000000000002F5CA\", \"storageDiagnostics\": { \"batchId\": \"b68529f3-68cd-4744-baa4-3c0498ec19f0\" } }, \"type\":\"Microsoft.Storage.BlobDeleted\",\"specversion\":\"1.0\"}]"; - // CloudEvent[] events = CloudEvent.Parse(requestContent); - // Assert.NotNull(events); + CloudEvent[] events = CloudEvent.ParseEvents(requestContent); + Assert.NotNull(events); - // if (events[0].Type == SystemEventNames.StorageBlobDeleted) - // { - // StorageBlobDeletedEventData eventData = events[0].EventData.ToObjectFromJson(); - // Assert.AreEqual("https://example.blob.core.windows.net/testcontainer/testfile.txt", eventData.Url); - // } + if (events[0].Type == SystemEventNames.StorageBlobDeleted) + { + StorageBlobDeletedEventData eventData = events[0].Data.ToObjectFromJson(); + Assert.AreEqual("https://example.blob.core.windows.net/testcontainer/testfile.txt", eventData.Url); + } - // events[0].ExtensionAttributes.TryGetValue("key", out var value); - // Assert.AreEqual("value", value); - //} + events[0].ExtensionAttributes.TryGetValue("key", out var value); + Assert.AreEqual("value", value); + } - //[Test] - //public void ConsumeCloudEventUsingBinaryDataExtensionMethod() - //{ - // BinaryData messageBody = new BinaryData("{ \"source\": \"/subscriptions/id/resourceGroups/Storage/providers/Microsoft.Storage/storageAccounts/xstoretestaccount\", \"subject\": \"/blobServices/default/containers/testcontainer/blobs/testfile.txt\", \"type\": \"Microsoft.Storage.BlobDeleted\", \"time\": \"2017-11-07T20:09:22.5674003Z\", \"id\": \"4c2359fe-001e-00ba-0e04-58586806d298\", \"data\": { \"api\": \"DeleteBlob\", \"requestId\": \"4c2359fe-001e-00ba-0e04-585868000000\", \"contentType\": \"text/plain\", \"blobType\": \"BlockBlob\", \"url\": \"https://example.blob.core.windows.net/testcontainer/testfile.txt\", \"sequencer\": \"0000000000000281000000000002F5CA\", \"brandNewProperty\": \"0000000000000281000000000002F5CA\", \"storageDiagnostics\": { \"batchId\": \"b68529f3-68cd-4744-baa4-3c0498ec19f0\" } }}"); - - // CloudEvent cloudEvent = messageBody.ToCloudEvent(); - - // Assert.NotNull(cloudEvent); - // switch (cloudEvent.Type) - // { - // case SystemEventNames.StorageBlobDeleted: - // StorageBlobDeletedEventData blobDeleted =cloudEvent.EventData.ToObjectFromJson(); - // Assert.AreEqual("https://example.blob.core.windows.net/testcontainer/testfile.txt", blobDeleted.Url); - // break; - // } - //} + [Test] + public void ConsumeCloudEventUsingBinaryDataExtensionMethod() + { + BinaryData messageBody = new BinaryData("{ \"source\": \"/subscriptions/id/resourceGroups/Storage/providers/Microsoft.Storage/storageAccounts/xstoretestaccount\", \"subject\": \"/blobServices/default/containers/testcontainer/blobs/testfile.txt\", \"type\": \"Microsoft.Storage.BlobDeleted\", \"time\": \"2017-11-07T20:09:22.5674003Z\", \"id\": \"4c2359fe-001e-00ba-0e04-58586806d298\", \"data\": { \"api\": \"DeleteBlob\", \"requestId\": \"4c2359fe-001e-00ba-0e04-585868000000\", \"contentType\": \"text/plain\", \"blobType\": \"BlockBlob\", \"url\": \"https://example.blob.core.windows.net/testcontainer/testfile.txt\", \"sequencer\": \"0000000000000281000000000002F5CA\", \"brandNewProperty\": \"0000000000000281000000000002F5CA\", \"storageDiagnostics\": { \"batchId\": \"b68529f3-68cd-4744-baa4-3c0498ec19f0\" } }}"); - //[Test] - //public void ConsumeCloudEventNotWrappedInAnArray() - //{ - // string requestContent = "{ \"source\": \"/subscriptions/id/resourceGroups/Storage/providers/Microsoft.Storage/storageAccounts/xstoretestaccount\", \"subject\": \"/blobServices/default/containers/testcontainer/blobs/testfile.txt\", \"type\": \"Microsoft.Storage.BlobDeleted\", \"time\": \"2017-11-07T20:09:22.5674003Z\", \"id\": \"4c2359fe-001e-00ba-0e04-58586806d298\", \"data\": { \"api\": \"DeleteBlob\", \"requestId\": \"4c2359fe-001e-00ba-0e04-585868000000\", \"contentType\": \"text/plain\", \"blobType\": \"BlockBlob\", \"url\": \"https://example.blob.core.windows.net/testcontainer/testfile.txt\", \"sequencer\": \"0000000000000281000000000002F5CA\", \"brandNewProperty\": \"0000000000000281000000000002F5CA\", \"storageDiagnostics\": { \"batchId\": \"b68529f3-68cd-4744-baa4-3c0498ec19f0\" } }}"; + CloudEvent cloudEvent = CloudEvent.Parse(messageBody, skipValidation: true); - // CloudEvent[] events = CloudEvent.Parse(requestContent); + Assert.NotNull(cloudEvent); + switch (cloudEvent.Type) + { + case SystemEventNames.StorageBlobDeleted: + StorageBlobDeletedEventData blobDeleted = cloudEvent.Data.ToObjectFromJson(); + Assert.AreEqual("https://example.blob.core.windows.net/testcontainer/testfile.txt", blobDeleted.Url); + break; + } + } - // Assert.NotNull(events); - // if (events[0].Type == SystemEventNames.StorageBlobDeleted) - // { - // StorageBlobDeletedEventData eventData = events[0].EventData.ToObjectFromJson(); - // Assert.AreEqual("https://example.blob.core.windows.net/testcontainer/testfile.txt", eventData.Url); - // } - //} + [Test] + public void ConsumeCloudEventNotWrappedInAnArray() + { + string requestContent = "{ \"source\": \"/subscriptions/id/resourceGroups/Storage/providers/Microsoft.Storage/storageAccounts/xstoretestaccount\", \"subject\": \"/blobServices/default/containers/testcontainer/blobs/testfile.txt\", \"type\": \"Microsoft.Storage.BlobDeleted\", \"time\": \"2017-11-07T20:09:22.5674003Z\", \"id\": \"4c2359fe-001e-00ba-0e04-58586806d298\", \"data\": { \"api\": \"DeleteBlob\", \"requestId\": \"4c2359fe-001e-00ba-0e04-585868000000\", \"contentType\": \"text/plain\", \"blobType\": \"BlockBlob\", \"url\": \"https://example.blob.core.windows.net/testcontainer/testfile.txt\", \"sequencer\": \"0000000000000281000000000002F5CA\", \"brandNewProperty\": \"0000000000000281000000000002F5CA\", \"storageDiagnostics\": { \"batchId\": \"b68529f3-68cd-4744-baa4-3c0498ec19f0\" } }}"; + + CloudEvent[] events = CloudEvent.ParseEvents(requestContent, skipValidation: true); + + Assert.NotNull(events); + if (events[0].Type == SystemEventNames.StorageBlobDeleted) + { + StorageBlobDeletedEventData eventData = events[0].Data.ToObjectFromJson(); + Assert.AreEqual("https://example.blob.core.windows.net/testcontainer/testfile.txt", eventData.Url); + } + } [Test] public void ConsumeMultipleCloudEventsInSameBatch() @@ -1566,6 +1571,9 @@ public void ConsumeCloudEventAppConfigurationKeyValueDeletedEvent() Assert.NotNull(events); Assert.True(events[0].TryGetSystemEventData(out object eventData)); Assert.AreEqual("key1", (eventData as AppConfigurationKeyValueDeletedEventData).Key); + + var sysEvent = events[0].Data.ToObjectFromJson(); + Assert.AreEqual("key1", sysEvent.Key); } [Test] @@ -1577,6 +1585,9 @@ public void ConsumeCloudEventAppConfigurationKeyValueModifiedEvent() Assert.NotNull(events); Assert.True(events[0].TryGetSystemEventData(out object eventData)); Assert.AreEqual("key1", (eventData as AppConfigurationKeyValueModifiedEventData).Key); + + var sysEvent = events[0].Data.ToObjectFromJson(); + Assert.AreEqual("key1", sysEvent.Key); } #endregion @@ -1591,6 +1602,9 @@ public void ConsumeCloudEventContainerRegistryImagePushedEvent() Assert.NotNull(events); Assert.True(events[0].TryGetSystemEventData(out object eventData)); Assert.AreEqual("127.0.0.1", (eventData as ContainerRegistryImagePushedEventData).Request.Addr); + + var sysEvent = events[0].Data.ToObjectFromJson(); + Assert.AreEqual("127.0.0.1", sysEvent.Request.Addr); } [Test] @@ -1603,6 +1617,9 @@ public void ConsumeCloudEventContainerRegistryImageDeletedEvent() Assert.NotNull(events); Assert.True(events[0].TryGetSystemEventData(out object eventData)); Assert.AreEqual("testactor", (eventData as ContainerRegistryImageDeletedEventData).Actor.Name); + + var sysEvent = events[0].Data.ToObjectFromJson(); + Assert.AreEqual("testactor", sysEvent.Actor.Name); } [Test]