diff --git a/sdk/communication/Azure.Communication.JobRouter/api/Azure.Communication.JobRouter.netstandard2.0.cs b/sdk/communication/Azure.Communication.JobRouter/api/Azure.Communication.JobRouter.netstandard2.0.cs index e0112647bb23..31ee420444c2 100644 --- a/sdk/communication/Azure.Communication.JobRouter/api/Azure.Communication.JobRouter.netstandard2.0.cs +++ b/sdk/communication/Azure.Communication.JobRouter/api/Azure.Communication.JobRouter.netstandard2.0.cs @@ -6,6 +6,7 @@ internal AcceptJobOfferResult() { } public string AssignmentId { get { throw null; } } public string JobId { get { throw null; } } public string WorkerId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.AcceptJobOfferResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.AcceptJobOfferResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -17,6 +18,7 @@ public partial class BestWorkerMode : Azure.Communication.JobRouter.Distribution public BestWorkerMode() { } public Azure.Communication.JobRouter.RouterRule ScoringRule { get { throw null; } set { } } public Azure.Communication.JobRouter.ScoringRuleOptions ScoringRuleOptions { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.BestWorkerMode System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.BestWorkerMode System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -28,6 +30,7 @@ public partial class CancelExceptionAction : Azure.Communication.JobRouter.Excep public CancelExceptionAction() { } public string DispositionCode { get { throw null; } set { } } public string Note { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.CancelExceptionAction System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.CancelExceptionAction System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -40,6 +43,7 @@ public CancelJobOptions(string jobId) { } public string DispositionCode { get { throw null; } set { } } public string JobId { get { throw null; } } public string Note { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.CancelJobOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.CancelJobOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -56,6 +60,7 @@ public ClassificationPolicy(string classificationPolicyId) { } public Azure.Communication.JobRouter.RouterRule PrioritizationRule { get { throw null; } set { } } public System.Collections.Generic.IList QueueSelectorAttachments { get { throw null; } } public System.Collections.Generic.IList WorkerSelectorAttachments { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.ClassificationPolicy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.ClassificationPolicy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -70,6 +75,7 @@ public CloseJobOptions(string jobId, string assignmentId) { } public string DispositionCode { get { throw null; } set { } } public string JobId { get { throw null; } } public string Note { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.CloseJobOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.CloseJobOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -82,6 +88,7 @@ public CompleteJobOptions(string jobId, string assignmentId) { } public string AssignmentId { get { throw null; } } public string JobId { get { throw null; } } public string Note { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.CompleteJobOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.CompleteJobOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -93,6 +100,7 @@ public partial class ConditionalQueueSelectorAttachment : Azure.Communication.Jo public ConditionalQueueSelectorAttachment(Azure.Communication.JobRouter.RouterRule condition) { } public Azure.Communication.JobRouter.RouterRule Condition { get { throw null; } } public System.Collections.Generic.IList QueueSelectors { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.ConditionalQueueSelectorAttachment System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.ConditionalQueueSelectorAttachment System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -104,6 +112,7 @@ public partial class ConditionalWorkerSelectorAttachment : Azure.Communication.J public ConditionalWorkerSelectorAttachment(Azure.Communication.JobRouter.RouterRule condition) { } public Azure.Communication.JobRouter.RouterRule Condition { get { throw null; } } public System.Collections.Generic.IList WorkerSelectors { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.ConditionalWorkerSelectorAttachment System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.ConditionalWorkerSelectorAttachment System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -198,6 +207,7 @@ public DeclineJobOfferOptions(string workerId, string offerId) { } public string OfferId { get { throw null; } } public System.DateTimeOffset? RetryOfferAt { get { throw null; } set { } } public string WorkerId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.DeclineJobOfferOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.DeclineJobOfferOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -207,6 +217,7 @@ public DeclineJobOfferOptions(string workerId, string offerId) { } public partial class DirectMapRouterRule : Azure.Communication.JobRouter.RouterRule, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DirectMapRouterRule() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.DirectMapRouterRule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.DirectMapRouterRule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -220,6 +231,7 @@ protected DistributionMode() { } public Azure.Communication.JobRouter.DistributionModeKind Kind { get { throw null; } protected set { } } public int MaxConcurrentOffers { get { throw null; } set { } } public int MinConcurrentOffers { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.DistributionMode System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.DistributionMode System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -253,6 +265,7 @@ public DistributionPolicy(string distributionPolicyId) { } public Azure.Communication.JobRouter.DistributionMode Mode { get { throw null; } set { } } public string Name { get { throw null; } set { } } public System.TimeSpan? OfferExpiresAfter { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.DistributionPolicy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.DistributionPolicy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -264,6 +277,7 @@ public abstract partial class ExceptionAction : System.ClientModel.Primitives.IJ protected ExceptionAction() { } public string Id { get { throw null; } } public Azure.Communication.JobRouter.ExceptionActionKind Kind { get { throw null; } protected set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.ExceptionAction System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.ExceptionAction System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -296,6 +310,7 @@ public ExceptionPolicy(string exceptionPolicyId) { } public System.Collections.Generic.IList ExceptionRules { get { throw null; } } public string Id { get { throw null; } } public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.ExceptionPolicy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.ExceptionPolicy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -308,6 +323,7 @@ public ExceptionRule(string id, Azure.Communication.JobRouter.ExceptionTrigger t public System.Collections.Generic.IList Actions { get { throw null; } } public string Id { get { throw null; } } public Azure.Communication.JobRouter.ExceptionTrigger Trigger { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.ExceptionRule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.ExceptionRule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -318,6 +334,7 @@ public abstract partial class ExceptionTrigger : System.ClientModel.Primitives.I { protected ExceptionTrigger() { } public Azure.Communication.JobRouter.ExceptionTriggerKind Kind { get { throw null; } protected set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.ExceptionTrigger System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.ExceptionTrigger System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -346,6 +363,7 @@ public partial class ExpressionRouterRule : Azure.Communication.JobRouter.Router { public ExpressionRouterRule(string expression) { } public string Expression { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.ExpressionRouterRule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.ExpressionRouterRule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -357,6 +375,7 @@ public partial class FunctionRouterRule : Azure.Communication.JobRouter.RouterRu public FunctionRouterRule(System.Uri functionAppUri) { } public Azure.Communication.JobRouter.FunctionRouterRuleCredential Credential { get { throw null; } set { } } public System.Uri FunctionUri { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.FunctionRouterRule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.FunctionRouterRule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -367,6 +386,7 @@ public partial class FunctionRouterRuleCredential : System.ClientModel.Primitive { public FunctionRouterRuleCredential(string functionKey) { } public FunctionRouterRuleCredential(string appKey, string clientId) { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.FunctionRouterRuleCredential System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.FunctionRouterRuleCredential System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -377,6 +397,7 @@ public abstract partial class JobMatchingMode : System.ClientModel.Primitives.IJ { protected JobMatchingMode() { } public Azure.Communication.JobRouter.JobMatchingModeKind Kind { get { throw null; } protected set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.JobMatchingMode System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.JobMatchingMode System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -632,6 +653,7 @@ public static partial class JobRouterModelFactory public partial class LongestIdleMode : Azure.Communication.JobRouter.DistributionMode, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public LongestIdleMode() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.LongestIdleMode System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.LongestIdleMode System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -644,6 +666,7 @@ public ManualReclassifyExceptionAction() { } public int? Priority { get { throw null; } set { } } public string QueueId { get { throw null; } set { } } public System.Collections.Generic.IList WorkerSelectors { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.ManualReclassifyExceptionAction System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.ManualReclassifyExceptionAction System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -653,6 +676,7 @@ public ManualReclassifyExceptionAction() { } public partial class OAuth2WebhookClientCredential : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public OAuth2WebhookClientCredential(string clientId, string clientSecret) { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.OAuth2WebhookClientCredential System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.OAuth2WebhookClientCredential System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -664,6 +688,7 @@ public partial class PassThroughQueueSelectorAttachment : Azure.Communication.Jo public PassThroughQueueSelectorAttachment(string key, Azure.Communication.JobRouter.LabelOperator labelOperator) { } public string Key { get { throw null; } } public Azure.Communication.JobRouter.LabelOperator LabelOperator { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.PassThroughQueueSelectorAttachment System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.PassThroughQueueSelectorAttachment System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -676,6 +701,7 @@ public partial class PassThroughWorkerSelectorAttachment : Azure.Communication.J public System.TimeSpan? ExpiresAfter { get { throw null; } } public string Key { get { throw null; } } public Azure.Communication.JobRouter.LabelOperator LabelOperator { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.PassThroughWorkerSelectorAttachment System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.PassThroughWorkerSelectorAttachment System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -685,6 +711,7 @@ public partial class PassThroughWorkerSelectorAttachment : Azure.Communication.J public partial class QueueAndMatchMode : Azure.Communication.JobRouter.JobMatchingMode, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public QueueAndMatchMode() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.QueueAndMatchMode System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.QueueAndMatchMode System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -695,6 +722,7 @@ public partial class QueueLengthExceptionTrigger : Azure.Communication.JobRouter { public QueueLengthExceptionTrigger(int threshold) { } public int Threshold { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.QueueLengthExceptionTrigger System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.QueueLengthExceptionTrigger System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -705,6 +733,7 @@ public abstract partial class QueueSelectorAttachment : System.ClientModel.Primi { protected QueueSelectorAttachment() { } public Azure.Communication.JobRouter.QueueSelectorAttachmentKind Kind { get { throw null; } protected set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.QueueSelectorAttachment System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.QueueSelectorAttachment System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -737,6 +766,7 @@ public partial class QueueWeightedAllocation : System.ClientModel.Primitives.IJs public QueueWeightedAllocation(double weight, System.Collections.Generic.IEnumerable queueSelectors) { } public System.Collections.Generic.IReadOnlyList QueueSelectors { get { throw null; } } public double Weight { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.QueueWeightedAllocation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.QueueWeightedAllocation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -748,6 +778,7 @@ public partial class ReclassifyExceptionAction : Azure.Communication.JobRouter.E public ReclassifyExceptionAction() { } public string ClassificationPolicyId { get { throw null; } set { } } public System.Collections.Generic.IDictionary LabelsToUpsert { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.ReclassifyExceptionAction System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.ReclassifyExceptionAction System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -757,6 +788,7 @@ public ReclassifyExceptionAction() { } public partial class RoundRobinMode : Azure.Communication.JobRouter.DistributionMode, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public RoundRobinMode() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RoundRobinMode System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RoundRobinMode System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -769,6 +801,7 @@ public RouterChannel(string channelId, int capacityCostPerJob) { } public int CapacityCostPerJob { get { throw null; } } public string ChannelId { get { throw null; } } public int? MaxNumberOfJobs { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RouterChannel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RouterChannel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -796,6 +829,7 @@ public RouterJob(string jobId) { } public System.DateTimeOffset? ScheduledAt { get { throw null; } } public Azure.Communication.JobRouter.RouterJobStatus? Status { get { throw null; } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RouterJob System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RouterJob System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -810,6 +844,7 @@ internal RouterJobAssignment() { } public System.DateTimeOffset? ClosedAt { get { throw null; } } public System.DateTimeOffset? CompletedAt { get { throw null; } } public string WorkerId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RouterJobAssignment System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RouterJobAssignment System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -821,6 +856,7 @@ public partial class RouterJobNote : System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RouterJobNote System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -835,6 +871,7 @@ internal RouterJobOffer() { } public string JobId { get { throw null; } } public System.DateTimeOffset? OfferedAt { get { throw null; } } public string OfferId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RouterJobOffer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RouterJobOffer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -849,6 +886,7 @@ internal RouterJobPositionDetails() { } public int Position { get { throw null; } } public string QueueId { get { throw null; } } public int QueueLength { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RouterJobPositionDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RouterJobPositionDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -922,6 +960,7 @@ public RouterQueue(string queueId) { } public string Id { get { throw null; } } public System.Collections.Generic.IDictionary Labels { get { throw null; } } public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RouterQueue System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RouterQueue System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -934,6 +973,7 @@ public RouterQueueSelector(string key, Azure.Communication.JobRouter.LabelOperat public string Key { get { throw null; } } public Azure.Communication.JobRouter.LabelOperator LabelOperator { get { throw null; } } public Azure.Communication.JobRouter.RouterValue Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RouterQueueSelector System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RouterQueueSelector System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -947,6 +987,7 @@ internal RouterQueueStatistics() { } public int Length { get { throw null; } } public double? LongestJobWaitTimeMinutes { get { throw null; } } public string QueueId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RouterQueueStatistics System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RouterQueueStatistics System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -957,6 +998,7 @@ public abstract partial class RouterRule : System.ClientModel.Primitives.IJsonMo { protected RouterRule() { } public Azure.Communication.JobRouter.RouterRuleKind Kind { get { throw null; } protected set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RouterRule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RouterRule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1019,6 +1061,7 @@ public RouterWorker(string workerId) { } public System.Collections.Generic.IList Queues { get { throw null; } } public Azure.Communication.JobRouter.RouterWorkerState? State { get { throw null; } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RouterWorker System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RouterWorker System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1032,6 +1075,7 @@ internal RouterWorkerAssignment() { } public string AssignmentId { get { throw null; } } public int CapacityCost { get { throw null; } } public string JobId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RouterWorkerAssignment System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RouterWorkerAssignment System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1048,6 +1092,7 @@ public RouterWorkerSelector(string key, Azure.Communication.JobRouter.LabelOpera public Azure.Communication.JobRouter.LabelOperator LabelOperator { get { throw null; } } public Azure.Communication.JobRouter.RouterWorkerSelectorStatus? Status { get { throw null; } } public Azure.Communication.JobRouter.RouterValue Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RouterWorkerSelector System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RouterWorkerSelector System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1115,6 +1160,7 @@ public partial class RuleEngineQueueSelectorAttachment : Azure.Communication.Job { public RuleEngineQueueSelectorAttachment(Azure.Communication.JobRouter.RouterRule rule) { } public Azure.Communication.JobRouter.RouterRule Rule { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RuleEngineQueueSelectorAttachment System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RuleEngineQueueSelectorAttachment System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1125,6 +1171,7 @@ public partial class RuleEngineWorkerSelectorAttachment : Azure.Communication.Jo { public RuleEngineWorkerSelectorAttachment(Azure.Communication.JobRouter.RouterRule rule) { } public Azure.Communication.JobRouter.RouterRule Rule { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RuleEngineWorkerSelectorAttachment System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.RuleEngineWorkerSelectorAttachment System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1135,6 +1182,7 @@ public partial class ScheduleAndSuspendMode : Azure.Communication.JobRouter.JobM { public ScheduleAndSuspendMode(System.DateTimeOffset scheduleAt) { } public System.DateTimeOffset ScheduleAt { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.ScheduleAndSuspendMode System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.ScheduleAndSuspendMode System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1148,6 +1196,7 @@ public ScoringRuleOptions() { } public bool? DescendingOrder { get { throw null; } set { } } public bool? IsBatchScoringEnabled { get { throw null; } set { } } public System.Collections.Generic.IList ScoringParameters { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.ScoringRuleOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.ScoringRuleOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1176,6 +1225,7 @@ public partial class StaticQueueSelectorAttachment : Azure.Communication.JobRout { public StaticQueueSelectorAttachment(Azure.Communication.JobRouter.RouterQueueSelector queueSelector) { } public Azure.Communication.JobRouter.RouterQueueSelector QueueSelector { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.StaticQueueSelectorAttachment System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.StaticQueueSelectorAttachment System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1186,6 +1236,7 @@ public partial class StaticRouterRule : Azure.Communication.JobRouter.RouterRule { public StaticRouterRule(Azure.Communication.JobRouter.RouterValue value) { } public Azure.Communication.JobRouter.RouterValue Value { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.StaticRouterRule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.StaticRouterRule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1196,6 +1247,7 @@ public partial class StaticWorkerSelectorAttachment : Azure.Communication.JobRou { public StaticWorkerSelectorAttachment(Azure.Communication.JobRouter.RouterWorkerSelector workerSelector) { } public Azure.Communication.JobRouter.RouterWorkerSelector WorkerSelector { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.StaticWorkerSelectorAttachment System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.StaticWorkerSelectorAttachment System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1205,6 +1257,7 @@ public StaticWorkerSelectorAttachment(Azure.Communication.JobRouter.RouterWorker public partial class SuspendMode : Azure.Communication.JobRouter.JobMatchingMode, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public SuspendMode() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.SuspendMode System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.SuspendMode System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1217,6 +1270,7 @@ public UnassignJobOptions(string jobId, string assignmentId) { } public string AssignmentId { get { throw null; } } public string JobId { get { throw null; } } public bool? SuspendMatching { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.UnassignJobOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.UnassignJobOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1228,6 +1282,7 @@ public partial class UnassignJobResult : System.ClientModel.Primitives.IJsonMode internal UnassignJobResult() { } public string JobId { get { throw null; } } public int UnassignmentCount { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.UnassignJobResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.UnassignJobResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1238,6 +1293,7 @@ public partial class WaitTimeExceptionTrigger : Azure.Communication.JobRouter.Ex { public WaitTimeExceptionTrigger(System.TimeSpan threshold) { } public System.TimeSpan Threshold { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.WaitTimeExceptionTrigger System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.WaitTimeExceptionTrigger System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1250,6 +1306,7 @@ public WebhookRouterRule(System.Uri authorizationServerUri, Azure.Communication. public System.Uri AuthorizationServerUri { get { throw null; } } public Azure.Communication.JobRouter.OAuth2WebhookClientCredential ClientCredential { get { throw null; } } public System.Uri WebhookUri { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.WebhookRouterRule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.WebhookRouterRule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1260,6 +1317,7 @@ public partial class WeightedAllocationQueueSelectorAttachment : Azure.Communica { public WeightedAllocationQueueSelectorAttachment(System.Collections.Generic.IEnumerable allocations) { } public System.Collections.Generic.IReadOnlyList Allocations { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.WeightedAllocationQueueSelectorAttachment System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.WeightedAllocationQueueSelectorAttachment System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1270,6 +1328,7 @@ public partial class WeightedAllocationWorkerSelectorAttachment : Azure.Communic { public WeightedAllocationWorkerSelectorAttachment(System.Collections.Generic.IEnumerable allocations) { } public System.Collections.Generic.IReadOnlyList Allocations { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.WeightedAllocationWorkerSelectorAttachment System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.WeightedAllocationWorkerSelectorAttachment System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1280,6 +1339,7 @@ public abstract partial class WorkerSelectorAttachment : System.ClientModel.Prim { protected WorkerSelectorAttachment() { } public Azure.Communication.JobRouter.WorkerSelectorAttachmentKind Kind { get { throw null; } protected set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.WorkerSelectorAttachment System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.WorkerSelectorAttachment System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1312,6 +1372,7 @@ public partial class WorkerWeightedAllocation : System.ClientModel.Primitives.IJ public WorkerWeightedAllocation(double weight, System.Collections.Generic.IEnumerable workerSelectors) { } public double Weight { get { throw null; } } public System.Collections.Generic.IReadOnlyList WorkerSelectors { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.WorkerWeightedAllocation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.Communication.JobRouter.WorkerWeightedAllocation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/AcceptJobOfferResult.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/AcceptJobOfferResult.Serialization.cs index 2dec95138364..468e47076b0f 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/AcceptJobOfferResult.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/AcceptJobOfferResult.Serialization.cs @@ -18,6 +18,15 @@ public partial class AcceptJobOfferResult : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(AcceptJobOfferResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("assignmentId"u8); writer.WriteStringValue(AssignmentId); writer.WritePropertyName("jobId"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } AcceptJobOfferResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/BestWorkerMode.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/BestWorkerMode.Serialization.cs index 68d5ab1305c7..04e1cf5e22a8 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/BestWorkerMode.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/BestWorkerMode.Serialization.cs @@ -18,6 +18,15 @@ public partial class BestWorkerMode : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp throw new FormatException($"The model {nameof(BestWorkerMode)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(ScoringRule)) { writer.WritePropertyName("scoringRule"u8); @@ -36,33 +45,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp writer.WritePropertyName("scoringRuleOptions"u8); writer.WriteObjectValue(ScoringRuleOptions, options); } - writer.WritePropertyName("minConcurrentOffers"u8); - writer.WriteNumberValue(MinConcurrentOffers); - writer.WritePropertyName("maxConcurrentOffers"u8); - writer.WriteNumberValue(MaxConcurrentOffers); - if (Optional.IsDefined(BypassSelectors)) - { - writer.WritePropertyName("bypassSelectors"u8); - writer.WriteBooleanValue(BypassSelectors.Value); - } - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); } BestWorkerMode IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/CancelExceptionAction.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/CancelExceptionAction.Serialization.cs index 76a3cbba7218..6f407d537583 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/CancelExceptionAction.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/CancelExceptionAction.Serialization.cs @@ -18,6 +18,15 @@ public partial class CancelExceptionAction : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(CancelExceptionAction)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Note)) { writer.WritePropertyName("note"u8); @@ -36,29 +45,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW writer.WritePropertyName("dispositionCode"u8); writer.WriteStringValue(DispositionCode); } - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); } CancelExceptionAction IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/CancelJobOptions.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/CancelJobOptions.Serialization.cs index 167cab322c7d..9c7166b36ac5 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/CancelJobOptions.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/CancelJobOptions.Serialization.cs @@ -18,6 +18,15 @@ public partial class CancelJobOptions : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(CancelJobOptions)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Note)) { writer.WritePropertyName("note"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter #endif } } - writer.WriteEndObject(); } CancelJobOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/CancelJobResult.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/CancelJobResult.Serialization.cs index 7916324fb1e7..6c04b752df4f 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/CancelJobResult.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/CancelJobResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class CancelJobResult : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO throw new FormatException($"The model {nameof(CancelJobResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -41,7 +49,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO #endif } } - writer.WriteEndObject(); } CancelJobResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ClassificationPolicy.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ClassificationPolicy.Serialization.cs index 43530ba37b60..8042566e3150 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ClassificationPolicy.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ClassificationPolicy.Serialization.cs @@ -18,6 +18,15 @@ public partial class ClassificationPolicy : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(ClassificationPolicy)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W") { writer.WritePropertyName("etag"u8); @@ -86,7 +94,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } ClassificationPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/CloseJobOptions.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/CloseJobOptions.Serialization.cs index 4052a5e8a74f..920919a3ff73 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/CloseJobOptions.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/CloseJobOptions.Serialization.cs @@ -18,6 +18,15 @@ public partial class CloseJobOptions : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO throw new FormatException($"The model {nameof(CloseJobOptions)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(DispositionCode)) { writer.WritePropertyName("dispositionCode"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO #endif } } - writer.WriteEndObject(); } CloseJobOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/CloseJobResult.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/CloseJobResult.Serialization.cs index 0020a0eead5f..6f838253177b 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/CloseJobResult.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/CloseJobResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class CloseJobResult : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp throw new FormatException($"The model {nameof(CloseJobResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -41,7 +49,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp #endif } } - writer.WriteEndObject(); } CloseJobResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/CompleteJobOptions.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/CompleteJobOptions.Serialization.cs index 42b3ed034634..1d98f3243ebf 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/CompleteJobOptions.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/CompleteJobOptions.Serialization.cs @@ -18,6 +18,15 @@ public partial class CompleteJobOptions : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(CompleteJobOptions)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Note)) { writer.WritePropertyName("note"u8); @@ -46,7 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit #endif } } - writer.WriteEndObject(); } CompleteJobOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/CompleteJobResult.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/CompleteJobResult.Serialization.cs index 2cdd166620ad..b19c0ed046c0 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/CompleteJobResult.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/CompleteJobResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class CompleteJobResult : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite throw new FormatException($"The model {nameof(CompleteJobResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -41,7 +49,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite #endif } } - writer.WriteEndObject(); } CompleteJobResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ConditionalQueueSelectorAttachment.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ConditionalQueueSelectorAttachment.Serialization.cs index 37c17b92c1e3..fc8d651a1e28 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ConditionalQueueSelectorAttachment.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ConditionalQueueSelectorAttachment.Serialization.cs @@ -18,6 +18,15 @@ public partial class ConditionalQueueSelectorAttachment : IUtf8JsonSerializable, 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") @@ -25,7 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(ConditionalQueueSelectorAttachment)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("condition"u8); writer.WriteObjectValue(Condition, options); writer.WritePropertyName("queueSelectors"u8); @@ -35,24 +44,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); } ConditionalQueueSelectorAttachment IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ConditionalWorkerSelectorAttachment.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ConditionalWorkerSelectorAttachment.Serialization.cs index 31c3b066013a..83b1cf6fdcf5 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ConditionalWorkerSelectorAttachment.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ConditionalWorkerSelectorAttachment.Serialization.cs @@ -18,6 +18,15 @@ public partial class ConditionalWorkerSelectorAttachment : IUtf8JsonSerializable 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") @@ -25,7 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer throw new FormatException($"The model {nameof(ConditionalWorkerSelectorAttachment)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("condition"u8); writer.WriteObjectValue(Condition, options); writer.WritePropertyName("workerSelectors"u8); @@ -35,24 +44,6 @@ void IJsonModel.Write(Utf8JsonWriter writer writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); } ConditionalWorkerSelectorAttachment IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/DeclineJobOfferOptions.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/DeclineJobOfferOptions.Serialization.cs index f1923cda29df..c4030e0e4603 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/DeclineJobOfferOptions.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/DeclineJobOfferOptions.Serialization.cs @@ -18,6 +18,15 @@ public partial class DeclineJobOfferOptions : 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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(DeclineJobOfferOptions)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(RetryOfferAt)) { writer.WritePropertyName("retryOfferAt"u8); @@ -46,7 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } DeclineJobOfferOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/DeclineJobOfferResult.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/DeclineJobOfferResult.Serialization.cs index d22ae955c58e..21ce334aa65b 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/DeclineJobOfferResult.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/DeclineJobOfferResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class DeclineJobOfferResult : 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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(DeclineJobOfferResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -41,7 +49,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW #endif } } - writer.WriteEndObject(); } DeclineJobOfferResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/DirectMapRouterRule.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/DirectMapRouterRule.Serialization.cs index db34947e5d31..b83ef09caab3 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/DirectMapRouterRule.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/DirectMapRouterRule.Serialization.cs @@ -18,6 +18,15 @@ public partial class DirectMapRouterRule : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,25 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(DirectMapRouterRule)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } DirectMapRouterRule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/DistributionMode.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/DistributionMode.Serialization.cs index 22880d7269c9..dd6d7eec867c 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/DistributionMode.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/DistributionMode.Serialization.cs @@ -18,6 +18,15 @@ public partial class DistributionMode : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(DistributionMode)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("minConcurrentOffers"u8); writer.WriteNumberValue(MinConcurrentOffers); writer.WritePropertyName("maxConcurrentOffers"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter #endif } } - writer.WriteEndObject(); } DistributionMode IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/DistributionPolicy.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/DistributionPolicy.Serialization.cs index f97a7252be54..4cf35ced397b 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/DistributionPolicy.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/DistributionPolicy.Serialization.cs @@ -18,6 +18,15 @@ public partial class DistributionPolicy : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(DistributionPolicy)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W") { writer.WritePropertyName("etag"u8); @@ -66,7 +74,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit #endif } } - writer.WriteEndObject(); } DistributionPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ExceptionAction.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ExceptionAction.Serialization.cs index 00d379ff0e04..a7779c2e16f6 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ExceptionAction.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ExceptionAction.Serialization.cs @@ -18,6 +18,15 @@ public partial class ExceptionAction : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO throw new FormatException($"The model {nameof(ExceptionAction)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -48,7 +56,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO #endif } } - writer.WriteEndObject(); } ExceptionAction IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ExceptionPolicy.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ExceptionPolicy.Serialization.cs index b804ccecaa89..18c429f0fa67 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ExceptionPolicy.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ExceptionPolicy.Serialization.cs @@ -18,6 +18,15 @@ public partial class ExceptionPolicy : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO throw new FormatException($"The model {nameof(ExceptionPolicy)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W") { writer.WritePropertyName("etag"u8); @@ -66,7 +74,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO #endif } } - writer.WriteEndObject(); } ExceptionPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ExceptionRule.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ExceptionRule.Serialization.cs index 7e018b3e04c6..19c1ca74e36d 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ExceptionRule.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ExceptionRule.Serialization.cs @@ -18,6 +18,15 @@ public partial class ExceptionRule : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpt throw new FormatException($"The model {nameof(ExceptionRule)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); writer.WritePropertyName("trigger"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpt #endif } } - writer.WriteEndObject(); } ExceptionRule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ExceptionTrigger.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ExceptionTrigger.Serialization.cs index 1ed706a8c2cd..69537a069d76 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ExceptionTrigger.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ExceptionTrigger.Serialization.cs @@ -18,6 +18,15 @@ public partial class ExceptionTrigger : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(ExceptionTrigger)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("kind"u8); writer.WriteStringValue(Kind.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -43,7 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter #endif } } - writer.WriteEndObject(); } ExceptionTrigger IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ExpressionRouterRule.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ExpressionRouterRule.Serialization.cs index ae6f62a8d938..65b0958f8801 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ExpressionRouterRule.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ExpressionRouterRule.Serialization.cs @@ -18,6 +18,15 @@ public partial class ExpressionRouterRule : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(ExpressionRouterRule)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Language)) { writer.WritePropertyName("language"u8); @@ -33,24 +42,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr } writer.WritePropertyName("expression"u8); writer.WriteStringValue(Expression); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); } ExpressionRouterRule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/FunctionRouterRule.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/FunctionRouterRule.Serialization.cs index e13c3afc2d6e..6bb6938d1910 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/FunctionRouterRule.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/FunctionRouterRule.Serialization.cs @@ -18,6 +18,15 @@ public partial class FunctionRouterRule : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(FunctionRouterRule)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("functionUri"u8); writer.WriteStringValue(FunctionUri.AbsoluteUri); if (Optional.IsDefined(Credential)) @@ -33,24 +42,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("credential"u8); writer.WriteObjectValue(Credential, options); } - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); } FunctionRouterRule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/FunctionRouterRuleCredential.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/FunctionRouterRuleCredential.Serialization.cs index e062659e6a58..068e23273036 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/FunctionRouterRuleCredential.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/FunctionRouterRuleCredential.Serialization.cs @@ -18,6 +18,15 @@ public partial class FunctionRouterRuleCredential : IUtf8JsonSerializable, IJson 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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(FunctionRouterRuleCredential)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(FunctionKey)) { writer.WritePropertyName("functionKey"u8); @@ -56,7 +64,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } FunctionRouterRuleCredential IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/JobMatchingMode.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/JobMatchingMode.Serialization.cs index 9467b3aa52df..b733aaa30ea3 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/JobMatchingMode.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/JobMatchingMode.Serialization.cs @@ -18,6 +18,15 @@ public partial class JobMatchingMode : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO throw new FormatException($"The model {nameof(JobMatchingMode)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("kind"u8); writer.WriteStringValue(Kind.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -43,7 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO #endif } } - writer.WriteEndObject(); } JobMatchingMode IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/LongestIdleMode.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/LongestIdleMode.Serialization.cs index 129f28a5dbd3..3e9047daaf05 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/LongestIdleMode.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/LongestIdleMode.Serialization.cs @@ -18,6 +18,15 @@ public partial class LongestIdleMode : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,34 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO throw new FormatException($"The model {nameof(LongestIdleMode)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - writer.WritePropertyName("minConcurrentOffers"u8); - writer.WriteNumberValue(MinConcurrentOffers); - writer.WritePropertyName("maxConcurrentOffers"u8); - writer.WriteNumberValue(MaxConcurrentOffers); - if (Optional.IsDefined(BypassSelectors)) - { - writer.WritePropertyName("bypassSelectors"u8); - writer.WriteBooleanValue(BypassSelectors.Value); - } - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } LongestIdleMode IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ManualReclassifyExceptionAction.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ManualReclassifyExceptionAction.Serialization.cs index 07510404a4cf..6cfcddff643c 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ManualReclassifyExceptionAction.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ManualReclassifyExceptionAction.Serialization.cs @@ -18,6 +18,15 @@ public partial class ManualReclassifyExceptionAction : IUtf8JsonSerializable, IJ 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") @@ -25,7 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo throw new FormatException($"The model {nameof(ManualReclassifyExceptionAction)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(QueueId)) { writer.WritePropertyName("queueId"u8); @@ -46,29 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo } writer.WriteEndArray(); } - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); } ManualReclassifyExceptionAction IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/OAuth2WebhookClientCredential.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/OAuth2WebhookClientCredential.Serialization.cs index a4c89cb77c9a..dd04ca42e597 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/OAuth2WebhookClientCredential.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/OAuth2WebhookClientCredential.Serialization.cs @@ -18,6 +18,15 @@ public partial class OAuth2WebhookClientCredential : IUtf8JsonSerializable, IJso 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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(OAuth2WebhookClientCredential)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ClientId)) { writer.WritePropertyName("clientId"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode #endif } } - writer.WriteEndObject(); } OAuth2WebhookClientCredential IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/PassThroughQueueSelectorAttachment.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/PassThroughQueueSelectorAttachment.Serialization.cs index d33eba8441d5..f27be9365eab 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/PassThroughQueueSelectorAttachment.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/PassThroughQueueSelectorAttachment.Serialization.cs @@ -18,6 +18,15 @@ public partial class PassThroughQueueSelectorAttachment : IUtf8JsonSerializable, 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") @@ -25,29 +34,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(PassThroughQueueSelectorAttachment)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("key"u8); writer.WriteStringValue(Key); writer.WritePropertyName("labelOperator"u8); writer.WriteStringValue(LabelOperator.ToString()); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); } PassThroughQueueSelectorAttachment IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/PassThroughWorkerSelectorAttachment.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/PassThroughWorkerSelectorAttachment.Serialization.cs index 6fd846f2f4c8..f530fe5bbcc5 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/PassThroughWorkerSelectorAttachment.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/PassThroughWorkerSelectorAttachment.Serialization.cs @@ -18,6 +18,15 @@ public partial class PassThroughWorkerSelectorAttachment : IUtf8JsonSerializable 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") @@ -25,7 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer throw new FormatException($"The model {nameof(PassThroughWorkerSelectorAttachment)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("key"u8); writer.WriteStringValue(Key); writer.WritePropertyName("labelOperator"u8); @@ -35,24 +44,6 @@ void IJsonModel.Write(Utf8JsonWriter writer writer.WritePropertyName("expiresAfterSeconds"u8); WriteExpiresAfter(writer, options); } - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); } PassThroughWorkerSelectorAttachment IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/QueueAndMatchMode.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/QueueAndMatchMode.Serialization.cs index 325875ef7031..3bf152940416 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/QueueAndMatchMode.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/QueueAndMatchMode.Serialization.cs @@ -18,6 +18,15 @@ public partial class QueueAndMatchMode : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,25 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite throw new FormatException($"The model {nameof(QueueAndMatchMode)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } QueueAndMatchMode IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/QueueLengthExceptionTrigger.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/QueueLengthExceptionTrigger.Serialization.cs index 669c02c7fd37..ff86b0131f25 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/QueueLengthExceptionTrigger.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/QueueLengthExceptionTrigger.Serialization.cs @@ -18,6 +18,15 @@ public partial class QueueLengthExceptionTrigger : IUtf8JsonSerializable, IJsonM 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") @@ -25,27 +34,9 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(QueueLengthExceptionTrigger)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("threshold"u8); writer.WriteNumberValue(Threshold); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); } QueueLengthExceptionTrigger IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/QueueSelectorAttachment.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/QueueSelectorAttachment.Serialization.cs index eadb6812c3df..ffefe0652c09 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/QueueSelectorAttachment.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/QueueSelectorAttachment.Serialization.cs @@ -18,6 +18,15 @@ public partial class QueueSelectorAttachment : 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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(QueueSelectorAttachment)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("kind"u8); writer.WriteStringValue(Kind.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -43,7 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } QueueSelectorAttachment IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/QueueWeightedAllocation.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/QueueWeightedAllocation.Serialization.cs index 63a51bdde060..72eb8edaee45 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/QueueWeightedAllocation.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/QueueWeightedAllocation.Serialization.cs @@ -18,6 +18,15 @@ public partial class QueueWeightedAllocation : 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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(QueueWeightedAllocation)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("weight"u8); writer.WriteNumberValue(Weight); writer.WritePropertyName("queueSelectors"u8); @@ -50,7 +58,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } QueueWeightedAllocation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ReclassifyExceptionAction.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ReclassifyExceptionAction.Serialization.cs index eaef96c62c52..f9b48b2d1673 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ReclassifyExceptionAction.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ReclassifyExceptionAction.Serialization.cs @@ -18,6 +18,15 @@ public partial class ReclassifyExceptionAction : IUtf8JsonSerializable, IJsonMod 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") @@ -25,7 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(ReclassifyExceptionAction)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(ClassificationPolicyId)) { writer.WritePropertyName("classificationPolicyId"u8); @@ -54,29 +63,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea } writer.WriteEndObject(); } - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); } ReclassifyExceptionAction IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ReclassifyJobOptions.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ReclassifyJobOptions.Serialization.cs index 5ca425949f7d..753129fa0659 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ReclassifyJobOptions.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ReclassifyJobOptions.Serialization.cs @@ -18,6 +18,15 @@ internal partial class ReclassifyJobOptions : 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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(ReclassifyJobOptions)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -41,7 +49,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } ReclassifyJobOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ReclassifyJobResult.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ReclassifyJobResult.Serialization.cs index 4c2874a41bac..0646b7f06f8c 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ReclassifyJobResult.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ReclassifyJobResult.Serialization.cs @@ -18,6 +18,15 @@ internal partial class ReclassifyJobResult : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(ReclassifyJobResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -41,7 +49,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri #endif } } - writer.WriteEndObject(); } ReclassifyJobResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RoundRobinMode.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RoundRobinMode.Serialization.cs index 4f80c45f00dd..f4b7e5890c49 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RoundRobinMode.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RoundRobinMode.Serialization.cs @@ -18,6 +18,15 @@ public partial class RoundRobinMode : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,34 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp throw new FormatException($"The model {nameof(RoundRobinMode)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - writer.WritePropertyName("minConcurrentOffers"u8); - writer.WriteNumberValue(MinConcurrentOffers); - writer.WritePropertyName("maxConcurrentOffers"u8); - writer.WriteNumberValue(MaxConcurrentOffers); - if (Optional.IsDefined(BypassSelectors)) - { - writer.WritePropertyName("bypassSelectors"u8); - writer.WriteBooleanValue(BypassSelectors.Value); - } - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } RoundRobinMode IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterChannel.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterChannel.Serialization.cs index e3077b9a7311..0f8294c0d6f3 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterChannel.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterChannel.Serialization.cs @@ -18,6 +18,15 @@ public partial class RouterChannel : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpt throw new FormatException($"The model {nameof(RouterChannel)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("channelId"u8); writer.WriteStringValue(ChannelId); writer.WritePropertyName("capacityCostPerJob"u8); @@ -50,7 +58,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpt #endif } } - writer.WriteEndObject(); } RouterChannel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterJob.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterJob.Serialization.cs index 3aa14f6e8bd4..174dc7bda259 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterJob.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterJob.Serialization.cs @@ -18,6 +18,15 @@ public partial class RouterJob : 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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions throw new FormatException($"The model {nameof(RouterJob)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W") { writer.WritePropertyName("etag"u8); @@ -188,7 +196,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions #endif } } - writer.WriteEndObject(); } RouterJob IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterJobAssignment.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterJobAssignment.Serialization.cs index 7a2d872cfe07..5b3beb458099 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterJobAssignment.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterJobAssignment.Serialization.cs @@ -18,6 +18,15 @@ public partial class RouterJobAssignment : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(RouterJobAssignment)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W") { writer.WritePropertyName("assignmentId"u8); @@ -63,7 +71,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri #endif } } - writer.WriteEndObject(); } RouterJobAssignment IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterJobNote.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterJobNote.Serialization.cs index 2d160299dea4..fbd0f4f7de0f 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterJobNote.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterJobNote.Serialization.cs @@ -18,6 +18,15 @@ public partial class RouterJobNote : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpt throw new FormatException($"The model {nameof(RouterJobNote)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("message"u8); writer.WriteStringValue(Message); if (Optional.IsDefined(AddedAt)) @@ -48,7 +56,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpt #endif } } - writer.WriteEndObject(); } RouterJobNote IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterJobOffer.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterJobOffer.Serialization.cs index 213e644ff3b9..1eebe3af8a6a 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterJobOffer.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterJobOffer.Serialization.cs @@ -18,6 +18,15 @@ public partial class RouterJobOffer : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp throw new FormatException($"The model {nameof(RouterJobOffer)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W") { writer.WritePropertyName("offerId"u8); @@ -60,7 +68,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp #endif } } - writer.WriteEndObject(); } RouterJobOffer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterJobPositionDetails.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterJobPositionDetails.Serialization.cs index 42854e26a139..b15c80f0c6ad 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterJobPositionDetails.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterJobPositionDetails.Serialization.cs @@ -18,6 +18,15 @@ public partial class RouterJobPositionDetails : IUtf8JsonSerializable, IJsonMode 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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(RouterJobPositionDetails)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("jobId"u8); writer.WriteStringValue(JobId); writer.WritePropertyName("position"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } RouterJobPositionDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterQueue.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterQueue.Serialization.cs index 3125489cd513..50f25ed7afff 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterQueue.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterQueue.Serialization.cs @@ -18,6 +18,15 @@ public partial class RouterQueue : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptio throw new FormatException($"The model {nameof(RouterQueue)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W") { writer.WritePropertyName("etag"u8); @@ -82,7 +90,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptio #endif } } - writer.WriteEndObject(); } RouterQueue IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterQueueSelector.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterQueueSelector.Serialization.cs index 9d27fde36026..073506f6eb93 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterQueueSelector.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterQueueSelector.Serialization.cs @@ -18,6 +18,15 @@ public partial class RouterQueueSelector : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(RouterQueueSelector)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("key"u8); writer.WriteStringValue(Key); writer.WritePropertyName("labelOperator"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri #endif } } - writer.WriteEndObject(); } RouterQueueSelector IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterQueueStatistics.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterQueueStatistics.Serialization.cs index ae66b3af51b1..ed3308864946 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterQueueStatistics.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterQueueStatistics.Serialization.cs @@ -18,6 +18,15 @@ public partial class RouterQueueStatistics : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(RouterQueueStatistics)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("queueId"u8); writer.WriteStringValue(QueueId); writer.WritePropertyName("length"u8); @@ -55,7 +63,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW #endif } } - writer.WriteEndObject(); } RouterQueueStatistics IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterRule.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterRule.Serialization.cs index 7147af1b7456..9b0556bd41ac 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterRule.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterRule.Serialization.cs @@ -18,6 +18,15 @@ public partial class RouterRule : 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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption throw new FormatException($"The model {nameof(RouterRule)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("kind"u8); writer.WriteStringValue(Kind.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -43,7 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption #endif } } - writer.WriteEndObject(); } RouterRule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterWorker.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterWorker.Serialization.cs index 8611dc4b7689..03e6ccf1502e 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterWorker.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterWorker.Serialization.cs @@ -18,6 +18,15 @@ public partial class RouterWorker : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpti throw new FormatException($"The model {nameof(RouterWorker)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W") { writer.WritePropertyName("etag"u8); @@ -162,7 +170,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpti #endif } } - writer.WriteEndObject(); } RouterWorker IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterWorkerAssignment.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterWorkerAssignment.Serialization.cs index 667534b57334..5610eacce823 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterWorkerAssignment.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterWorkerAssignment.Serialization.cs @@ -18,6 +18,15 @@ public partial class RouterWorkerAssignment : 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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(RouterWorkerAssignment)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("assignmentId"u8); writer.WriteStringValue(AssignmentId); writer.WritePropertyName("jobId"u8); @@ -49,7 +57,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } RouterWorkerAssignment IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterWorkerSelector.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterWorkerSelector.Serialization.cs index f41ab6488f8a..8bb8df7f4164 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterWorkerSelector.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RouterWorkerSelector.Serialization.cs @@ -18,6 +18,15 @@ public partial class RouterWorkerSelector : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(RouterWorkerSelector)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("key"u8); writer.WriteStringValue(Key); writer.WritePropertyName("labelOperator"u8); @@ -77,7 +85,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } RouterWorkerSelector IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RuleEngineQueueSelectorAttachment.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RuleEngineQueueSelectorAttachment.Serialization.cs index 231fc0d6675c..64ba4250e6e2 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RuleEngineQueueSelectorAttachment.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RuleEngineQueueSelectorAttachment.Serialization.cs @@ -18,6 +18,15 @@ public partial class RuleEngineQueueSelectorAttachment : IUtf8JsonSerializable, 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") @@ -25,27 +34,9 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(RuleEngineQueueSelectorAttachment)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("rule"u8); writer.WriteObjectValue(Rule, options); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); } RuleEngineQueueSelectorAttachment IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RuleEngineWorkerSelectorAttachment.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RuleEngineWorkerSelectorAttachment.Serialization.cs index aa6b5ce28bee..02e6e0a2c678 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/RuleEngineWorkerSelectorAttachment.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/RuleEngineWorkerSelectorAttachment.Serialization.cs @@ -18,6 +18,15 @@ public partial class RuleEngineWorkerSelectorAttachment : IUtf8JsonSerializable, 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") @@ -25,27 +34,9 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(RuleEngineWorkerSelectorAttachment)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("rule"u8); writer.WriteObjectValue(Rule, options); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); } RuleEngineWorkerSelectorAttachment IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ScheduleAndSuspendMode.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ScheduleAndSuspendMode.Serialization.cs index e844ce99f9f2..44a7a9c5b6a0 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ScheduleAndSuspendMode.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ScheduleAndSuspendMode.Serialization.cs @@ -18,6 +18,15 @@ public partial class ScheduleAndSuspendMode : 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") @@ -25,27 +34,9 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(ScheduleAndSuspendMode)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("scheduleAt"u8); writer.WriteStringValue(ScheduleAt, "O"); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); } ScheduleAndSuspendMode IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ScoringRuleOptions.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ScoringRuleOptions.Serialization.cs index ed73d3b8df53..5433121b5004 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/ScoringRuleOptions.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/ScoringRuleOptions.Serialization.cs @@ -18,6 +18,15 @@ public partial class ScoringRuleOptions : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ScoringRuleOptions)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(BatchSize)) { writer.WritePropertyName("batchSize"u8); @@ -66,7 +74,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit #endif } } - writer.WriteEndObject(); } ScoringRuleOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/StaticQueueSelectorAttachment.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/StaticQueueSelectorAttachment.Serialization.cs index d178d9d47b63..9640d0251768 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/StaticQueueSelectorAttachment.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/StaticQueueSelectorAttachment.Serialization.cs @@ -18,6 +18,15 @@ public partial class StaticQueueSelectorAttachment : IUtf8JsonSerializable, IJso 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") @@ -25,27 +34,9 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(StaticQueueSelectorAttachment)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("queueSelector"u8); writer.WriteObjectValue(QueueSelector, options); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); } StaticQueueSelectorAttachment IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/StaticRouterRule.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/StaticRouterRule.Serialization.cs index cd807df3deca..9a4923c12a68 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/StaticRouterRule.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/StaticRouterRule.Serialization.cs @@ -18,6 +18,15 @@ public partial class StaticRouterRule : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(StaticRouterRule)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(_value)) { writer.WritePropertyName("value"u8); @@ -38,24 +47,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter } #endif } - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); } StaticRouterRule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/StaticWorkerSelectorAttachment.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/StaticWorkerSelectorAttachment.Serialization.cs index bc51c69badf8..b2bde8e2e04e 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/StaticWorkerSelectorAttachment.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/StaticWorkerSelectorAttachment.Serialization.cs @@ -18,6 +18,15 @@ public partial class StaticWorkerSelectorAttachment : IUtf8JsonSerializable, IJs 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") @@ -25,27 +34,9 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(StaticWorkerSelectorAttachment)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("workerSelector"u8); writer.WriteObjectValue(WorkerSelector, options); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); } StaticWorkerSelectorAttachment IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/SuspendMode.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/SuspendMode.Serialization.cs index 395b625e9d3c..6b12d53db958 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/SuspendMode.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/SuspendMode.Serialization.cs @@ -18,6 +18,15 @@ public partial class SuspendMode : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,25 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptio throw new FormatException($"The model {nameof(SuspendMode)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } SuspendMode IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnassignJobOptions.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnassignJobOptions.Serialization.cs index cc71e0b25891..5b5bf69c15aa 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnassignJobOptions.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnassignJobOptions.Serialization.cs @@ -18,6 +18,15 @@ public partial class UnassignJobOptions : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(UnassignJobOptions)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(SuspendMatching)) { writer.WritePropertyName("suspendMatching"u8); @@ -46,7 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit #endif } } - writer.WriteEndObject(); } UnassignJobOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnassignJobResult.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnassignJobResult.Serialization.cs index 7d2d41b9664c..b4e32cad9b45 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnassignJobResult.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnassignJobResult.Serialization.cs @@ -18,6 +18,15 @@ public partial class UnassignJobResult : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite throw new FormatException($"The model {nameof(UnassignJobResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("jobId"u8); writer.WriteStringValue(JobId); writer.WritePropertyName("unassignmentCount"u8); @@ -45,7 +53,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite #endif } } - writer.WriteEndObject(); } UnassignJobResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownDistributionMode.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownDistributionMode.Serialization.cs index 16bd524db302..b4c8de54fa4b 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownDistributionMode.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownDistributionMode.Serialization.cs @@ -18,6 +18,15 @@ internal partial class UnknownDistributionMode : IUtf8JsonSerializable, IJsonMod 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") @@ -25,34 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(DistributionMode)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - writer.WritePropertyName("minConcurrentOffers"u8); - writer.WriteNumberValue(MinConcurrentOffers); - writer.WritePropertyName("maxConcurrentOffers"u8); - writer.WriteNumberValue(MaxConcurrentOffers); - if (Optional.IsDefined(BypassSelectors)) - { - writer.WritePropertyName("bypassSelectors"u8); - writer.WriteBooleanValue(BypassSelectors.Value); - } - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } DistributionMode IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownExceptionAction.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownExceptionAction.Serialization.cs index 4702546ca90e..4437ff635bb9 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownExceptionAction.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownExceptionAction.Serialization.cs @@ -18,6 +18,15 @@ internal partial class UnknownExceptionAction : IUtf8JsonSerializable, IJsonMode 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") @@ -25,30 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO throw new FormatException($"The model {nameof(ExceptionAction)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } ExceptionAction IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownExceptionTrigger.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownExceptionTrigger.Serialization.cs index c68b8e787092..7116f0dcc367 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownExceptionTrigger.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownExceptionTrigger.Serialization.cs @@ -18,6 +18,15 @@ internal partial class UnknownExceptionTrigger : IUtf8JsonSerializable, IJsonMod 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") @@ -25,25 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(ExceptionTrigger)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } ExceptionTrigger IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownJobMatchingMode.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownJobMatchingMode.Serialization.cs index 12543a2262ff..68f5fe9e1cec 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownJobMatchingMode.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownJobMatchingMode.Serialization.cs @@ -18,6 +18,15 @@ internal partial class UnknownJobMatchingMode : IUtf8JsonSerializable, IJsonMode 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") @@ -25,25 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO throw new FormatException($"The model {nameof(JobMatchingMode)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } JobMatchingMode IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownQueueSelectorAttachment.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownQueueSelectorAttachment.Serialization.cs index 460c4fed6069..ab3a5ac66ca2 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownQueueSelectorAttachment.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownQueueSelectorAttachment.Serialization.cs @@ -18,6 +18,15 @@ internal partial class UnknownQueueSelectorAttachment : IUtf8JsonSerializable, I 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") @@ -25,25 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(QueueSelectorAttachment)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } QueueSelectorAttachment IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownRouterRule.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownRouterRule.Serialization.cs index f4f2dffec276..b021291f5905 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownRouterRule.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownRouterRule.Serialization.cs @@ -18,6 +18,15 @@ internal partial class UnknownRouterRule : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,25 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption throw new FormatException($"The model {nameof(RouterRule)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } RouterRule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownWorkerSelectorAttachment.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownWorkerSelectorAttachment.Serialization.cs index b944c991364b..95b5018fdddf 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownWorkerSelectorAttachment.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/UnknownWorkerSelectorAttachment.Serialization.cs @@ -18,6 +18,15 @@ internal partial class UnknownWorkerSelectorAttachment : IUtf8JsonSerializable, 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") @@ -25,25 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(WorkerSelectorAttachment)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } WorkerSelectorAttachment IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/WaitTimeExceptionTrigger.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/WaitTimeExceptionTrigger.Serialization.cs index b50c1aa8324c..d9349254f922 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/WaitTimeExceptionTrigger.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/WaitTimeExceptionTrigger.Serialization.cs @@ -18,6 +18,15 @@ public partial class WaitTimeExceptionTrigger : IUtf8JsonSerializable, IJsonMode 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") @@ -25,27 +34,9 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(WaitTimeExceptionTrigger)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("thresholdSeconds"u8); WriteThresholdSeconds(writer, options); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); } WaitTimeExceptionTrigger IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/WebhookRouterRule.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/WebhookRouterRule.Serialization.cs index 6898c721adcf..d3c543e6c59f 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/WebhookRouterRule.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/WebhookRouterRule.Serialization.cs @@ -18,6 +18,15 @@ public partial class WebhookRouterRule : IUtf8JsonSerializable, IJsonModel ((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") @@ -25,7 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite throw new FormatException($"The model {nameof(WebhookRouterRule)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(AuthorizationServerUri)) { writer.WritePropertyName("authorizationServerUri"u8); @@ -41,24 +50,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite writer.WritePropertyName("webhookUri"u8); writer.WriteStringValue(WebhookUri.AbsoluteUri); } - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); } WebhookRouterRule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/WeightedAllocationQueueSelectorAttachment.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/WeightedAllocationQueueSelectorAttachment.Serialization.cs index 7ff203680058..d77076f21b79 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/WeightedAllocationQueueSelectorAttachment.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/WeightedAllocationQueueSelectorAttachment.Serialization.cs @@ -18,6 +18,15 @@ public partial class WeightedAllocationQueueSelectorAttachment : IUtf8JsonSerial 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") @@ -25,7 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter throw new FormatException($"The model {nameof(WeightedAllocationQueueSelectorAttachment)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("allocations"u8); writer.WriteStartArray(); foreach (var item in Allocations) @@ -33,24 +42,6 @@ void IJsonModel.Write(Utf8JsonWriter writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); } WeightedAllocationQueueSelectorAttachment IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/WeightedAllocationWorkerSelectorAttachment.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/WeightedAllocationWorkerSelectorAttachment.Serialization.cs index d55e95bff857..47d286d413c9 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/WeightedAllocationWorkerSelectorAttachment.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/WeightedAllocationWorkerSelectorAttachment.Serialization.cs @@ -18,6 +18,15 @@ public partial class WeightedAllocationWorkerSelectorAttachment : IUtf8JsonSeria 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") @@ -25,7 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter throw new FormatException($"The model {nameof(WeightedAllocationWorkerSelectorAttachment)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("allocations"u8); writer.WriteStartArray(); foreach (var item in Allocations) @@ -33,24 +42,6 @@ void IJsonModel.Write(Utf8JsonWriter writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - 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 - } - } - writer.WriteEndObject(); } WeightedAllocationWorkerSelectorAttachment IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/WorkerSelectorAttachment.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/WorkerSelectorAttachment.Serialization.cs index 16dac75e0b7c..d63b66759c61 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/WorkerSelectorAttachment.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/WorkerSelectorAttachment.Serialization.cs @@ -18,6 +18,15 @@ public partial class WorkerSelectorAttachment : IUtf8JsonSerializable, IJsonMode 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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(WorkerSelectorAttachment)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("kind"u8); writer.WriteStringValue(Kind.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -43,7 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } WorkerSelectorAttachment IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/src/Generated/WorkerWeightedAllocation.Serialization.cs b/sdk/communication/Azure.Communication.JobRouter/src/Generated/WorkerWeightedAllocation.Serialization.cs index d5f387295071..7a098f15a210 100644 --- a/sdk/communication/Azure.Communication.JobRouter/src/Generated/WorkerWeightedAllocation.Serialization.cs +++ b/sdk/communication/Azure.Communication.JobRouter/src/Generated/WorkerWeightedAllocation.Serialization.cs @@ -18,6 +18,15 @@ public partial class WorkerWeightedAllocation : IUtf8JsonSerializable, IJsonMode 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") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(WorkerWeightedAllocation)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("weight"u8); writer.WriteNumberValue(Weight); writer.WritePropertyName("workerSelectors"u8); @@ -50,7 +58,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } WorkerWeightedAllocation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/communication/Azure.Communication.JobRouter/tsp-location.yaml b/sdk/communication/Azure.Communication.JobRouter/tsp-location.yaml index 4076cbb60368..1202eba0627e 100644 --- a/sdk/communication/Azure.Communication.JobRouter/tsp-location.yaml +++ b/sdk/communication/Azure.Communication.JobRouter/tsp-location.yaml @@ -1,5 +1,4 @@ -commit: 6a4cd586934a8478cc84c677afc49c4f149f8d87 directory: specification/communication/Communication.JobRouter -additionalDirectories: [] +commit: f9d5fd11157637ffaf212edcf133e596363f5d04 repo: Azure/azure-rest-api-specs - +additionalDirectories: