diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventBaseProperties.Serialization.cs
deleted file mode 100644
index 172820121300..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventBaseProperties.Serialization.cs
+++ /dev/null
@@ -1,164 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- public partial class AcsChatEventBaseProperties : IUtf8JsonSerializable, IJsonModel
- {
- void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
-
- void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- writer.WriteStartObject();
- JsonModelWriteCore(writer, options);
- writer.WriteEndObject();
- }
-
- /// The JSON writer.
- /// The client options for reading and writing models.
- protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatEventBaseProperties)} does not support writing '{format}' format.");
- }
-
- writer.WritePropertyName("recipientCommunicationIdentifier"u8);
- writer.WriteObjectValue(RecipientCommunicationIdentifier, options);
- if (Optional.IsDefined(TransactionId))
- {
- writer.WritePropertyName("transactionId"u8);
- writer.WriteStringValue(TransactionId);
- }
- if (Optional.IsDefined(ThreadId))
- {
- writer.WritePropertyName("threadId"u8);
- writer.WriteStringValue(ThreadId);
- }
- if (options.Format != "W" && _serializedAdditionalRawData != null)
- {
- foreach (var item in _serializedAdditionalRawData)
- {
- writer.WritePropertyName(item.Key);
-#if NET6_0_OR_GREATER
- writer.WriteRawValue(item.Value);
-#else
- using (JsonDocument document = JsonDocument.Parse(item.Value))
- {
- JsonSerializer.Serialize(writer, document.RootElement);
- }
-#endif
- }
- }
- }
-
- AcsChatEventBaseProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatEventBaseProperties)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeAcsChatEventBaseProperties(document.RootElement, options);
- }
-
- internal static AcsChatEventBaseProperties DeserializeAcsChatEventBaseProperties(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- CommunicationIdentifierModel recipientCommunicationIdentifier = default;
- string transactionId = default;
- string threadId = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("recipientCommunicationIdentifier"u8))
- {
- recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options);
- continue;
- }
- if (property.NameEquals("transactionId"u8))
- {
- transactionId = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("threadId"u8))
- {
- threadId = property.Value.GetString();
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new AcsChatEventBaseProperties(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData);
- }
-
- BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- return ModelReaderWriter.Write(this, options);
- default:
- throw new FormatException($"The model {nameof(AcsChatEventBaseProperties)} does not support writing '{options.Format}' format.");
- }
- }
-
- AcsChatEventBaseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeAcsChatEventBaseProperties(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(AcsChatEventBaseProperties)} does not support reading '{options.Format}' format.");
- }
- }
-
- string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
-
- /// Deserializes the model from a raw response.
- /// The response to deserialize the model from.
- internal static AcsChatEventBaseProperties FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeAcsChatEventBaseProperties(document.RootElement);
- }
-
- /// Convert into a .
- internal virtual RequestContent ToRequestContent()
- {
- var content = new Utf8JsonRequestContent();
- content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
- return content;
- }
- }
-}
diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventBaseProperties.cs
deleted file mode 100644
index ab0c02f851ba..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventBaseProperties.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- /// Schema of common properties of all chat events.
- public partial class AcsChatEventBaseProperties
- {
- ///
- /// Keeps track of any properties unknown to the library.
- ///
- /// To assign an object to the value of this property use .
- ///
- ///
- /// To assign an already formatted json string to this property use .
- ///
- ///
- /// Examples:
- ///
- /// -
- /// BinaryData.FromObjectAsJson("foo")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromString("\"foo\"")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromObjectAsJson(new { key = "value" })
- /// Creates a payload of { "key": "value" }.
- ///
- /// -
- /// BinaryData.FromString("{\"key\": \"value\"}")
- /// Creates a payload of { "key": "value" }.
- ///
- ///
- ///
- ///
- private protected IDictionary _serializedAdditionalRawData;
-
- /// Initializes a new instance of .
- /// The communication identifier of the target user.
- /// is null.
- internal AcsChatEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier)
- {
- Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier));
-
- RecipientCommunicationIdentifier = recipientCommunicationIdentifier;
- }
-
- /// Initializes a new instance of .
- /// The communication identifier of the target user.
- /// The transaction id will be used as co-relation vector.
- /// The chat thread id.
- /// Keeps track of any properties unknown to the library.
- internal AcsChatEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData)
- {
- RecipientCommunicationIdentifier = recipientCommunicationIdentifier;
- TransactionId = transactionId;
- ThreadId = threadId;
- _serializedAdditionalRawData = serializedAdditionalRawData;
- }
-
- /// Initializes a new instance of for deserialization.
- internal AcsChatEventBaseProperties()
- {
- }
-
- /// 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.
- public string ThreadId { get; }
- }
-}
diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventInThreadBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventInThreadBaseProperties.Serialization.cs
deleted file mode 100644
index 8c1f443284ad..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventInThreadBaseProperties.Serialization.cs
+++ /dev/null
@@ -1,156 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- public partial class AcsChatEventInThreadBaseProperties : IUtf8JsonSerializable, IJsonModel
- {
- void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
-
- void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- writer.WriteStartObject();
- JsonModelWriteCore(writer, options);
- writer.WriteEndObject();
- }
-
- /// The JSON writer.
- /// The client options for reading and writing models.
- protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatEventInThreadBaseProperties)} does not support writing '{format}' format.");
- }
-
- if (Optional.IsDefined(TransactionId))
- {
- writer.WritePropertyName("transactionId"u8);
- writer.WriteStringValue(TransactionId);
- }
- if (Optional.IsDefined(ThreadId))
- {
- writer.WritePropertyName("threadId"u8);
- writer.WriteStringValue(ThreadId);
- }
- if (options.Format != "W" && _serializedAdditionalRawData != null)
- {
- foreach (var item in _serializedAdditionalRawData)
- {
- writer.WritePropertyName(item.Key);
-#if NET6_0_OR_GREATER
- writer.WriteRawValue(item.Value);
-#else
- using (JsonDocument document = JsonDocument.Parse(item.Value))
- {
- JsonSerializer.Serialize(writer, document.RootElement);
- }
-#endif
- }
- }
- }
-
- AcsChatEventInThreadBaseProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatEventInThreadBaseProperties)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeAcsChatEventInThreadBaseProperties(document.RootElement, options);
- }
-
- internal static AcsChatEventInThreadBaseProperties DeserializeAcsChatEventInThreadBaseProperties(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- string transactionId = default;
- string threadId = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("transactionId"u8))
- {
- transactionId = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("threadId"u8))
- {
- threadId = property.Value.GetString();
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new AcsChatEventInThreadBaseProperties(transactionId, threadId, serializedAdditionalRawData);
- }
-
- BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- return ModelReaderWriter.Write(this, options);
- default:
- throw new FormatException($"The model {nameof(AcsChatEventInThreadBaseProperties)} does not support writing '{options.Format}' format.");
- }
- }
-
- AcsChatEventInThreadBaseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeAcsChatEventInThreadBaseProperties(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(AcsChatEventInThreadBaseProperties)} does not support reading '{options.Format}' format.");
- }
- }
-
- string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
-
- /// Deserializes the model from a raw response.
- /// The response to deserialize the model from.
- internal static AcsChatEventInThreadBaseProperties FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeAcsChatEventInThreadBaseProperties(document.RootElement);
- }
-
- /// Convert into a .
- internal virtual RequestContent ToRequestContent()
- {
- var content = new Utf8JsonRequestContent();
- content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
- return content;
- }
- }
-}
diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventInThreadBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventInThreadBaseProperties.cs
deleted file mode 100644
index a19356f6f111..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatEventInThreadBaseProperties.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- /// Schema of common properties of all thread-level chat events.
- public partial class AcsChatEventInThreadBaseProperties
- {
- ///
- /// Keeps track of any properties unknown to the library.
- ///
- /// To assign an object to the value of this property use .
- ///
- ///
- /// To assign an already formatted json string to this property use .
- ///
- ///
- /// Examples:
- ///
- /// -
- /// BinaryData.FromObjectAsJson("foo")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromString("\"foo\"")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromObjectAsJson(new { key = "value" })
- /// Creates a payload of { "key": "value" }.
- ///
- /// -
- /// BinaryData.FromString("{\"key\": \"value\"}")
- /// Creates a payload of { "key": "value" }.
- ///
- ///
- ///
- ///
- private protected IDictionary _serializedAdditionalRawData;
-
- /// Initializes a new instance of .
- internal AcsChatEventInThreadBaseProperties()
- {
- }
-
- /// Initializes a new instance of .
- /// The transaction id will be used as co-relation vector.
- /// The chat thread id.
- /// Keeps track of any properties unknown to the library.
- internal AcsChatEventInThreadBaseProperties(string transactionId, string threadId, IDictionary serializedAdditionalRawData)
- {
- TransactionId = transactionId;
- ThreadId = threadId;
- _serializedAdditionalRawData = serializedAdditionalRawData;
- }
-
- /// The transaction id will be used as co-relation vector.
- public string TransactionId { get; }
- /// The chat thread id.
- public string ThreadId { get; }
- }
-}
diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.Serialization.cs
deleted file mode 100644
index a4aae168de79..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.Serialization.cs
+++ /dev/null
@@ -1,197 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- public partial class AcsChatMessageDeletedEventData : IUtf8JsonSerializable, IJsonModel
- {
- void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
-
- void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- writer.WriteStartObject();
- JsonModelWriteCore(writer, options);
- writer.WriteEndObject();
- }
-
- /// The JSON writer.
- /// The client options for reading and writing models.
- protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatMessageDeletedEventData)} does not support writing '{format}' format.");
- }
-
- base.JsonModelWriteCore(writer, options);
- writer.WritePropertyName("deleteTime"u8);
- writer.WriteStringValue(DeleteTime, "O");
- }
-
- AcsChatMessageDeletedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatMessageDeletedEventData)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeAcsChatMessageDeletedEventData(document.RootElement, options);
- }
-
- internal static AcsChatMessageDeletedEventData DeserializeAcsChatMessageDeletedEventData(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- DateTimeOffset deleteTime = default;
- string messageId = default;
- CommunicationIdentifierModel senderCommunicationIdentifier = default;
- string senderDisplayName = default;
- DateTimeOffset composeTime = default;
- string type = default;
- long? version = default;
- CommunicationIdentifierModel recipientCommunicationIdentifier = default;
- string transactionId = default;
- string threadId = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("deleteTime"u8))
- {
- deleteTime = property.Value.GetDateTimeOffset("O");
- continue;
- }
- if (property.NameEquals("messageId"u8))
- {
- messageId = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("senderCommunicationIdentifier"u8))
- {
- senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options);
- continue;
- }
- if (property.NameEquals("senderDisplayName"u8))
- {
- senderDisplayName = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("composeTime"u8))
- {
- composeTime = property.Value.GetDateTimeOffset("O");
- continue;
- }
- if (property.NameEquals("type"u8))
- {
- type = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("version"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- version = property.Value.GetInt64();
- continue;
- }
- if (property.NameEquals("recipientCommunicationIdentifier"u8))
- {
- recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options);
- continue;
- }
- if (property.NameEquals("transactionId"u8))
- {
- transactionId = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("threadId"u8))
- {
- threadId = property.Value.GetString();
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new AcsChatMessageDeletedEventData(
- recipientCommunicationIdentifier,
- transactionId,
- threadId,
- serializedAdditionalRawData,
- messageId,
- senderCommunicationIdentifier,
- senderDisplayName,
- composeTime,
- type,
- version,
- deleteTime);
- }
-
- BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- return ModelReaderWriter.Write(this, options);
- default:
- throw new FormatException($"The model {nameof(AcsChatMessageDeletedEventData)} does not support writing '{options.Format}' format.");
- }
- }
-
- AcsChatMessageDeletedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeAcsChatMessageDeletedEventData(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(AcsChatMessageDeletedEventData)} does not support reading '{options.Format}' format.");
- }
- }
-
- string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
-
- /// Deserializes the model from a raw response.
- /// The response to deserialize the model from.
- internal static new AcsChatMessageDeletedEventData FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeAcsChatMessageDeletedEventData(document.RootElement);
- }
-
- /// Convert into a .
- internal override RequestContent ToRequestContent()
- {
- var content = new Utf8JsonRequestContent();
- content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
- return content;
- }
- }
-}
diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.cs
deleted file mode 100644
index 29bd2123a788..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedEventData.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageDeleted event.
- public partial class AcsChatMessageDeletedEventData : AcsChatMessageEventBaseProperties
- {
- /// Initializes a new instance of .
- /// The communication identifier of the target user.
- /// The communication identifier of the sender.
- /// The original compose time of the message.
- /// The time at which the message was deleted.
- /// or is null.
- internal AcsChatMessageDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime, DateTimeOffset deleteTime) : base(recipientCommunicationIdentifier, senderCommunicationIdentifier, composeTime)
- {
- Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier));
- Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier));
-
- DeleteTime = deleteTime;
- }
-
- /// Initializes a new instance of .
- /// The communication identifier of the target user.
- /// The transaction id will be used as co-relation vector.
- /// The chat thread id.
- /// Keeps track of any properties unknown to the library.
- /// 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 AcsChatMessageDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset composeTime, string type, long? version, DateTimeOffset deleteTime) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version)
- {
- DeleteTime = deleteTime;
- }
-
- /// Initializes a new instance of for deserialization.
- internal AcsChatMessageDeletedEventData()
- {
- }
-
- /// The time at which the message was deleted.
- public DateTimeOffset DeleteTime { get; }
- }
-}
diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.Serialization.cs
deleted file mode 100644
index bceef0c48673..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.Serialization.cs
+++ /dev/null
@@ -1,190 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- public partial class AcsChatMessageDeletedInThreadEventData : IUtf8JsonSerializable, IJsonModel
- {
- void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
-
- void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- writer.WriteStartObject();
- JsonModelWriteCore(writer, options);
- writer.WriteEndObject();
- }
-
- /// The JSON writer.
- /// The client options for reading and writing models.
- protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatMessageDeletedInThreadEventData)} does not support writing '{format}' format.");
- }
-
- base.JsonModelWriteCore(writer, options);
- writer.WritePropertyName("deleteTime"u8);
- writer.WriteStringValue(DeleteTime, "O");
- }
-
- AcsChatMessageDeletedInThreadEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatMessageDeletedInThreadEventData)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeAcsChatMessageDeletedInThreadEventData(document.RootElement, options);
- }
-
- internal static AcsChatMessageDeletedInThreadEventData DeserializeAcsChatMessageDeletedInThreadEventData(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- DateTimeOffset deleteTime = default;
- string messageId = default;
- CommunicationIdentifierModel senderCommunicationIdentifier = default;
- string senderDisplayName = default;
- DateTimeOffset composeTime = default;
- string type = default;
- long? version = default;
- string transactionId = default;
- string threadId = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("deleteTime"u8))
- {
- deleteTime = property.Value.GetDateTimeOffset("O");
- continue;
- }
- if (property.NameEquals("messageId"u8))
- {
- messageId = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("senderCommunicationIdentifier"u8))
- {
- senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options);
- continue;
- }
- if (property.NameEquals("senderDisplayName"u8))
- {
- senderDisplayName = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("composeTime"u8))
- {
- composeTime = property.Value.GetDateTimeOffset("O");
- continue;
- }
- if (property.NameEquals("type"u8))
- {
- type = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("version"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- version = property.Value.GetInt64();
- continue;
- }
- if (property.NameEquals("transactionId"u8))
- {
- transactionId = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("threadId"u8))
- {
- threadId = property.Value.GetString();
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new AcsChatMessageDeletedInThreadEventData(
- transactionId,
- threadId,
- serializedAdditionalRawData,
- messageId,
- senderCommunicationIdentifier,
- senderDisplayName,
- composeTime,
- type,
- version,
- deleteTime);
- }
-
- BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- return ModelReaderWriter.Write(this, options);
- default:
- throw new FormatException($"The model {nameof(AcsChatMessageDeletedInThreadEventData)} does not support writing '{options.Format}' format.");
- }
- }
-
- AcsChatMessageDeletedInThreadEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeAcsChatMessageDeletedInThreadEventData(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(AcsChatMessageDeletedInThreadEventData)} does not support reading '{options.Format}' format.");
- }
- }
-
- string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
-
- /// Deserializes the model from a raw response.
- /// The response to deserialize the model from.
- internal static new AcsChatMessageDeletedInThreadEventData FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeAcsChatMessageDeletedInThreadEventData(document.RootElement);
- }
-
- /// Convert into a .
- internal override RequestContent ToRequestContent()
- {
- var content = new Utf8JsonRequestContent();
- content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
- return content;
- }
- }
-}
diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.cs
deleted file mode 100644
index fdf50c683027..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageDeletedInThreadEventData.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageDeletedInThread event.
- public partial class AcsChatMessageDeletedInThreadEventData : AcsChatMessageEventInThreadBaseProperties
- {
- /// Initializes a new instance of .
- /// The communication identifier of the sender.
- /// The original compose time of the message.
- /// The time at which the message was deleted.
- /// is null.
- internal AcsChatMessageDeletedInThreadEventData(CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime, DateTimeOffset deleteTime) : base(senderCommunicationIdentifier, composeTime)
- {
- Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier));
-
- DeleteTime = deleteTime;
- }
-
- /// Initializes a new instance of .
- /// The transaction id will be used as co-relation vector.
- /// The chat thread id.
- /// Keeps track of any properties unknown to the library.
- /// 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 transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset composeTime, string type, long? version, DateTimeOffset deleteTime) : base(transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version)
- {
- DeleteTime = deleteTime;
- }
-
- /// Initializes a new instance of for deserialization.
- internal AcsChatMessageDeletedInThreadEventData()
- {
- }
-
- /// The time at which the message was deleted.
- public DateTimeOffset DeleteTime { get; }
- }
-}
diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.Serialization.cs
deleted file mode 100644
index 97ee30c1867a..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.Serialization.cs
+++ /dev/null
@@ -1,229 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- public partial class AcsChatMessageEditedEventData : IUtf8JsonSerializable, IJsonModel
- {
- void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
-
- void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- writer.WriteStartObject();
- JsonModelWriteCore(writer, options);
- writer.WriteEndObject();
- }
-
- /// The JSON writer.
- /// The client options for reading and writing models.
- protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatMessageEditedEventData)} does not support writing '{format}' format.");
- }
-
- base.JsonModelWriteCore(writer, options);
- if (Optional.IsDefined(MessageBody))
- {
- writer.WritePropertyName("messageBody"u8);
- writer.WriteStringValue(MessageBody);
- }
- writer.WritePropertyName("metadata"u8);
- writer.WriteStartObject();
- foreach (var item in Metadata)
- {
- writer.WritePropertyName(item.Key);
- writer.WriteStringValue(item.Value);
- }
- writer.WriteEndObject();
- writer.WritePropertyName("editTime"u8);
- writer.WriteStringValue(EditTime, "O");
- }
-
- AcsChatMessageEditedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatMessageEditedEventData)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeAcsChatMessageEditedEventData(document.RootElement, options);
- }
-
- internal static AcsChatMessageEditedEventData DeserializeAcsChatMessageEditedEventData(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- string messageBody = default;
- IReadOnlyDictionary metadata = default;
- DateTimeOffset editTime = default;
- string messageId = default;
- CommunicationIdentifierModel senderCommunicationIdentifier = default;
- string senderDisplayName = default;
- DateTimeOffset composeTime = default;
- string type = default;
- long? version = default;
- CommunicationIdentifierModel recipientCommunicationIdentifier = default;
- string transactionId = default;
- string threadId = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("messageBody"u8))
- {
- messageBody = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("metadata"u8))
- {
- Dictionary dictionary = new Dictionary();
- foreach (var property0 in property.Value.EnumerateObject())
- {
- dictionary.Add(property0.Name, property0.Value.GetString());
- }
- metadata = dictionary;
- continue;
- }
- if (property.NameEquals("editTime"u8))
- {
- editTime = property.Value.GetDateTimeOffset("O");
- continue;
- }
- if (property.NameEquals("messageId"u8))
- {
- messageId = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("senderCommunicationIdentifier"u8))
- {
- senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options);
- continue;
- }
- if (property.NameEquals("senderDisplayName"u8))
- {
- senderDisplayName = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("composeTime"u8))
- {
- composeTime = property.Value.GetDateTimeOffset("O");
- continue;
- }
- if (property.NameEquals("type"u8))
- {
- type = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("version"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- version = property.Value.GetInt64();
- continue;
- }
- if (property.NameEquals("recipientCommunicationIdentifier"u8))
- {
- recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options);
- continue;
- }
- if (property.NameEquals("transactionId"u8))
- {
- transactionId = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("threadId"u8))
- {
- threadId = property.Value.GetString();
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new AcsChatMessageEditedEventData(
- recipientCommunicationIdentifier,
- transactionId,
- threadId,
- serializedAdditionalRawData,
- messageId,
- senderCommunicationIdentifier,
- senderDisplayName,
- composeTime,
- type,
- version,
- messageBody,
- metadata,
- editTime);
- }
-
- BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- return ModelReaderWriter.Write(this, options);
- default:
- throw new FormatException($"The model {nameof(AcsChatMessageEditedEventData)} does not support writing '{options.Format}' format.");
- }
- }
-
- AcsChatMessageEditedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeAcsChatMessageEditedEventData(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(AcsChatMessageEditedEventData)} does not support reading '{options.Format}' format.");
- }
- }
-
- string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
-
- /// Deserializes the model from a raw response.
- /// The response to deserialize the model from.
- internal static new AcsChatMessageEditedEventData FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeAcsChatMessageEditedEventData(document.RootElement);
- }
-
- /// Convert into a .
- internal override RequestContent ToRequestContent()
- {
- var content = new Utf8JsonRequestContent();
- content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
- return content;
- }
- }
-}
diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.cs
deleted file mode 100644
index 92f3f537ac6c..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedEventData.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageEdited event.
- public partial class AcsChatMessageEditedEventData : AcsChatMessageEventBaseProperties
- {
- /// Initializes a new instance of .
- /// The communication identifier of the target user.
- /// The communication identifier of the sender.
- /// The original compose time of the message.
- /// The chat message metadata.
- /// The time at which the message was edited.
- /// , or is null.
- internal AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime, IReadOnlyDictionary metadata, DateTimeOffset editTime) : base(recipientCommunicationIdentifier, senderCommunicationIdentifier, composeTime)
- {
- Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier));
- Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier));
- Argument.AssertNotNull(metadata, nameof(metadata));
-
- Metadata = metadata;
- EditTime = editTime;
- }
-
- /// Initializes a new instance of .
- /// The communication identifier of the target user.
- /// The transaction id will be used as co-relation vector.
- /// The chat thread id.
- /// Keeps track of any properties unknown to the library.
- /// 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 chat message metadata.
- /// The time at which the message was edited.
- internal AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset composeTime, string type, long? version, string messageBody, IReadOnlyDictionary metadata, DateTimeOffset editTime) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version)
- {
- MessageBody = messageBody;
- Metadata = metadata;
- EditTime = editTime;
- }
-
- /// Initializes a new instance of for deserialization.
- internal AcsChatMessageEditedEventData()
- {
- }
-
- /// The body of the chat message.
- public string MessageBody { get; }
- /// The chat message metadata.
- public IReadOnlyDictionary Metadata { get; }
- /// The time at which the message was edited.
- public DateTimeOffset EditTime { get; }
- }
-}
diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.Serialization.cs
deleted file mode 100644
index 7bf5019d2ec1..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.Serialization.cs
+++ /dev/null
@@ -1,222 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- public partial class AcsChatMessageEditedInThreadEventData : IUtf8JsonSerializable, IJsonModel
- {
- void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
-
- void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- writer.WriteStartObject();
- JsonModelWriteCore(writer, options);
- writer.WriteEndObject();
- }
-
- /// The JSON writer.
- /// The client options for reading and writing models.
- protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatMessageEditedInThreadEventData)} does not support writing '{format}' format.");
- }
-
- base.JsonModelWriteCore(writer, options);
- if (Optional.IsDefined(MessageBody))
- {
- writer.WritePropertyName("messageBody"u8);
- writer.WriteStringValue(MessageBody);
- }
- writer.WritePropertyName("metadata"u8);
- writer.WriteStartObject();
- foreach (var item in Metadata)
- {
- writer.WritePropertyName(item.Key);
- writer.WriteStringValue(item.Value);
- }
- writer.WriteEndObject();
- writer.WritePropertyName("editTime"u8);
- writer.WriteStringValue(EditTime, "O");
- }
-
- AcsChatMessageEditedInThreadEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatMessageEditedInThreadEventData)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeAcsChatMessageEditedInThreadEventData(document.RootElement, options);
- }
-
- internal static AcsChatMessageEditedInThreadEventData DeserializeAcsChatMessageEditedInThreadEventData(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- string messageBody = default;
- IReadOnlyDictionary metadata = default;
- DateTimeOffset editTime = default;
- string messageId = default;
- CommunicationIdentifierModel senderCommunicationIdentifier = default;
- string senderDisplayName = default;
- DateTimeOffset composeTime = default;
- string type = default;
- long? version = default;
- string transactionId = default;
- string threadId = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("messageBody"u8))
- {
- messageBody = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("metadata"u8))
- {
- Dictionary dictionary = new Dictionary();
- foreach (var property0 in property.Value.EnumerateObject())
- {
- dictionary.Add(property0.Name, property0.Value.GetString());
- }
- metadata = dictionary;
- continue;
- }
- if (property.NameEquals("editTime"u8))
- {
- editTime = property.Value.GetDateTimeOffset("O");
- continue;
- }
- if (property.NameEquals("messageId"u8))
- {
- messageId = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("senderCommunicationIdentifier"u8))
- {
- senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options);
- continue;
- }
- if (property.NameEquals("senderDisplayName"u8))
- {
- senderDisplayName = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("composeTime"u8))
- {
- composeTime = property.Value.GetDateTimeOffset("O");
- continue;
- }
- if (property.NameEquals("type"u8))
- {
- type = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("version"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- version = property.Value.GetInt64();
- continue;
- }
- if (property.NameEquals("transactionId"u8))
- {
- transactionId = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("threadId"u8))
- {
- threadId = property.Value.GetString();
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new AcsChatMessageEditedInThreadEventData(
- transactionId,
- threadId,
- serializedAdditionalRawData,
- messageId,
- senderCommunicationIdentifier,
- senderDisplayName,
- composeTime,
- type,
- version,
- messageBody,
- metadata,
- editTime);
- }
-
- BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- return ModelReaderWriter.Write(this, options);
- default:
- throw new FormatException($"The model {nameof(AcsChatMessageEditedInThreadEventData)} does not support writing '{options.Format}' format.");
- }
- }
-
- AcsChatMessageEditedInThreadEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeAcsChatMessageEditedInThreadEventData(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(AcsChatMessageEditedInThreadEventData)} does not support reading '{options.Format}' format.");
- }
- }
-
- string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
-
- /// Deserializes the model from a raw response.
- /// The response to deserialize the model from.
- internal static new AcsChatMessageEditedInThreadEventData FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeAcsChatMessageEditedInThreadEventData(document.RootElement);
- }
-
- /// Convert into a .
- internal override RequestContent ToRequestContent()
- {
- var content = new Utf8JsonRequestContent();
- content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
- return content;
- }
- }
-}
diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.cs
deleted file mode 100644
index 99134233639c..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEditedInThreadEventData.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageEditedInThread event.
- public partial class AcsChatMessageEditedInThreadEventData : AcsChatMessageEventInThreadBaseProperties
- {
- /// Initializes a new instance of .
- /// The communication identifier of the sender.
- /// The original compose time of the message.
- /// The chat message metadata.
- /// The time at which the message was edited.
- /// or is null.
- internal AcsChatMessageEditedInThreadEventData(CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime, IReadOnlyDictionary metadata, DateTimeOffset editTime) : base(senderCommunicationIdentifier, composeTime)
- {
- Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier));
- Argument.AssertNotNull(metadata, nameof(metadata));
-
- Metadata = metadata;
- EditTime = editTime;
- }
-
- /// Initializes a new instance of .
- /// The transaction id will be used as co-relation vector.
- /// The chat thread id.
- /// Keeps track of any properties unknown to the library.
- /// 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 chat message metadata.
- /// The time at which the message was edited.
- internal AcsChatMessageEditedInThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset composeTime, string type, long? version, string messageBody, IReadOnlyDictionary metadata, DateTimeOffset editTime) : base(transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version)
- {
- MessageBody = messageBody;
- Metadata = metadata;
- EditTime = editTime;
- }
-
- /// Initializes a new instance of for deserialization.
- internal AcsChatMessageEditedInThreadEventData()
- {
- }
-
- /// The body of the chat message.
- public string MessageBody { get; }
- /// The chat message metadata.
- public IReadOnlyDictionary Metadata { get; }
- /// The time at which the message was edited.
- public DateTimeOffset EditTime { get; }
- }
-}
diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.Serialization.cs
deleted file mode 100644
index 5c8edcacc2cc..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.Serialization.cs
+++ /dev/null
@@ -1,212 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- public partial class AcsChatMessageEventBaseProperties : IUtf8JsonSerializable, IJsonModel
- {
- void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
-
- void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- writer.WriteStartObject();
- JsonModelWriteCore(writer, options);
- writer.WriteEndObject();
- }
-
- /// The JSON writer.
- /// The client options for reading and writing models.
- protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatMessageEventBaseProperties)} does not support writing '{format}' format.");
- }
-
- base.JsonModelWriteCore(writer, options);
- if (Optional.IsDefined(MessageId))
- {
- writer.WritePropertyName("messageId"u8);
- writer.WriteStringValue(MessageId);
- }
- writer.WritePropertyName("senderCommunicationIdentifier"u8);
- writer.WriteObjectValue(SenderCommunicationIdentifier, options);
- if (Optional.IsDefined(SenderDisplayName))
- {
- writer.WritePropertyName("senderDisplayName"u8);
- writer.WriteStringValue(SenderDisplayName);
- }
- writer.WritePropertyName("composeTime"u8);
- writer.WriteStringValue(ComposeTime, "O");
- if (Optional.IsDefined(Type))
- {
- writer.WritePropertyName("type"u8);
- writer.WriteStringValue(Type);
- }
- if (Optional.IsDefined(Version))
- {
- writer.WritePropertyName("version"u8);
- writer.WriteNumberValue(Version.Value);
- }
- }
-
- AcsChatMessageEventBaseProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatMessageEventBaseProperties)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeAcsChatMessageEventBaseProperties(document.RootElement, options);
- }
-
- internal static AcsChatMessageEventBaseProperties DeserializeAcsChatMessageEventBaseProperties(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- string messageId = default;
- CommunicationIdentifierModel senderCommunicationIdentifier = default;
- string senderDisplayName = default;
- DateTimeOffset composeTime = default;
- string type = default;
- long? version = default;
- CommunicationIdentifierModel recipientCommunicationIdentifier = default;
- string transactionId = default;
- string threadId = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("messageId"u8))
- {
- messageId = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("senderCommunicationIdentifier"u8))
- {
- senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options);
- continue;
- }
- if (property.NameEquals("senderDisplayName"u8))
- {
- senderDisplayName = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("composeTime"u8))
- {
- composeTime = property.Value.GetDateTimeOffset("O");
- continue;
- }
- if (property.NameEquals("type"u8))
- {
- type = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("version"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- version = property.Value.GetInt64();
- continue;
- }
- if (property.NameEquals("recipientCommunicationIdentifier"u8))
- {
- recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options);
- continue;
- }
- if (property.NameEquals("transactionId"u8))
- {
- transactionId = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("threadId"u8))
- {
- threadId = property.Value.GetString();
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new AcsChatMessageEventBaseProperties(
- recipientCommunicationIdentifier,
- transactionId,
- threadId,
- serializedAdditionalRawData,
- messageId,
- senderCommunicationIdentifier,
- senderDisplayName,
- composeTime,
- type,
- version);
- }
-
- BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- return ModelReaderWriter.Write(this, options);
- default:
- throw new FormatException($"The model {nameof(AcsChatMessageEventBaseProperties)} does not support writing '{options.Format}' format.");
- }
- }
-
- AcsChatMessageEventBaseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeAcsChatMessageEventBaseProperties(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(AcsChatMessageEventBaseProperties)} does not support reading '{options.Format}' format.");
- }
- }
-
- string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
-
- /// Deserializes the model from a raw response.
- /// The response to deserialize the model from.
- internal static new AcsChatMessageEventBaseProperties FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeAcsChatMessageEventBaseProperties(document.RootElement);
- }
-
- /// Convert into a .
- internal override RequestContent ToRequestContent()
- {
- var content = new Utf8JsonRequestContent();
- content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
- return content;
- }
- }
-}
diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.cs
deleted file mode 100644
index d0109a86be03..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventBaseProperties.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- /// Schema of common properties of all chat message events.
- public partial class AcsChatMessageEventBaseProperties : AcsChatEventBaseProperties
- {
- /// Initializes a new instance of .
- /// The communication identifier of the target user.
- /// The communication identifier of the sender.
- /// The original compose time of the message.
- /// or is null.
- internal AcsChatMessageEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime) : base(recipientCommunicationIdentifier)
- {
- Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier));
- Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier));
-
- SenderCommunicationIdentifier = senderCommunicationIdentifier;
- ComposeTime = composeTime;
- }
-
- /// Initializes a new instance of .
- /// The communication identifier of the target user.
- /// The transaction id will be used as co-relation vector.
- /// The chat thread id.
- /// Keeps track of any properties unknown to the library.
- /// 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 AcsChatMessageEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset composeTime, string type, long? version) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData)
- {
- MessageId = messageId;
- SenderCommunicationIdentifier = senderCommunicationIdentifier;
- SenderDisplayName = senderDisplayName;
- ComposeTime = composeTime;
- Type = type;
- Version = version;
- }
-
- /// Initializes a new instance of for deserialization.
- internal AcsChatMessageEventBaseProperties()
- {
- }
-
- /// 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.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.Serialization.cs
deleted file mode 100644
index daf9837f457b..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.Serialization.cs
+++ /dev/null
@@ -1,205 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- public partial class AcsChatMessageEventInThreadBaseProperties : IUtf8JsonSerializable, IJsonModel
- {
- void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
-
- void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- writer.WriteStartObject();
- JsonModelWriteCore(writer, options);
- writer.WriteEndObject();
- }
-
- /// The JSON writer.
- /// The client options for reading and writing models.
- protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatMessageEventInThreadBaseProperties)} does not support writing '{format}' format.");
- }
-
- base.JsonModelWriteCore(writer, options);
- if (Optional.IsDefined(MessageId))
- {
- writer.WritePropertyName("messageId"u8);
- writer.WriteStringValue(MessageId);
- }
- writer.WritePropertyName("senderCommunicationIdentifier"u8);
- writer.WriteObjectValue(SenderCommunicationIdentifier, options);
- if (Optional.IsDefined(SenderDisplayName))
- {
- writer.WritePropertyName("senderDisplayName"u8);
- writer.WriteStringValue(SenderDisplayName);
- }
- writer.WritePropertyName("composeTime"u8);
- writer.WriteStringValue(ComposeTime, "O");
- if (Optional.IsDefined(Type))
- {
- writer.WritePropertyName("type"u8);
- writer.WriteStringValue(Type);
- }
- if (Optional.IsDefined(Version))
- {
- writer.WritePropertyName("version"u8);
- writer.WriteNumberValue(Version.Value);
- }
- }
-
- AcsChatMessageEventInThreadBaseProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatMessageEventInThreadBaseProperties)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeAcsChatMessageEventInThreadBaseProperties(document.RootElement, options);
- }
-
- internal static AcsChatMessageEventInThreadBaseProperties DeserializeAcsChatMessageEventInThreadBaseProperties(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- string messageId = default;
- CommunicationIdentifierModel senderCommunicationIdentifier = default;
- string senderDisplayName = default;
- DateTimeOffset composeTime = default;
- string type = default;
- long? version = default;
- string transactionId = default;
- string threadId = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("messageId"u8))
- {
- messageId = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("senderCommunicationIdentifier"u8))
- {
- senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options);
- continue;
- }
- if (property.NameEquals("senderDisplayName"u8))
- {
- senderDisplayName = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("composeTime"u8))
- {
- composeTime = property.Value.GetDateTimeOffset("O");
- continue;
- }
- if (property.NameEquals("type"u8))
- {
- type = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("version"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- version = property.Value.GetInt64();
- continue;
- }
- if (property.NameEquals("transactionId"u8))
- {
- transactionId = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("threadId"u8))
- {
- threadId = property.Value.GetString();
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new AcsChatMessageEventInThreadBaseProperties(
- transactionId,
- threadId,
- serializedAdditionalRawData,
- messageId,
- senderCommunicationIdentifier,
- senderDisplayName,
- composeTime,
- type,
- version);
- }
-
- BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- return ModelReaderWriter.Write(this, options);
- default:
- throw new FormatException($"The model {nameof(AcsChatMessageEventInThreadBaseProperties)} does not support writing '{options.Format}' format.");
- }
- }
-
- AcsChatMessageEventInThreadBaseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeAcsChatMessageEventInThreadBaseProperties(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(AcsChatMessageEventInThreadBaseProperties)} does not support reading '{options.Format}' format.");
- }
- }
-
- string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
-
- /// Deserializes the model from a raw response.
- /// The response to deserialize the model from.
- internal static new AcsChatMessageEventInThreadBaseProperties FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeAcsChatMessageEventInThreadBaseProperties(document.RootElement);
- }
-
- /// Convert into a .
- internal override RequestContent ToRequestContent()
- {
- var content = new Utf8JsonRequestContent();
- content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
- return content;
- }
- }
-}
diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.cs
deleted file mode 100644
index 72fdab5e25f7..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageEventInThreadBaseProperties.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-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 .
- /// The communication identifier of the sender.
- /// The original compose time of the message.
- /// is null.
- internal AcsChatMessageEventInThreadBaseProperties(CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime)
- {
- Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier));
-
- SenderCommunicationIdentifier = senderCommunicationIdentifier;
- ComposeTime = composeTime;
- }
-
- /// Initializes a new instance of .
- /// The transaction id will be used as co-relation vector.
- /// The chat thread id.
- /// Keeps track of any properties unknown to the library.
- /// 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 transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset composeTime, string type, long? version) : base(transactionId, threadId, serializedAdditionalRawData)
- {
- MessageId = messageId;
- SenderCommunicationIdentifier = senderCommunicationIdentifier;
- SenderDisplayName = senderDisplayName;
- ComposeTime = composeTime;
- Type = type;
- Version = version;
- }
-
- /// Initializes a new instance of for deserialization.
- internal AcsChatMessageEventInThreadBaseProperties()
- {
- }
-
- /// 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.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.Serialization.cs
deleted file mode 100644
index 30ba40046cec..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.Serialization.cs
+++ /dev/null
@@ -1,220 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- public partial class AcsChatMessageReceivedEventData : IUtf8JsonSerializable, IJsonModel
- {
- void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
-
- void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- writer.WriteStartObject();
- JsonModelWriteCore(writer, options);
- writer.WriteEndObject();
- }
-
- /// The JSON writer.
- /// The client options for reading and writing models.
- protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatMessageReceivedEventData)} does not support writing '{format}' format.");
- }
-
- base.JsonModelWriteCore(writer, options);
- if (Optional.IsDefined(MessageBody))
- {
- writer.WritePropertyName("messageBody"u8);
- writer.WriteStringValue(MessageBody);
- }
- writer.WritePropertyName("metadata"u8);
- writer.WriteStartObject();
- foreach (var item in Metadata)
- {
- writer.WritePropertyName(item.Key);
- writer.WriteStringValue(item.Value);
- }
- writer.WriteEndObject();
- }
-
- AcsChatMessageReceivedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatMessageReceivedEventData)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeAcsChatMessageReceivedEventData(document.RootElement, options);
- }
-
- internal static AcsChatMessageReceivedEventData DeserializeAcsChatMessageReceivedEventData(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- string messageBody = default;
- IReadOnlyDictionary metadata = default;
- string messageId = default;
- CommunicationIdentifierModel senderCommunicationIdentifier = default;
- string senderDisplayName = default;
- DateTimeOffset composeTime = default;
- string type = default;
- long? version = default;
- CommunicationIdentifierModel recipientCommunicationIdentifier = default;
- string transactionId = default;
- string threadId = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("messageBody"u8))
- {
- messageBody = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("metadata"u8))
- {
- Dictionary dictionary = new Dictionary();
- foreach (var property0 in property.Value.EnumerateObject())
- {
- dictionary.Add(property0.Name, property0.Value.GetString());
- }
- metadata = dictionary;
- continue;
- }
- if (property.NameEquals("messageId"u8))
- {
- messageId = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("senderCommunicationIdentifier"u8))
- {
- senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options);
- continue;
- }
- if (property.NameEquals("senderDisplayName"u8))
- {
- senderDisplayName = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("composeTime"u8))
- {
- composeTime = property.Value.GetDateTimeOffset("O");
- continue;
- }
- if (property.NameEquals("type"u8))
- {
- type = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("version"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- version = property.Value.GetInt64();
- continue;
- }
- if (property.NameEquals("recipientCommunicationIdentifier"u8))
- {
- recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options);
- continue;
- }
- if (property.NameEquals("transactionId"u8))
- {
- transactionId = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("threadId"u8))
- {
- threadId = property.Value.GetString();
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new AcsChatMessageReceivedEventData(
- recipientCommunicationIdentifier,
- transactionId,
- threadId,
- serializedAdditionalRawData,
- messageId,
- senderCommunicationIdentifier,
- senderDisplayName,
- composeTime,
- type,
- version,
- messageBody,
- metadata);
- }
-
- BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- return ModelReaderWriter.Write(this, options);
- default:
- throw new FormatException($"The model {nameof(AcsChatMessageReceivedEventData)} does not support writing '{options.Format}' format.");
- }
- }
-
- AcsChatMessageReceivedEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeAcsChatMessageReceivedEventData(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(AcsChatMessageReceivedEventData)} does not support reading '{options.Format}' format.");
- }
- }
-
- string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
-
- /// Deserializes the model from a raw response.
- /// The response to deserialize the model from.
- internal static new AcsChatMessageReceivedEventData FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeAcsChatMessageReceivedEventData(document.RootElement);
- }
-
- /// Convert into a .
- internal override RequestContent ToRequestContent()
- {
- var content = new Utf8JsonRequestContent();
- content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
- return content;
- }
- }
-}
diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.cs
deleted file mode 100644
index 2410db3e730b..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedEventData.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageReceived event.
- public partial class AcsChatMessageReceivedEventData : AcsChatMessageEventBaseProperties
- {
- /// Initializes a new instance of .
- /// The communication identifier of the target user.
- /// The communication identifier of the sender.
- /// The original compose time of the message.
- /// The chat message metadata.
- /// , or is null.
- internal AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime, IReadOnlyDictionary metadata) : base(recipientCommunicationIdentifier, senderCommunicationIdentifier, composeTime)
- {
- Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier));
- Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier));
- Argument.AssertNotNull(metadata, nameof(metadata));
-
- Metadata = metadata;
- }
-
- /// Initializes a new instance of .
- /// The communication identifier of the target user.
- /// The transaction id will be used as co-relation vector.
- /// The chat thread id.
- /// Keeps track of any properties unknown to the library.
- /// 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 chat message metadata.
- internal AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset composeTime, string type, long? version, string messageBody, IReadOnlyDictionary metadata) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version)
- {
- MessageBody = messageBody;
- Metadata = metadata;
- }
-
- /// Initializes a new instance of for deserialization.
- internal AcsChatMessageReceivedEventData()
- {
- }
-
- /// The body of the chat message.
- public string MessageBody { get; }
- /// The chat message metadata.
- public IReadOnlyDictionary Metadata { get; }
- }
-}
diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.Serialization.cs
deleted file mode 100644
index 03658d848d09..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.Serialization.cs
+++ /dev/null
@@ -1,213 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- public partial class AcsChatMessageReceivedInThreadEventData : IUtf8JsonSerializable, IJsonModel
- {
- void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
-
- void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- writer.WriteStartObject();
- JsonModelWriteCore(writer, options);
- writer.WriteEndObject();
- }
-
- /// The JSON writer.
- /// The client options for reading and writing models.
- protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatMessageReceivedInThreadEventData)} does not support writing '{format}' format.");
- }
-
- base.JsonModelWriteCore(writer, options);
- if (Optional.IsDefined(MessageBody))
- {
- writer.WritePropertyName("messageBody"u8);
- writer.WriteStringValue(MessageBody);
- }
- writer.WritePropertyName("metadata"u8);
- writer.WriteStartObject();
- foreach (var item in Metadata)
- {
- writer.WritePropertyName(item.Key);
- writer.WriteStringValue(item.Value);
- }
- writer.WriteEndObject();
- }
-
- AcsChatMessageReceivedInThreadEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatMessageReceivedInThreadEventData)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeAcsChatMessageReceivedInThreadEventData(document.RootElement, options);
- }
-
- internal static AcsChatMessageReceivedInThreadEventData DeserializeAcsChatMessageReceivedInThreadEventData(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- string messageBody = default;
- IReadOnlyDictionary metadata = default;
- string messageId = default;
- CommunicationIdentifierModel senderCommunicationIdentifier = default;
- string senderDisplayName = default;
- DateTimeOffset composeTime = default;
- string type = default;
- long? version = default;
- string transactionId = default;
- string threadId = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("messageBody"u8))
- {
- messageBody = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("metadata"u8))
- {
- Dictionary dictionary = new Dictionary();
- foreach (var property0 in property.Value.EnumerateObject())
- {
- dictionary.Add(property0.Name, property0.Value.GetString());
- }
- metadata = dictionary;
- continue;
- }
- if (property.NameEquals("messageId"u8))
- {
- messageId = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("senderCommunicationIdentifier"u8))
- {
- senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options);
- continue;
- }
- if (property.NameEquals("senderDisplayName"u8))
- {
- senderDisplayName = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("composeTime"u8))
- {
- composeTime = property.Value.GetDateTimeOffset("O");
- continue;
- }
- if (property.NameEquals("type"u8))
- {
- type = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("version"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- version = property.Value.GetInt64();
- continue;
- }
- if (property.NameEquals("transactionId"u8))
- {
- transactionId = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("threadId"u8))
- {
- threadId = property.Value.GetString();
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new AcsChatMessageReceivedInThreadEventData(
- transactionId,
- threadId,
- serializedAdditionalRawData,
- messageId,
- senderCommunicationIdentifier,
- senderDisplayName,
- composeTime,
- type,
- version,
- messageBody,
- metadata);
- }
-
- BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- return ModelReaderWriter.Write(this, options);
- default:
- throw new FormatException($"The model {nameof(AcsChatMessageReceivedInThreadEventData)} does not support writing '{options.Format}' format.");
- }
- }
-
- AcsChatMessageReceivedInThreadEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeAcsChatMessageReceivedInThreadEventData(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(AcsChatMessageReceivedInThreadEventData)} does not support reading '{options.Format}' format.");
- }
- }
-
- string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
-
- /// Deserializes the model from a raw response.
- /// The response to deserialize the model from.
- internal static new AcsChatMessageReceivedInThreadEventData FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeAcsChatMessageReceivedInThreadEventData(document.RootElement);
- }
-
- /// Convert into a .
- internal override RequestContent ToRequestContent()
- {
- var content = new Utf8JsonRequestContent();
- content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
- return content;
- }
- }
-}
diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.cs
deleted file mode 100644
index 8698284721c1..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatMessageReceivedInThreadEventData.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageReceivedInThread event.
- public partial class AcsChatMessageReceivedInThreadEventData : AcsChatMessageEventInThreadBaseProperties
- {
- /// Initializes a new instance of .
- /// The communication identifier of the sender.
- /// The original compose time of the message.
- /// The chat message metadata.
- /// or is null.
- internal AcsChatMessageReceivedInThreadEventData(CommunicationIdentifierModel senderCommunicationIdentifier, DateTimeOffset composeTime, IReadOnlyDictionary metadata) : base(senderCommunicationIdentifier, composeTime)
- {
- Argument.AssertNotNull(senderCommunicationIdentifier, nameof(senderCommunicationIdentifier));
- Argument.AssertNotNull(metadata, nameof(metadata));
-
- Metadata = metadata;
- }
-
- /// Initializes a new instance of .
- /// The transaction id will be used as co-relation vector.
- /// The chat thread id.
- /// Keeps track of any properties unknown to the library.
- /// 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 chat message metadata.
- internal AcsChatMessageReceivedInThreadEventData(string transactionId, string threadId, IDictionary serializedAdditionalRawData, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset composeTime, string type, long? version, string messageBody, IReadOnlyDictionary metadata) : base(transactionId, threadId, serializedAdditionalRawData, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version)
- {
- MessageBody = messageBody;
- Metadata = metadata;
- }
-
- /// Initializes a new instance of for deserialization.
- internal AcsChatMessageReceivedInThreadEventData()
- {
- }
-
- /// The body of the chat message.
- public string MessageBody { get; }
- /// The chat message metadata.
- public IReadOnlyDictionary Metadata { get; }
- }
-}
diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.Serialization.cs
deleted file mode 100644
index 4acb68c7bf71..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.Serialization.cs
+++ /dev/null
@@ -1,178 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- public partial class AcsChatParticipantAddedToThreadEventData : IUtf8JsonSerializable, IJsonModel
- {
- void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
-
- void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- writer.WriteStartObject();
- JsonModelWriteCore(writer, options);
- writer.WriteEndObject();
- }
-
- /// The JSON writer.
- /// The client options for reading and writing models.
- protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatParticipantAddedToThreadEventData)} does not support writing '{format}' format.");
- }
-
- base.JsonModelWriteCore(writer, options);
- writer.WritePropertyName("time"u8);
- writer.WriteStringValue(Time, "O");
- writer.WritePropertyName("addedByCommunicationIdentifier"u8);
- writer.WriteObjectValue(AddedByCommunicationIdentifier, options);
- writer.WritePropertyName("participantAdded"u8);
- writer.WriteObjectValue(ParticipantAdded, options);
- if (Optional.IsDefined(Version))
- {
- writer.WritePropertyName("version"u8);
- writer.WriteNumberValue(Version.Value);
- }
- }
-
- AcsChatParticipantAddedToThreadEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatParticipantAddedToThreadEventData)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeAcsChatParticipantAddedToThreadEventData(document.RootElement, options);
- }
-
- internal static AcsChatParticipantAddedToThreadEventData DeserializeAcsChatParticipantAddedToThreadEventData(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- DateTimeOffset time = default;
- CommunicationIdentifierModel addedByCommunicationIdentifier = default;
- AcsChatThreadParticipantProperties participantAdded = default;
- long? version = default;
- string transactionId = default;
- string threadId = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("time"u8))
- {
- time = property.Value.GetDateTimeOffset("O");
- continue;
- }
- if (property.NameEquals("addedByCommunicationIdentifier"u8))
- {
- addedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options);
- continue;
- }
- if (property.NameEquals("participantAdded"u8))
- {
- participantAdded = AcsChatThreadParticipantProperties.DeserializeAcsChatThreadParticipantProperties(property.Value, options);
- continue;
- }
- if (property.NameEquals("version"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- version = property.Value.GetInt64();
- continue;
- }
- if (property.NameEquals("transactionId"u8))
- {
- transactionId = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("threadId"u8))
- {
- threadId = property.Value.GetString();
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new AcsChatParticipantAddedToThreadEventData(
- transactionId,
- threadId,
- serializedAdditionalRawData,
- time,
- addedByCommunicationIdentifier,
- participantAdded,
- version);
- }
-
- BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- return ModelReaderWriter.Write(this, options);
- default:
- throw new FormatException($"The model {nameof(AcsChatParticipantAddedToThreadEventData)} does not support writing '{options.Format}' format.");
- }
- }
-
- AcsChatParticipantAddedToThreadEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeAcsChatParticipantAddedToThreadEventData(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(AcsChatParticipantAddedToThreadEventData)} does not support reading '{options.Format}' format.");
- }
- }
-
- string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
-
- /// Deserializes the model from a raw response.
- /// The response to deserialize the model from.
- internal static new AcsChatParticipantAddedToThreadEventData FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeAcsChatParticipantAddedToThreadEventData(document.RootElement);
- }
-
- /// Convert into a .
- internal override RequestContent ToRequestContent()
- {
- var content = new Utf8JsonRequestContent();
- content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
- return content;
- }
- }
-}
diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.cs
deleted file mode 100644
index 0c74e23af594..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadEventData.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadParticipantAdded event.
- public partial class AcsChatParticipantAddedToThreadEventData : AcsChatEventInThreadBaseProperties
- {
- /// Initializes a new instance of .
- /// 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.
- /// or is null.
- internal AcsChatParticipantAddedToThreadEventData(DateTimeOffset time, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded)
- {
- Argument.AssertNotNull(addedByCommunicationIdentifier, nameof(addedByCommunicationIdentifier));
- Argument.AssertNotNull(participantAdded, nameof(participantAdded));
-
- Time = time;
- AddedByCommunicationIdentifier = addedByCommunicationIdentifier;
- ParticipantAdded = participantAdded;
- }
-
- /// Initializes a new instance of .
- /// The transaction id will be used as co-relation vector.
- /// The chat thread id.
- /// Keeps track of any properties unknown to the library.
- /// 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 transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset time, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded, long? version) : base(transactionId, threadId, serializedAdditionalRawData)
- {
- Time = time;
- AddedByCommunicationIdentifier = addedByCommunicationIdentifier;
- ParticipantAdded = participantAdded;
- Version = version;
- }
-
- /// Initializes a new instance of for deserialization.
- internal AcsChatParticipantAddedToThreadEventData()
- {
- }
-
- /// 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.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.Serialization.cs
deleted file mode 100644
index 656b0ad7865b..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.Serialization.cs
+++ /dev/null
@@ -1,187 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- public partial class AcsChatParticipantAddedToThreadWithUserEventData : IUtf8JsonSerializable, IJsonModel
- {
- void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
-
- void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- writer.WriteStartObject();
- JsonModelWriteCore(writer, options);
- writer.WriteEndObject();
- }
-
- /// The JSON writer.
- /// The client options for reading and writing models.
- protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatParticipantAddedToThreadWithUserEventData)} does not support writing '{format}' format.");
- }
-
- base.JsonModelWriteCore(writer, options);
- writer.WritePropertyName("time"u8);
- writer.WriteStringValue(Time, "O");
- writer.WritePropertyName("addedByCommunicationIdentifier"u8);
- writer.WriteObjectValue(AddedByCommunicationIdentifier, options);
- writer.WritePropertyName("participantAdded"u8);
- writer.WriteObjectValue(ParticipantAdded, options);
- }
-
- AcsChatParticipantAddedToThreadWithUserEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatParticipantAddedToThreadWithUserEventData)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeAcsChatParticipantAddedToThreadWithUserEventData(document.RootElement, options);
- }
-
- internal static AcsChatParticipantAddedToThreadWithUserEventData DeserializeAcsChatParticipantAddedToThreadWithUserEventData(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- DateTimeOffset time = default;
- CommunicationIdentifierModel addedByCommunicationIdentifier = default;
- AcsChatThreadParticipantProperties participantAdded = default;
- DateTimeOffset createTime = default;
- long? version = default;
- CommunicationIdentifierModel recipientCommunicationIdentifier = default;
- string transactionId = default;
- string threadId = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("time"u8))
- {
- time = property.Value.GetDateTimeOffset("O");
- continue;
- }
- if (property.NameEquals("addedByCommunicationIdentifier"u8))
- {
- addedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options);
- continue;
- }
- if (property.NameEquals("participantAdded"u8))
- {
- participantAdded = AcsChatThreadParticipantProperties.DeserializeAcsChatThreadParticipantProperties(property.Value, options);
- continue;
- }
- if (property.NameEquals("createTime"u8))
- {
- createTime = property.Value.GetDateTimeOffset("O");
- continue;
- }
- if (property.NameEquals("version"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- version = property.Value.GetInt64();
- continue;
- }
- if (property.NameEquals("recipientCommunicationIdentifier"u8))
- {
- recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options);
- continue;
- }
- if (property.NameEquals("transactionId"u8))
- {
- transactionId = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("threadId"u8))
- {
- threadId = property.Value.GetString();
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new AcsChatParticipantAddedToThreadWithUserEventData(
- recipientCommunicationIdentifier,
- transactionId,
- threadId,
- serializedAdditionalRawData,
- createTime,
- version,
- time,
- addedByCommunicationIdentifier,
- participantAdded);
- }
-
- BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- return ModelReaderWriter.Write(this, options);
- default:
- throw new FormatException($"The model {nameof(AcsChatParticipantAddedToThreadWithUserEventData)} does not support writing '{options.Format}' format.");
- }
- }
-
- AcsChatParticipantAddedToThreadWithUserEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeAcsChatParticipantAddedToThreadWithUserEventData(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(AcsChatParticipantAddedToThreadWithUserEventData)} does not support reading '{options.Format}' format.");
- }
- }
-
- string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
-
- /// Deserializes the model from a raw response.
- /// The response to deserialize the model from.
- internal static new AcsChatParticipantAddedToThreadWithUserEventData FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeAcsChatParticipantAddedToThreadWithUserEventData(document.RootElement);
- }
-
- /// Convert into a .
- internal override RequestContent ToRequestContent()
- {
- var content = new Utf8JsonRequestContent();
- content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
- return content;
- }
- }
-}
diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.cs
deleted file mode 100644
index 95e15aab1526..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantAddedToThreadWithUserEventData.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatParticipantAddedToThreadWithUser event.
- public partial class AcsChatParticipantAddedToThreadWithUserEventData : AcsChatThreadEventBaseProperties
- {
- /// Initializes a new instance of .
- /// The communication identifier of the target user.
- /// The original creation time 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.
- /// , or is null.
- internal AcsChatParticipantAddedToThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, DateTimeOffset createTime, DateTimeOffset time, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded) : base(recipientCommunicationIdentifier, createTime)
- {
- Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier));
- Argument.AssertNotNull(addedByCommunicationIdentifier, nameof(addedByCommunicationIdentifier));
- Argument.AssertNotNull(participantAdded, nameof(participantAdded));
-
- Time = time;
- AddedByCommunicationIdentifier = addedByCommunicationIdentifier;
- ParticipantAdded = participantAdded;
- }
-
- /// Initializes a new instance of .
- /// The communication identifier of the target user.
- /// The transaction id will be used as co-relation vector.
- /// The chat thread id.
- /// Keeps track of any properties unknown to the library.
- /// 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, IDictionary serializedAdditionalRawData, DateTimeOffset createTime, long? version, DateTimeOffset time, CommunicationIdentifierModel addedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantAdded) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version)
- {
- Time = time;
- AddedByCommunicationIdentifier = addedByCommunicationIdentifier;
- ParticipantAdded = participantAdded;
- }
-
- /// Initializes a new instance of for deserialization.
- internal AcsChatParticipantAddedToThreadWithUserEventData()
- {
- }
-
- /// 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.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.Serialization.cs
deleted file mode 100644
index 34a1f1d8e6bd..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.Serialization.cs
+++ /dev/null
@@ -1,178 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- public partial class AcsChatParticipantRemovedFromThreadEventData : IUtf8JsonSerializable, IJsonModel
- {
- void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
-
- void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- writer.WriteStartObject();
- JsonModelWriteCore(writer, options);
- writer.WriteEndObject();
- }
-
- /// The JSON writer.
- /// The client options for reading and writing models.
- protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatParticipantRemovedFromThreadEventData)} does not support writing '{format}' format.");
- }
-
- base.JsonModelWriteCore(writer, options);
- writer.WritePropertyName("time"u8);
- writer.WriteStringValue(Time, "O");
- writer.WritePropertyName("removedByCommunicationIdentifier"u8);
- writer.WriteObjectValue(RemovedByCommunicationIdentifier, options);
- writer.WritePropertyName("participantRemoved"u8);
- writer.WriteObjectValue(ParticipantRemoved, options);
- if (Optional.IsDefined(Version))
- {
- writer.WritePropertyName("version"u8);
- writer.WriteNumberValue(Version.Value);
- }
- }
-
- AcsChatParticipantRemovedFromThreadEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatParticipantRemovedFromThreadEventData)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeAcsChatParticipantRemovedFromThreadEventData(document.RootElement, options);
- }
-
- internal static AcsChatParticipantRemovedFromThreadEventData DeserializeAcsChatParticipantRemovedFromThreadEventData(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- DateTimeOffset time = default;
- CommunicationIdentifierModel removedByCommunicationIdentifier = default;
- AcsChatThreadParticipantProperties participantRemoved = default;
- long? version = default;
- string transactionId = default;
- string threadId = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("time"u8))
- {
- time = property.Value.GetDateTimeOffset("O");
- continue;
- }
- if (property.NameEquals("removedByCommunicationIdentifier"u8))
- {
- removedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options);
- continue;
- }
- if (property.NameEquals("participantRemoved"u8))
- {
- participantRemoved = AcsChatThreadParticipantProperties.DeserializeAcsChatThreadParticipantProperties(property.Value, options);
- continue;
- }
- if (property.NameEquals("version"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- version = property.Value.GetInt64();
- continue;
- }
- if (property.NameEquals("transactionId"u8))
- {
- transactionId = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("threadId"u8))
- {
- threadId = property.Value.GetString();
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new AcsChatParticipantRemovedFromThreadEventData(
- transactionId,
- threadId,
- serializedAdditionalRawData,
- time,
- removedByCommunicationIdentifier,
- participantRemoved,
- version);
- }
-
- BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- return ModelReaderWriter.Write(this, options);
- default:
- throw new FormatException($"The model {nameof(AcsChatParticipantRemovedFromThreadEventData)} does not support writing '{options.Format}' format.");
- }
- }
-
- AcsChatParticipantRemovedFromThreadEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeAcsChatParticipantRemovedFromThreadEventData(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(AcsChatParticipantRemovedFromThreadEventData)} does not support reading '{options.Format}' format.");
- }
- }
-
- string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
-
- /// Deserializes the model from a raw response.
- /// The response to deserialize the model from.
- internal static new AcsChatParticipantRemovedFromThreadEventData FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeAcsChatParticipantRemovedFromThreadEventData(document.RootElement);
- }
-
- /// Convert into a .
- internal override RequestContent ToRequestContent()
- {
- var content = new Utf8JsonRequestContent();
- content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
- return content;
- }
- }
-}
diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.cs
deleted file mode 100644
index 2984453d0a26..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadEventData.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadParticipantRemoved event.
- public partial class AcsChatParticipantRemovedFromThreadEventData : AcsChatEventInThreadBaseProperties
- {
- /// Initializes a new instance of .
- /// 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.
- /// or is null.
- internal AcsChatParticipantRemovedFromThreadEventData(DateTimeOffset time, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved)
- {
- Argument.AssertNotNull(removedByCommunicationIdentifier, nameof(removedByCommunicationIdentifier));
- Argument.AssertNotNull(participantRemoved, nameof(participantRemoved));
-
- Time = time;
- RemovedByCommunicationIdentifier = removedByCommunicationIdentifier;
- ParticipantRemoved = participantRemoved;
- }
-
- /// Initializes a new instance of .
- /// The transaction id will be used as co-relation vector.
- /// The chat thread id.
- /// Keeps track of any properties unknown to the library.
- /// 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 transactionId, string threadId, IDictionary serializedAdditionalRawData, DateTimeOffset time, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved, long? version) : base(transactionId, threadId, serializedAdditionalRawData)
- {
- Time = time;
- RemovedByCommunicationIdentifier = removedByCommunicationIdentifier;
- ParticipantRemoved = participantRemoved;
- Version = version;
- }
-
- /// Initializes a new instance of for deserialization.
- internal AcsChatParticipantRemovedFromThreadEventData()
- {
- }
-
- /// 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.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.Serialization.cs
deleted file mode 100644
index f7db6f14d6f8..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.Serialization.cs
+++ /dev/null
@@ -1,187 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- public partial class AcsChatParticipantRemovedFromThreadWithUserEventData : IUtf8JsonSerializable, IJsonModel
- {
- void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
-
- void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- writer.WriteStartObject();
- JsonModelWriteCore(writer, options);
- writer.WriteEndObject();
- }
-
- /// The JSON writer.
- /// The client options for reading and writing models.
- protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatParticipantRemovedFromThreadWithUserEventData)} does not support writing '{format}' format.");
- }
-
- base.JsonModelWriteCore(writer, options);
- writer.WritePropertyName("time"u8);
- writer.WriteStringValue(Time, "O");
- writer.WritePropertyName("removedByCommunicationIdentifier"u8);
- writer.WriteObjectValue(RemovedByCommunicationIdentifier, options);
- writer.WritePropertyName("participantRemoved"u8);
- writer.WriteObjectValue(ParticipantRemoved, options);
- }
-
- AcsChatParticipantRemovedFromThreadWithUserEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatParticipantRemovedFromThreadWithUserEventData)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeAcsChatParticipantRemovedFromThreadWithUserEventData(document.RootElement, options);
- }
-
- internal static AcsChatParticipantRemovedFromThreadWithUserEventData DeserializeAcsChatParticipantRemovedFromThreadWithUserEventData(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- DateTimeOffset time = default;
- CommunicationIdentifierModel removedByCommunicationIdentifier = default;
- AcsChatThreadParticipantProperties participantRemoved = default;
- DateTimeOffset createTime = default;
- long? version = default;
- CommunicationIdentifierModel recipientCommunicationIdentifier = default;
- string transactionId = default;
- string threadId = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("time"u8))
- {
- time = property.Value.GetDateTimeOffset("O");
- continue;
- }
- if (property.NameEquals("removedByCommunicationIdentifier"u8))
- {
- removedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options);
- continue;
- }
- if (property.NameEquals("participantRemoved"u8))
- {
- participantRemoved = AcsChatThreadParticipantProperties.DeserializeAcsChatThreadParticipantProperties(property.Value, options);
- continue;
- }
- if (property.NameEquals("createTime"u8))
- {
- createTime = property.Value.GetDateTimeOffset("O");
- continue;
- }
- if (property.NameEquals("version"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- version = property.Value.GetInt64();
- continue;
- }
- if (property.NameEquals("recipientCommunicationIdentifier"u8))
- {
- recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options);
- continue;
- }
- if (property.NameEquals("transactionId"u8))
- {
- transactionId = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("threadId"u8))
- {
- threadId = property.Value.GetString();
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new AcsChatParticipantRemovedFromThreadWithUserEventData(
- recipientCommunicationIdentifier,
- transactionId,
- threadId,
- serializedAdditionalRawData,
- createTime,
- version,
- time,
- removedByCommunicationIdentifier,
- participantRemoved);
- }
-
- BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- return ModelReaderWriter.Write(this, options);
- default:
- throw new FormatException($"The model {nameof(AcsChatParticipantRemovedFromThreadWithUserEventData)} does not support writing '{options.Format}' format.");
- }
- }
-
- AcsChatParticipantRemovedFromThreadWithUserEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data);
- return DeserializeAcsChatParticipantRemovedFromThreadWithUserEventData(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(AcsChatParticipantRemovedFromThreadWithUserEventData)} does not support reading '{options.Format}' format.");
- }
- }
-
- string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
-
- /// Deserializes the model from a raw response.
- /// The response to deserialize the model from.
- internal static new AcsChatParticipantRemovedFromThreadWithUserEventData FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content);
- return DeserializeAcsChatParticipantRemovedFromThreadWithUserEventData(document.RootElement);
- }
-
- /// Convert into a .
- internal override RequestContent ToRequestContent()
- {
- var content = new Utf8JsonRequestContent();
- content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
- return content;
- }
- }
-}
diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.cs
deleted file mode 100644
index 109684ffc523..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatParticipantRemovedFromThreadWithUserEventData.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatParticipantRemovedFromThreadWithUser event.
- public partial class AcsChatParticipantRemovedFromThreadWithUserEventData : AcsChatThreadEventBaseProperties
- {
- /// Initializes a new instance of .
- /// The communication identifier of the target user.
- /// The original creation time 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.
- /// , or is null.
- internal AcsChatParticipantRemovedFromThreadWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, DateTimeOffset createTime, DateTimeOffset time, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved) : base(recipientCommunicationIdentifier, createTime)
- {
- Argument.AssertNotNull(recipientCommunicationIdentifier, nameof(recipientCommunicationIdentifier));
- Argument.AssertNotNull(removedByCommunicationIdentifier, nameof(removedByCommunicationIdentifier));
- Argument.AssertNotNull(participantRemoved, nameof(participantRemoved));
-
- Time = time;
- RemovedByCommunicationIdentifier = removedByCommunicationIdentifier;
- ParticipantRemoved = participantRemoved;
- }
-
- /// Initializes a new instance of .
- /// The communication identifier of the target user.
- /// The transaction id will be used as co-relation vector.
- /// The chat thread id.
- /// Keeps track of any properties unknown to the library.
- /// 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, IDictionary serializedAdditionalRawData, DateTimeOffset createTime, long? version, DateTimeOffset time, CommunicationIdentifierModel removedByCommunicationIdentifier, AcsChatThreadParticipantProperties participantRemoved) : base(recipientCommunicationIdentifier, transactionId, threadId, serializedAdditionalRawData, createTime, version)
- {
- Time = time;
- RemovedByCommunicationIdentifier = removedByCommunicationIdentifier;
- ParticipantRemoved = participantRemoved;
- }
-
- /// Initializes a new instance of for deserialization.
- internal AcsChatParticipantRemovedFromThreadWithUserEventData()
- {
- }
-
- /// 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.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.Serialization.cs
deleted file mode 100644
index 660520158e5d..000000000000
--- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/AcsChatThreadCreatedEventData.Serialization.cs
+++ /dev/null
@@ -1,240 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.Messaging.EventGrid.SystemEvents
-{
- public partial class AcsChatThreadCreatedEventData : IUtf8JsonSerializable, IJsonModel
- {
- void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
-
- void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- writer.WriteStartObject();
- JsonModelWriteCore(writer, options);
- writer.WriteEndObject();
- }
-
- /// The JSON writer.
- /// The client options for reading and writing models.
- protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatThreadCreatedEventData)} does not support writing '{format}' format.");
- }
-
- base.JsonModelWriteCore(writer, options);
- writer.WritePropertyName("createdByCommunicationIdentifier"u8);
- writer.WriteObjectValue(CreatedByCommunicationIdentifier, options);
- writer.WritePropertyName("properties"u8);
- writer.WriteStartObject();
- foreach (var item in Properties)
- {
- writer.WritePropertyName(item.Key);
- if (item.Value == null)
- {
- writer.WriteNullValue();
- continue;
- }
-#if NET6_0_OR_GREATER
- writer.WriteRawValue(item.Value);
-#else
- using (JsonDocument document = JsonDocument.Parse(item.Value))
- {
- JsonSerializer.Serialize(writer, document.RootElement);
- }
-#endif
- }
- writer.WriteEndObject();
- writer.WritePropertyName("metadata"u8);
- writer.WriteStartObject();
- foreach (var item in Metadata)
- {
- writer.WritePropertyName(item.Key);
- writer.WriteStringValue(item.Value);
- }
- writer.WriteEndObject();
- writer.WritePropertyName("participants"u8);
- writer.WriteStartArray();
- foreach (var item in Participants)
- {
- writer.WriteObjectValue(item, options);
- }
- writer.WriteEndArray();
- }
-
- AcsChatThreadCreatedEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AcsChatThreadCreatedEventData)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeAcsChatThreadCreatedEventData(document.RootElement, options);
- }
-
- internal static AcsChatThreadCreatedEventData DeserializeAcsChatThreadCreatedEventData(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- CommunicationIdentifierModel createdByCommunicationIdentifier = default;
- IReadOnlyDictionary properties = default;
- IReadOnlyDictionary metadata = default;
- IReadOnlyList participants = default;
- DateTimeOffset createTime = default;
- long? version = default;
- string transactionId = default;
- string threadId = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("createdByCommunicationIdentifier"u8))
- {
- createdByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value, options);
- continue;
- }
- if (property.NameEquals("properties"u8))
- {
- Dictionary dictionary = new Dictionary();
- foreach (var property0 in property.Value.EnumerateObject())
- {
- if (property0.Value.ValueKind == JsonValueKind.Null)
- {
- dictionary.Add(property0.Name, null);
- }
- else
- {
- dictionary.Add(property0.Name, BinaryData.FromString(property0.Value.GetRawText()));
- }
- }
- properties = dictionary;
- continue;
- }
- if (property.NameEquals("metadata"u8))
- {
- Dictionary dictionary = new Dictionary();
- foreach (var property0 in property.Value.EnumerateObject())
- {
- dictionary.Add(property0.Name, property0.Value.GetString());
- }
- metadata = dictionary;
- continue;
- }
- if (property.NameEquals("participants"u8))
- {
- List array = new List();
- foreach (var item in property.Value.EnumerateArray())
- {
- array.Add(AcsChatThreadParticipantProperties.DeserializeAcsChatThreadParticipantProperties(item, options));
- }
- participants = array;
- continue;
- }
- if (property.NameEquals("createTime"u8))
- {
- createTime = property.Value.GetDateTimeOffset("O");
- continue;
- }
- if (property.NameEquals("version"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- version = property.Value.GetInt64();
- continue;
- }
- if (property.NameEquals("transactionId"u8))
- {
- transactionId = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("threadId"u8))
- {
- threadId = property.Value.GetString();
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new AcsChatThreadCreatedEventData(
- transactionId,
- threadId,
- serializedAdditionalRawData,
- createTime,
- version,
- createdByCommunicationIdentifier,
- properties,
- metadata,
- participants);
- }
-
- BinaryData IPersistableModel