diff --git a/sdk/communication/Azure.Communication.CallingServer/api/Azure.Communication.CallingServer.netstandard2.0.cs b/sdk/communication/Azure.Communication.CallingServer/api/Azure.Communication.CallingServer.netstandard2.0.cs index ad7c0ef05010..e7ba80c29dab 100644 --- a/sdk/communication/Azure.Communication.CallingServer/api/Azure.Communication.CallingServer.netstandard2.0.cs +++ b/sdk/communication/Azure.Communication.CallingServer/api/Azure.Communication.CallingServer.netstandard2.0.cs @@ -7,10 +7,10 @@ internal AddParticipantResult() { } } public partial class AddParticipantResultEvent : Azure.Communication.CallingServer.CallingServerEventBase { - public AddParticipantResultEvent() { } - public string OperationContext { get { throw null; } set { } } - public Azure.Communication.CallingServer.ResultInfo ResultInfo { get { throw null; } set { } } - public Azure.Communication.CallingServer.OperationStatus? Status { get { throw null; } set { } } + internal AddParticipantResultEvent() { } + public string OperationContext { get { throw null; } } + public Azure.Communication.CallingServer.ResultInfo ResultInfo { get { throw null; } } + public Azure.Communication.CallingServer.OperationStatus Status { get { throw null; } } public static Azure.Communication.CallingServer.AddParticipantResultEvent Deserialize(string content) { throw null; } } public partial class CallConnection @@ -53,10 +53,10 @@ protected CallConnection() { } } public partial class CallConnectionStateChangedEvent : Azure.Communication.CallingServer.CallingServerEventBase { - public CallConnectionStateChangedEvent() { } - public string CallConnectionId { get { throw null; } set { } } - public Azure.Communication.CallingServer.CallConnectionState? CallConnectionState { get { throw null; } set { } } - public string ServerCallId { get { throw null; } set { } } + internal CallConnectionStateChangedEvent() { } + public string CallConnectionId { get { throw null; } } + public Azure.Communication.CallingServer.CallConnectionState CallConnectionState { get { throw null; } } + public string ServerCallId { get { throw null; } } public static Azure.Communication.CallingServer.CallConnectionStateChangedEvent Deserialize(string content) { throw null; } } public partial class CallingServerClient @@ -64,6 +64,7 @@ public partial class CallingServerClient protected CallingServerClient() { } public CallingServerClient(string connectionString) { } public CallingServerClient(string connectionString, Azure.Communication.CallingServer.CallingServerClientOptions options) { } + public CallingServerClient(System.Uri endpoint, string connectionString, Azure.Communication.CallingServer.CallingServerClientOptions options = null) { } public virtual Azure.Response CreateCallConnection(Azure.Communication.CommunicationIdentifier source, System.Collections.Generic.IEnumerable targets, Azure.Communication.CallingServer.CreateCallOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> CreateCallConnectionAsync(Azure.Communication.CommunicationIdentifier source, System.Collections.Generic.IEnumerable targets, Azure.Communication.CallingServer.CreateCallOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response DownloadStreaming(System.Uri sourceEndpoint, Azure.HttpRange range = default(Azure.HttpRange), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -85,20 +86,6 @@ public enum ServiceVersion V2021_06_15_Preview = 1, } } - public partial class CallingServerError - { - internal CallingServerError() { } - public string Code { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Details { get { throw null; } } - public Azure.Communication.CallingServer.CallingServerError InnerError { get { throw null; } } - public string Message { get { throw null; } } - public string Target { get { throw null; } } - } - public partial class CallingServerErrorResponse - { - internal CallingServerErrorResponse() { } - public Azure.Communication.CallingServer.CallingServerError Error { get { throw null; } } - } public abstract partial class CallingServerEventBase { protected CallingServerEventBase() { } @@ -124,18 +111,32 @@ protected CallingServerEventBase() { } public static bool operator !=(Azure.Communication.CallingServer.CallingServerEventType left, Azure.Communication.CallingServer.CallingServerEventType right) { throw null; } public override string ToString() { throw null; } } + public static partial class CallingServerModelFactory + { + public static Azure.Communication.CallingServer.AddParticipantResult AddParticipantResult(string participantId = null) { throw null; } + public static Azure.Communication.CallingServer.AddParticipantResultEvent AddParticipantResultEvent(Azure.Communication.CallingServer.ResultInfo resultInfo = null, string operationContext = null, Azure.Communication.CallingServer.OperationStatus status = default(Azure.Communication.CallingServer.OperationStatus)) { throw null; } + public static Azure.Communication.CallingServer.CallConnectionStateChangedEvent CallConnectionStateChangedEvent(string serverCallId = null, string callConnectionId = null, Azure.Communication.CallingServer.CallConnectionState callConnectionState = default(Azure.Communication.CallingServer.CallConnectionState)) { throw null; } + public static Azure.Communication.CallingServer.CallRecordingProperties CallRecordingProperties(Azure.Communication.CallingServer.CallRecordingState recordingState = default(Azure.Communication.CallingServer.CallRecordingState)) { throw null; } + public static Azure.Communication.CallingServer.CallRecordingStateChangeEvent CallRecordingStateChangeEvent(string recordingId = null, Azure.Communication.CallingServer.CallRecordingState state = default(Azure.Communication.CallingServer.CallRecordingState), System.DateTimeOffset startDateTime = default(System.DateTimeOffset), string serverCallId = null) { throw null; } + public static Azure.Communication.CallingServer.CancelAllMediaOperationsResult CancelAllMediaOperationsResult(string operationId = null, Azure.Communication.CallingServer.OperationStatus status = default(Azure.Communication.CallingServer.OperationStatus), string operationContext = null, Azure.Communication.CallingServer.ResultInfo resultInfo = null) { throw null; } + public static Azure.Communication.CallingServer.PlayAudioResult PlayAudioResult(string operationId = null, Azure.Communication.CallingServer.OperationStatus status = default(Azure.Communication.CallingServer.OperationStatus), string operationContext = null, Azure.Communication.CallingServer.ResultInfo resultInfo = null) { throw null; } + public static Azure.Communication.CallingServer.PlayAudioResultEvent PlayAudioResultEvent(Azure.Communication.CallingServer.ResultInfo resultInfo = null, string operationContext = null, Azure.Communication.CallingServer.OperationStatus status = default(Azure.Communication.CallingServer.OperationStatus)) { throw null; } + public static Azure.Communication.CallingServer.ResultInfo ResultInfo(int code = 0, int subcode = 0, string message = null) { throw null; } + public static Azure.Communication.CallingServer.StartCallRecordingResult StartCallRecordingResult(string recordingId = null) { throw null; } + public static Azure.Communication.CallingServer.ToneInfo ToneInfo(int sequenceId = 0, Azure.Communication.CallingServer.ToneValue tone = default(Azure.Communication.CallingServer.ToneValue)) { throw null; } + public static Azure.Communication.CallingServer.ToneReceivedEvent ToneReceivedEvent(Azure.Communication.CallingServer.ToneInfo toneInfo = null, string callConnectionId = null) { throw null; } + } public partial class CallParticipant { - public CallParticipant() { } - public CallParticipant(Azure.Communication.CommunicationIdentifier identifier, string participantId, bool? isMuted) { } - public Azure.Communication.CommunicationIdentifier Identifier { get { throw null; } set { } } - public bool? IsMuted { get { throw null; } set { } } - public string ParticipantId { get { throw null; } set { } } + internal CallParticipant() { } + public Azure.Communication.CommunicationIdentifier Identifier { get { throw null; } } + public bool IsMuted { get { throw null; } } + public string ParticipantId { get { throw null; } } } public partial class CallRecordingProperties { internal CallRecordingProperties() { } - public Azure.Communication.CallingServer.CallRecordingState? RecordingState { get { throw null; } } + public Azure.Communication.CallingServer.CallRecordingState RecordingState { get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct CallRecordingState : System.IEquatable @@ -157,11 +158,11 @@ internal CallRecordingProperties() { } } public partial class CallRecordingStateChangeEvent : Azure.Communication.CallingServer.CallingServerEventBase { - public CallRecordingStateChangeEvent() { } - public string RecordingId { get { throw null; } set { } } - public string ServerCallId { get { throw null; } set { } } - public System.DateTimeOffset? StartDateTime { get { throw null; } set { } } - public Azure.Communication.CallingServer.CallRecordingState? State { get { throw null; } set { } } + internal CallRecordingStateChangeEvent() { } + public string RecordingId { get { throw null; } } + public string ServerCallId { get { throw null; } } + public System.DateTimeOffset StartDateTime { get { throw null; } } + public Azure.Communication.CallingServer.CallRecordingState State { get { throw null; } } public static Azure.Communication.CallingServer.CallRecordingStateChangeEvent Deserialize(string content) { throw null; } } public partial class CancelAllMediaOperationsResult @@ -170,15 +171,7 @@ internal CancelAllMediaOperationsResult() { } public string OperationContext { get { throw null; } } public string OperationId { get { throw null; } } public Azure.Communication.CallingServer.ResultInfo ResultInfo { get { throw null; } } - public Azure.Communication.CallingServer.OperationStatus? Status { get { throw null; } } - } - public partial class CommunicationParticipant - { - public CommunicationParticipant() { } - public CommunicationParticipant(Azure.Communication.CommunicationIdentifier identifier, string participantId, bool? isMuted) { } - public Azure.Communication.CommunicationIdentifier Identifier { get { throw null; } set { } } - public bool? IsMuted { get { throw null; } set { } } - public string ParticipantId { get { throw null; } set { } } + public Azure.Communication.CallingServer.OperationStatus Status { get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct ContentTransferOptions : System.IEquatable @@ -272,9 +265,9 @@ public JoinCallOptions(System.Uri callbackUri, System.Collections.Generic.IEnume } public partial class ParticipantsUpdatedEvent : Azure.Communication.CallingServer.CallingServerEventBase { - public ParticipantsUpdatedEvent() { } - public string CallConnectionId { get { throw null; } set { } } - public System.Collections.Generic.IEnumerable Participants { get { throw null; } set { } } + internal ParticipantsUpdatedEvent() { } + public string CallConnectionId { get { throw null; } } + public System.Collections.Generic.IEnumerable Participants { get { throw null; } } public static Azure.Communication.CallingServer.ParticipantsUpdatedEvent Deserialize(string content) { throw null; } } public partial class PlayAudioOptions @@ -292,22 +285,22 @@ internal PlayAudioResult() { } public string OperationContext { get { throw null; } } public string OperationId { get { throw null; } } public Azure.Communication.CallingServer.ResultInfo ResultInfo { get { throw null; } } - public Azure.Communication.CallingServer.OperationStatus? Status { get { throw null; } } + public Azure.Communication.CallingServer.OperationStatus Status { get { throw null; } } } public partial class PlayAudioResultEvent : Azure.Communication.CallingServer.CallingServerEventBase { - public PlayAudioResultEvent() { } - public string OperationContext { get { throw null; } set { } } - public Azure.Communication.CallingServer.ResultInfo ResultInfo { get { throw null; } set { } } - public Azure.Communication.CallingServer.OperationStatus? Status { get { throw null; } set { } } + internal PlayAudioResultEvent() { } + public string OperationContext { get { throw null; } } + public Azure.Communication.CallingServer.ResultInfo ResultInfo { get { throw null; } } + public Azure.Communication.CallingServer.OperationStatus Status { get { throw null; } } public static Azure.Communication.CallingServer.PlayAudioResultEvent Deserialize(string content) { throw null; } } public partial class ResultInfo { internal ResultInfo() { } - public int? Code { get { throw null; } } + public int Code { get { throw null; } } public string Message { get { throw null; } } - public int? Subcode { get { throw null; } } + public int Subcode { get { throw null; } } } public partial class ServerCall { @@ -336,15 +329,15 @@ internal StartCallRecordingResult() { } } public partial class ToneInfo { - public ToneInfo() { } - public int? SequenceId { get { throw null; } set { } } - public Azure.Communication.CallingServer.ToneValue? Tone { get { throw null; } set { } } + internal ToneInfo() { } + public int SequenceId { get { throw null; } } + public Azure.Communication.CallingServer.ToneValue Tone { get { throw null; } } } public partial class ToneReceivedEvent : Azure.Communication.CallingServer.CallingServerEventBase { - public ToneReceivedEvent() { } - public string CallConnectionId { get { throw null; } set { } } - public Azure.Communication.CallingServer.ToneInfo ToneInfo { get { throw null; } set { } } + internal ToneReceivedEvent() { } + public string CallConnectionId { get { throw null; } } + public Azure.Communication.CallingServer.ToneInfo ToneInfo { get { throw null; } } public static Azure.Communication.CallingServer.ToneReceivedEvent Deserialize(string content) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/CallingServerModelFactory.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/CallingServerModelFactory.cs index d68cb269c6c0..85c9d387ab42 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/CallingServerModelFactory.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/CallingServerModelFactory.cs @@ -5,63 +5,30 @@ #nullable disable -using System.Collections.Generic; +using System; namespace Azure.Communication.CallingServer { /// Model factory for read-only models. - internal static partial class CallingServerModelFactory + public static partial class CallingServerModelFactory { - /// Initializes new instance of CallingServerErrorResponse class. - /// The Communication Services error. - /// A new instance for mocking. - public static CallingServerErrorResponse CallingServerErrorResponse(CallingServerError error = default) - { - return new CallingServerErrorResponse(error); - } - - /// Initializes new instance of CallingServerError class. - /// The error code. - /// The error message. - /// The error target. - /// Further details about specific errors that led to this error. - /// The inner error if any. - /// A new instance for mocking. - public static CallingServerError CallingServerError(string code = default, string message = default, string target = default, IReadOnlyList details = default, CallingServerError innerError = default) - { - details ??= new List(); - return new CallingServerError(code, message, target, details, innerError); - } - /// Initializes new instance of PlayAudioResult class. /// The operation id. /// The status of the operation. /// The operation context provided by client. /// The result info for the operation. /// A new instance for mocking. - public static PlayAudioResult PlayAudioResult(string operationId = default, OperationStatus? status = default, string operationContext = default, ResultInfo resultInfo = default) + public static PlayAudioResult PlayAudioResult(string operationId = default, OperationStatus status = default, string operationContext = default, ResultInfo resultInfo = default) { return new PlayAudioResult(operationId, status, operationContext, resultInfo); } /// Initializes new instance of ResultInfo class. - /// - /// Gets or sets the result code - /// - /// For synchronous failures, this maps one-to-one with HTTP responses. For asynchronous failures or messages, it is contextual. - /// - /// - /// Gets or sets the result subcode. - /// - /// The subcode further classifies a failure. For example. - /// - /// - /// Gets or sets the message - /// - /// The message is a detail explanation of subcode. - /// + /// The result code associated with the operation. + /// The subcode that further classifies the result. + /// The message is a detail explanation of subcode. /// A new instance for mocking. - public static ResultInfo ResultInfo(int? code = default, int? subcode = default, string message = default) + public static ResultInfo ResultInfo(int code = default, int subcode = default, string message = default) { return new ResultInfo(code, subcode, message); } @@ -72,7 +39,7 @@ public static ResultInfo ResultInfo(int? code = default, int? subcode = default, /// The operation context provided by client. /// The result info for the operation. /// A new instance for mocking. - public static CancelAllMediaOperationsResult CancelAllMediaOperationsResult(string operationId = default, OperationStatus? status = default, string operationContext = default, ResultInfo resultInfo = default) + public static CancelAllMediaOperationsResult CancelAllMediaOperationsResult(string operationId = default, OperationStatus status = default, string operationContext = default, ResultInfo resultInfo = default) { return new CancelAllMediaOperationsResult(operationId, status, operationContext, resultInfo); } @@ -96,9 +63,68 @@ public static StartCallRecordingResult StartCallRecordingResult(string recording /// Initializes new instance of CallRecordingProperties class. /// The state of the recording. /// A new instance for mocking. - public static CallRecordingProperties CallRecordingProperties(CallRecordingState? recordingState = default) + public static CallRecordingProperties CallRecordingProperties(CallRecordingState recordingState = default) { return new CallRecordingProperties(recordingState); } + + /// Initializes new instance of CallConnectionStateChangedEvent class. + /// The server call.id. + /// The call connection id. + /// The call connection state. + /// A new instance for mocking. + public static CallConnectionStateChangedEvent CallConnectionStateChangedEvent(string serverCallId = default, string callConnectionId = default, CallConnectionState callConnectionState = default) + { + return new CallConnectionStateChangedEvent(serverCallId, callConnectionId, callConnectionState); + } + + /// Initializes new instance of CallRecordingStateChangeEvent class. + /// The call recording id. + /// The state of the recording. + /// The time of the recording started. + /// The server call.id. + /// A new instance for mocking. + public static CallRecordingStateChangeEvent CallRecordingStateChangeEvent(string recordingId = default, CallRecordingState state = default, DateTimeOffset startDateTime = default, string serverCallId = default) + { + return new CallRecordingStateChangeEvent(recordingId, state, startDateTime, serverCallId); + } + + /// Initializes new instance of AddParticipantResultEvent class. + /// The result details. + /// The operation context. + /// The status of the operation. + /// A new instance for mocking. + public static AddParticipantResultEvent AddParticipantResultEvent(ResultInfo resultInfo = default, string operationContext = default, OperationStatus status = default) + { + return new AddParticipantResultEvent(resultInfo, operationContext, status); + } + + /// Initializes new instance of PlayAudioResultEvent class. + /// The result details. + /// The operation context. + /// The status of the operation. + /// A new instance for mocking. + public static PlayAudioResultEvent PlayAudioResultEvent(ResultInfo resultInfo = default, string operationContext = default, OperationStatus status = default) + { + return new PlayAudioResultEvent(resultInfo, operationContext, status); + } + + /// Initializes new instance of ToneReceivedEvent class. + /// The tone info. + /// The call connection id. + /// A new instance for mocking. + public static ToneReceivedEvent ToneReceivedEvent(ToneInfo toneInfo = default, string callConnectionId = default) + { + return new ToneReceivedEvent(toneInfo, callConnectionId); + } + + /// Initializes new instance of ToneInfo class. + /// The sequence id which can be used to determine if the same tone was played multiple times or if any tones were missed. + /// The tone value. + /// A new instance for mocking. + public static ToneInfo ToneInfo(int sequenceId = default, ToneValue tone = default) + { + return new ToneInfo(sequenceId, tone); + } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/AddParticipantResultEvent.Serialization.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/AddParticipantResultEvent.Serialization.cs index dfce79698015..05004943a343 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/AddParticipantResultEvent.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/AddParticipantResultEvent.Serialization.cs @@ -10,34 +10,13 @@ namespace Azure.Communication.CallingServer { - public partial class AddParticipantResultEvent : IUtf8JsonSerializable + public partial class AddParticipantResultEvent { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(ResultInfo)) - { - writer.WritePropertyName("resultInfo"); - writer.WriteObjectValue(ResultInfo); - } - if (Optional.IsDefined(OperationContext)) - { - writer.WritePropertyName("operationContext"); - writer.WriteStringValue(OperationContext); - } - if (Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"); - writer.WriteStringValue(Status.Value.ToString()); - } - writer.WriteEndObject(); - } - internal static AddParticipantResultEvent DeserializeAddParticipantResultEvent(JsonElement element) { Optional resultInfo = default; Optional operationContext = default; - Optional status = default; + OperationStatus status = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("resultInfo")) @@ -57,16 +36,11 @@ internal static AddParticipantResultEvent DeserializeAddParticipantResultEvent(J } if (property.NameEquals("status")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } status = new OperationStatus(property.Value.GetString()); continue; } } - return new AddParticipantResultEvent(resultInfo.Value, operationContext.Value, Optional.ToNullable(status)); + return new AddParticipantResultEvent(resultInfo.Value, operationContext.Value, status); } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/AddParticipantResultEvent.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/AddParticipantResultEvent.cs index 56749193ca03..e2bae28a24b4 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/AddParticipantResultEvent.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/AddParticipantResultEvent.cs @@ -11,15 +11,17 @@ namespace Azure.Communication.CallingServer public partial class AddParticipantResultEvent { /// Initializes a new instance of AddParticipantResultEvent. - public AddParticipantResultEvent() + /// The status of the operation. + internal AddParticipantResultEvent(OperationStatus status) { + Status = status; } /// Initializes a new instance of AddParticipantResultEvent. /// The result details. /// The operation context. /// The status of the operation. - internal AddParticipantResultEvent(ResultInfo resultInfo, string operationContext, OperationStatus? status) + internal AddParticipantResultEvent(ResultInfo resultInfo, string operationContext, OperationStatus status) { ResultInfo = resultInfo; OperationContext = operationContext; @@ -27,10 +29,10 @@ internal AddParticipantResultEvent(ResultInfo resultInfo, string operationContex } /// The result details. - public ResultInfo ResultInfo { get; set; } + public ResultInfo ResultInfo { get; } /// The operation context. - public string OperationContext { get; set; } + public string OperationContext { get; } /// The status of the operation. - public OperationStatus? Status { get; set; } + public OperationStatus Status { get; } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallConnectionStateChangedEvent.Serialization.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallConnectionStateChangedEvent.Serialization.cs index 34d2a466305f..06d4e92a9768 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallConnectionStateChangedEvent.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallConnectionStateChangedEvent.Serialization.cs @@ -10,34 +10,13 @@ namespace Azure.Communication.CallingServer { - public partial class CallConnectionStateChangedEvent : IUtf8JsonSerializable + public partial class CallConnectionStateChangedEvent { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(ServerCallId)) - { - writer.WritePropertyName("serverCallId"); - writer.WriteStringValue(ServerCallId); - } - if (Optional.IsDefined(CallConnectionId)) - { - writer.WritePropertyName("callConnectionId"); - writer.WriteStringValue(CallConnectionId); - } - if (Optional.IsDefined(CallConnectionState)) - { - writer.WritePropertyName("callConnectionState"); - writer.WriteStringValue(CallConnectionState.Value.ToString()); - } - writer.WriteEndObject(); - } - internal static CallConnectionStateChangedEvent DeserializeCallConnectionStateChangedEvent(JsonElement element) { Optional serverCallId = default; Optional callConnectionId = default; - Optional callConnectionState = default; + CallConnectionState callConnectionState = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("serverCallId")) @@ -52,16 +31,11 @@ internal static CallConnectionStateChangedEvent DeserializeCallConnectionStateCh } if (property.NameEquals("callConnectionState")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } callConnectionState = new CallConnectionState(property.Value.GetString()); continue; } } - return new CallConnectionStateChangedEvent(serverCallId.Value, callConnectionId.Value, Optional.ToNullable(callConnectionState)); + return new CallConnectionStateChangedEvent(serverCallId.Value, callConnectionId.Value, callConnectionState); } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallConnectionStateChangedEvent.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallConnectionStateChangedEvent.cs index 5c8e2cf301cd..c15300cdded3 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallConnectionStateChangedEvent.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallConnectionStateChangedEvent.cs @@ -11,15 +11,17 @@ namespace Azure.Communication.CallingServer public partial class CallConnectionStateChangedEvent { /// Initializes a new instance of CallConnectionStateChangedEvent. - public CallConnectionStateChangedEvent() + /// The call connection state. + internal CallConnectionStateChangedEvent(CallConnectionState callConnectionState) { + CallConnectionState = callConnectionState; } /// Initializes a new instance of CallConnectionStateChangedEvent. /// The server call.id. /// The call connection id. /// The call connection state. - internal CallConnectionStateChangedEvent(string serverCallId, string callConnectionId, CallConnectionState? callConnectionState) + internal CallConnectionStateChangedEvent(string serverCallId, string callConnectionId, CallConnectionState callConnectionState) { ServerCallId = serverCallId; CallConnectionId = callConnectionId; @@ -27,10 +29,10 @@ internal CallConnectionStateChangedEvent(string serverCallId, string callConnect } /// The server call.id. - public string ServerCallId { get; set; } + public string ServerCallId { get; } /// The call connection id. - public string CallConnectionId { get; set; } + public string CallConnectionId { get; } /// The call connection state. - public CallConnectionState? CallConnectionState { get; set; } + public CallConnectionState CallConnectionState { get; } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallParticipantInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallParticipantInternal.Serialization.cs index 480fbb9f01c9..87a9c9e45f00 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallParticipantInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallParticipantInternal.Serialization.cs @@ -17,7 +17,7 @@ internal static CallParticipantInternal DeserializeCallParticipantInternal(JsonE { Optional identifier = default; Optional participantId = default; - Optional isMuted = default; + bool isMuted = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("identifier")) @@ -37,16 +37,11 @@ internal static CallParticipantInternal DeserializeCallParticipantInternal(JsonE } if (property.NameEquals("isMuted")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } isMuted = property.Value.GetBoolean(); continue; } } - return new CallParticipantInternal(identifier.Value, participantId.Value, Optional.ToNullable(isMuted)); + return new CallParticipantInternal(identifier.Value, participantId.Value, isMuted); } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallParticipantInternal.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallParticipantInternal.cs index a840ce9e3e9a..d0e9755d677f 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallParticipantInternal.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallParticipantInternal.cs @@ -13,15 +13,17 @@ namespace Azure.Communication.CallingServer internal partial class CallParticipantInternal { /// Initializes a new instance of CallParticipantInternal. - internal CallParticipantInternal() + /// Is participant muted. + internal CallParticipantInternal(bool isMuted) { + IsMuted = isMuted; } /// Initializes a new instance of CallParticipantInternal. /// Communication identifier of the participant. /// Participant id. /// Is participant muted. - internal CallParticipantInternal(CommunicationIdentifierModel identifier, string participantId, bool? isMuted) + internal CallParticipantInternal(CommunicationIdentifierModel identifier, string participantId, bool isMuted) { Identifier = identifier; ParticipantId = participantId; @@ -33,6 +35,6 @@ internal CallParticipantInternal(CommunicationIdentifierModel identifier, string /// Participant id. public string ParticipantId { get; } /// Is participant muted. - public bool? IsMuted { get; } + public bool IsMuted { get; } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallRecordingProperties.Serialization.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallRecordingProperties.Serialization.cs index 479e1acab0f5..44eca4f22244 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallRecordingProperties.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallRecordingProperties.Serialization.cs @@ -14,21 +14,16 @@ public partial class CallRecordingProperties { internal static CallRecordingProperties DeserializeCallRecordingProperties(JsonElement element) { - Optional recordingState = default; + CallRecordingState recordingState = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("recordingState")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } recordingState = new CallRecordingState(property.Value.GetString()); continue; } } - return new CallRecordingProperties(Optional.ToNullable(recordingState)); + return new CallRecordingProperties(recordingState); } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallRecordingProperties.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallRecordingProperties.cs index a1c5a425552c..64daf6f9d92b 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallRecordingProperties.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallRecordingProperties.cs @@ -10,19 +10,14 @@ namespace Azure.Communication.CallingServer /// The response payload of get call recording properties operation. public partial class CallRecordingProperties { - /// Initializes a new instance of CallRecordingProperties. - internal CallRecordingProperties() - { - } - /// Initializes a new instance of CallRecordingProperties. /// The state of the recording. - internal CallRecordingProperties(CallRecordingState? recordingState) + internal CallRecordingProperties(CallRecordingState recordingState) { RecordingState = recordingState; } /// The state of the recording. - public CallRecordingState? RecordingState { get; } + public CallRecordingState RecordingState { get; } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallRecordingStateChangeEvent.Serialization.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallRecordingStateChangeEvent.Serialization.cs index 8cf96514201e..a36e9962460c 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallRecordingStateChangeEvent.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallRecordingStateChangeEvent.Serialization.cs @@ -11,39 +11,13 @@ namespace Azure.Communication.CallingServer { - public partial class CallRecordingStateChangeEvent : IUtf8JsonSerializable + public partial class CallRecordingStateChangeEvent { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(RecordingId)) - { - writer.WritePropertyName("recordingId"); - writer.WriteStringValue(RecordingId); - } - if (Optional.IsDefined(State)) - { - writer.WritePropertyName("state"); - writer.WriteStringValue(State.Value.ToString()); - } - if (Optional.IsDefined(StartDateTime)) - { - writer.WritePropertyName("startDateTime"); - writer.WriteStringValue(StartDateTime.Value, "O"); - } - if (Optional.IsDefined(ServerCallId)) - { - writer.WritePropertyName("serverCallId"); - writer.WriteStringValue(ServerCallId); - } - writer.WriteEndObject(); - } - internal static CallRecordingStateChangeEvent DeserializeCallRecordingStateChangeEvent(JsonElement element) { Optional recordingId = default; - Optional state = default; - Optional startDateTime = default; + CallRecordingState state = default; + DateTimeOffset startDateTime = default; Optional serverCallId = default; foreach (var property in element.EnumerateObject()) { @@ -54,21 +28,11 @@ internal static CallRecordingStateChangeEvent DeserializeCallRecordingStateChang } if (property.NameEquals("state")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } state = new CallRecordingState(property.Value.GetString()); continue; } if (property.NameEquals("startDateTime")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } startDateTime = property.Value.GetDateTimeOffset("O"); continue; } @@ -78,7 +42,7 @@ internal static CallRecordingStateChangeEvent DeserializeCallRecordingStateChang continue; } } - return new CallRecordingStateChangeEvent(recordingId.Value, Optional.ToNullable(state), Optional.ToNullable(startDateTime), serverCallId.Value); + return new CallRecordingStateChangeEvent(recordingId.Value, state, startDateTime, serverCallId.Value); } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallRecordingStateChangeEvent.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallRecordingStateChangeEvent.cs index c55feb5e4623..481668aa3cbf 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallRecordingStateChangeEvent.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallRecordingStateChangeEvent.cs @@ -13,8 +13,12 @@ namespace Azure.Communication.CallingServer public partial class CallRecordingStateChangeEvent { /// Initializes a new instance of CallRecordingStateChangeEvent. - public CallRecordingStateChangeEvent() + /// The state of the recording. + /// The time of the recording started. + internal CallRecordingStateChangeEvent(CallRecordingState state, DateTimeOffset startDateTime) { + State = state; + StartDateTime = startDateTime; } /// Initializes a new instance of CallRecordingStateChangeEvent. @@ -22,7 +26,7 @@ public CallRecordingStateChangeEvent() /// The state of the recording. /// The time of the recording started. /// The server call.id. - internal CallRecordingStateChangeEvent(string recordingId, CallRecordingState? state, DateTimeOffset? startDateTime, string serverCallId) + internal CallRecordingStateChangeEvent(string recordingId, CallRecordingState state, DateTimeOffset startDateTime, string serverCallId) { RecordingId = recordingId; State = state; @@ -31,12 +35,12 @@ internal CallRecordingStateChangeEvent(string recordingId, CallRecordingState? s } /// The call recording id. - public string RecordingId { get; set; } + public string RecordingId { get; } /// The state of the recording. - public CallRecordingState? State { get; set; } + public CallRecordingState State { get; } /// The time of the recording started. - public DateTimeOffset? StartDateTime { get; set; } + public DateTimeOffset StartDateTime { get; } /// The server call.id. - public string ServerCallId { get; set; } + public string ServerCallId { get; } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CancelAllMediaOperationsResult.Serialization.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CancelAllMediaOperationsResult.Serialization.cs index d8c16f6c8110..0d94214912ba 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CancelAllMediaOperationsResult.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CancelAllMediaOperationsResult.Serialization.cs @@ -15,7 +15,7 @@ public partial class CancelAllMediaOperationsResult internal static CancelAllMediaOperationsResult DeserializeCancelAllMediaOperationsResult(JsonElement element) { Optional operationId = default; - Optional status = default; + OperationStatus status = default; Optional operationContext = default; Optional resultInfo = default; foreach (var property in element.EnumerateObject()) @@ -27,11 +27,6 @@ internal static CancelAllMediaOperationsResult DeserializeCancelAllMediaOperatio } if (property.NameEquals("status")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } status = new OperationStatus(property.Value.GetString()); continue; } @@ -51,7 +46,7 @@ internal static CancelAllMediaOperationsResult DeserializeCancelAllMediaOperatio continue; } } - return new CancelAllMediaOperationsResult(operationId.Value, Optional.ToNullable(status), operationContext.Value, resultInfo.Value); + return new CancelAllMediaOperationsResult(operationId.Value, status, operationContext.Value, resultInfo.Value); } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CancelAllMediaOperationsResult.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CancelAllMediaOperationsResult.cs index 284371432b62..e31e114e93f7 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CancelAllMediaOperationsResult.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CancelAllMediaOperationsResult.cs @@ -11,8 +11,10 @@ namespace Azure.Communication.CallingServer public partial class CancelAllMediaOperationsResult { /// Initializes a new instance of CancelAllMediaOperationsResult. - internal CancelAllMediaOperationsResult() + /// The status of the operation. + internal CancelAllMediaOperationsResult(OperationStatus status) { + Status = status; } /// Initializes a new instance of CancelAllMediaOperationsResult. @@ -20,7 +22,7 @@ internal CancelAllMediaOperationsResult() /// The status of the operation. /// The operation context provided by client. /// The result info for the operation. - internal CancelAllMediaOperationsResult(string operationId, OperationStatus? status, string operationContext, ResultInfo resultInfo) + internal CancelAllMediaOperationsResult(string operationId, OperationStatus status, string operationContext, ResultInfo resultInfo) { OperationId = operationId; Status = status; @@ -31,7 +33,7 @@ internal CancelAllMediaOperationsResult(string operationId, OperationStatus? sta /// The operation id. public string OperationId { get; } /// The status of the operation. - public OperationStatus? Status { get; } + public OperationStatus Status { get; } /// The operation context provided by client. public string OperationContext { get; } /// The result info for the operation. diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallingServerError.Serialization.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CommunicationError.Serialization.cs similarity index 78% rename from sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallingServerError.Serialization.cs rename to sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CommunicationError.Serialization.cs index f8ec6aff366a..5780944bde3f 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallingServerError.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CommunicationError.Serialization.cs @@ -11,15 +11,15 @@ namespace Azure.Communication.CallingServer { - public partial class CallingServerError + internal partial class CommunicationError { - internal static CallingServerError DeserializeCallingServerError(JsonElement element) + internal static CommunicationError DeserializeCommunicationError(JsonElement element) { string code = default; string message = default; Optional target = default; - Optional> details = default; - Optional innererror = default; + Optional> details = default; + Optional innererror = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("code")) @@ -44,10 +44,10 @@ internal static CallingServerError DeserializeCallingServerError(JsonElement ele property.ThrowNonNullablePropertyIsNull(); continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(DeserializeCallingServerError(item)); + array.Add(DeserializeCommunicationError(item)); } details = array; continue; @@ -59,11 +59,11 @@ internal static CallingServerError DeserializeCallingServerError(JsonElement ele property.ThrowNonNullablePropertyIsNull(); continue; } - innererror = DeserializeCallingServerError(property.Value); + innererror = DeserializeCommunicationError(property.Value); continue; } } - return new CallingServerError(code, message, target.Value, Optional.ToList(details), innererror.Value); + return new CommunicationError(code, message, target.Value, Optional.ToList(details), innererror.Value); } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallingServerError.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CommunicationError.cs similarity index 75% rename from sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallingServerError.cs rename to sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CommunicationError.cs index be322746cd54..fe89cb6d3c0f 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallingServerError.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CommunicationError.cs @@ -12,13 +12,13 @@ namespace Azure.Communication.CallingServer { /// The Communication Services error. - public partial class CallingServerError + internal partial class CommunicationError { - /// Initializes a new instance of CallingServerError. + /// Initializes a new instance of CommunicationError. /// The error code. /// The error message. /// or is null. - internal CallingServerError(string code, string message) + internal CommunicationError(string code, string message) { if (code == null) { @@ -31,16 +31,16 @@ internal CallingServerError(string code, string message) Code = code; Message = message; - Details = new ChangeTrackingList(); + Details = new ChangeTrackingList(); } - /// Initializes a new instance of CallingServerError. + /// Initializes a new instance of CommunicationError. /// The error code. /// The error message. /// The error target. /// Further details about specific errors that led to this error. /// The inner error if any. - internal CallingServerError(string code, string message, string target, IReadOnlyList details, CallingServerError innerError) + internal CommunicationError(string code, string message, string target, IReadOnlyList details, CommunicationError innerError) { Code = code; Message = message; @@ -56,8 +56,8 @@ internal CallingServerError(string code, string message, string target, IReadOnl /// The error target. public string Target { get; } /// Further details about specific errors that led to this error. - public IReadOnlyList Details { get; } + public IReadOnlyList Details { get; } /// The inner error if any. - public CallingServerError InnerError { get; } + public CommunicationError InnerError { get; } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallingServerErrorResponse.Serialization.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CommunicationErrorResponse.Serialization.cs similarity index 56% rename from sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallingServerErrorResponse.Serialization.cs rename to sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CommunicationErrorResponse.Serialization.cs index 781767ece00a..6637948463e5 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallingServerErrorResponse.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CommunicationErrorResponse.Serialization.cs @@ -10,20 +10,20 @@ namespace Azure.Communication.CallingServer { - public partial class CallingServerErrorResponse + internal partial class CommunicationErrorResponse { - internal static CallingServerErrorResponse DeserializeCallingServerErrorResponse(JsonElement element) + internal static CommunicationErrorResponse DeserializeCommunicationErrorResponse(JsonElement element) { - CallingServerError error = default; + CommunicationError error = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("error")) { - error = CallingServerError.DeserializeCallingServerError(property.Value); + error = CommunicationError.DeserializeCommunicationError(property.Value); continue; } } - return new CallingServerErrorResponse(error); + return new CommunicationErrorResponse(error); } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallingServerErrorResponse.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CommunicationErrorResponse.cs similarity index 72% rename from sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallingServerErrorResponse.cs rename to sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CommunicationErrorResponse.cs index 9ead27feb091..08849379fca7 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CallingServerErrorResponse.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/CommunicationErrorResponse.cs @@ -10,12 +10,12 @@ namespace Azure.Communication.CallingServer { /// The Communication Services error. - public partial class CallingServerErrorResponse + internal partial class CommunicationErrorResponse { - /// Initializes a new instance of CallingServerErrorResponse. + /// Initializes a new instance of CommunicationErrorResponse. /// The Communication Services error. /// is null. - internal CallingServerErrorResponse(CallingServerError error) + internal CommunicationErrorResponse(CommunicationError error) { if (error == null) { @@ -26,6 +26,6 @@ internal CallingServerErrorResponse(CallingServerError error) } /// The Communication Services error. - public CallingServerError Error { get; } + public CommunicationError Error { get; } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/PlayAudioResult.Serialization.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/PlayAudioResult.Serialization.cs index 22686fa35ff4..bda9dc0250e5 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/PlayAudioResult.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/PlayAudioResult.Serialization.cs @@ -15,7 +15,7 @@ public partial class PlayAudioResult internal static PlayAudioResult DeserializePlayAudioResult(JsonElement element) { Optional operationId = default; - Optional status = default; + OperationStatus status = default; Optional operationContext = default; Optional resultInfo = default; foreach (var property in element.EnumerateObject()) @@ -27,11 +27,6 @@ internal static PlayAudioResult DeserializePlayAudioResult(JsonElement element) } if (property.NameEquals("status")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } status = new OperationStatus(property.Value.GetString()); continue; } @@ -51,7 +46,7 @@ internal static PlayAudioResult DeserializePlayAudioResult(JsonElement element) continue; } } - return new PlayAudioResult(operationId.Value, Optional.ToNullable(status), operationContext.Value, resultInfo.Value); + return new PlayAudioResult(operationId.Value, status, operationContext.Value, resultInfo.Value); } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/PlayAudioResult.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/PlayAudioResult.cs index 406a967b2a17..7dd6b1dfd6d1 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/PlayAudioResult.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/PlayAudioResult.cs @@ -11,8 +11,10 @@ namespace Azure.Communication.CallingServer public partial class PlayAudioResult { /// Initializes a new instance of PlayAudioResult. - internal PlayAudioResult() + /// The status of the operation. + internal PlayAudioResult(OperationStatus status) { + Status = status; } /// Initializes a new instance of PlayAudioResult. @@ -20,7 +22,7 @@ internal PlayAudioResult() /// The status of the operation. /// The operation context provided by client. /// The result info for the operation. - internal PlayAudioResult(string operationId, OperationStatus? status, string operationContext, ResultInfo resultInfo) + internal PlayAudioResult(string operationId, OperationStatus status, string operationContext, ResultInfo resultInfo) { OperationId = operationId; Status = status; @@ -31,7 +33,7 @@ internal PlayAudioResult(string operationId, OperationStatus? status, string ope /// The operation id. public string OperationId { get; } /// The status of the operation. - public OperationStatus? Status { get; } + public OperationStatus Status { get; } /// The operation context provided by client. public string OperationContext { get; } /// The result info for the operation. diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/PlayAudioResultEvent.Serialization.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/PlayAudioResultEvent.Serialization.cs index b1f1eeae26f4..865e57a31d3b 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/PlayAudioResultEvent.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/PlayAudioResultEvent.Serialization.cs @@ -10,34 +10,13 @@ namespace Azure.Communication.CallingServer { - public partial class PlayAudioResultEvent : IUtf8JsonSerializable + public partial class PlayAudioResultEvent { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(ResultInfo)) - { - writer.WritePropertyName("resultInfo"); - writer.WriteObjectValue(ResultInfo); - } - if (Optional.IsDefined(OperationContext)) - { - writer.WritePropertyName("operationContext"); - writer.WriteStringValue(OperationContext); - } - if (Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"); - writer.WriteStringValue(Status.Value.ToString()); - } - writer.WriteEndObject(); - } - internal static PlayAudioResultEvent DeserializePlayAudioResultEvent(JsonElement element) { Optional resultInfo = default; Optional operationContext = default; - Optional status = default; + OperationStatus status = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("resultInfo")) @@ -57,16 +36,11 @@ internal static PlayAudioResultEvent DeserializePlayAudioResultEvent(JsonElement } if (property.NameEquals("status")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } status = new OperationStatus(property.Value.GetString()); continue; } } - return new PlayAudioResultEvent(resultInfo.Value, operationContext.Value, Optional.ToNullable(status)); + return new PlayAudioResultEvent(resultInfo.Value, operationContext.Value, status); } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/PlayAudioResultEvent.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/PlayAudioResultEvent.cs index a6019a6ff4e7..5c13697c27d9 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/PlayAudioResultEvent.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/PlayAudioResultEvent.cs @@ -11,15 +11,17 @@ namespace Azure.Communication.CallingServer public partial class PlayAudioResultEvent { /// Initializes a new instance of PlayAudioResultEvent. - public PlayAudioResultEvent() + /// The status of the operation. + internal PlayAudioResultEvent(OperationStatus status) { + Status = status; } /// Initializes a new instance of PlayAudioResultEvent. /// The result details. /// The operation context. /// The status of the operation. - internal PlayAudioResultEvent(ResultInfo resultInfo, string operationContext, OperationStatus? status) + internal PlayAudioResultEvent(ResultInfo resultInfo, string operationContext, OperationStatus status) { ResultInfo = resultInfo; OperationContext = operationContext; @@ -27,10 +29,10 @@ internal PlayAudioResultEvent(ResultInfo resultInfo, string operationContext, Op } /// The result details. - public ResultInfo ResultInfo { get; set; } + public ResultInfo ResultInfo { get; } /// The operation context. - public string OperationContext { get; set; } + public string OperationContext { get; } /// The status of the operation. - public OperationStatus? Status { get; set; } + public OperationStatus Status { get; } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ResultInfo.Serialization.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ResultInfo.Serialization.cs index 2a66db65162b..afeabc783ff3 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ResultInfo.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ResultInfo.Serialization.cs @@ -14,28 +14,18 @@ public partial class ResultInfo { internal static ResultInfo DeserializeResultInfo(JsonElement element) { - Optional code = default; - Optional subcode = default; + int code = default; + int subcode = default; Optional message = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("code")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } code = property.Value.GetInt32(); continue; } if (property.NameEquals("subcode")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } subcode = property.Value.GetInt32(); continue; } @@ -45,7 +35,7 @@ internal static ResultInfo DeserializeResultInfo(JsonElement element) continue; } } - return new ResultInfo(Optional.ToNullable(code), Optional.ToNullable(subcode), message.Value); + return new ResultInfo(code, subcode, message.Value); } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ResultInfo.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ResultInfo.cs index f40ef9a660a4..7b4aa9982c19 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ResultInfo.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ResultInfo.cs @@ -11,50 +11,30 @@ namespace Azure.Communication.CallingServer public partial class ResultInfo { /// Initializes a new instance of ResultInfo. - internal ResultInfo() + /// The result code associated with the operation. + /// The subcode that further classifies the result. + internal ResultInfo(int code, int subcode) { + Code = code; + Subcode = subcode; } /// Initializes a new instance of ResultInfo. - /// - /// Gets or sets the result code - /// - /// For synchronous failures, this maps one-to-one with HTTP responses. For asynchronous failures or messages, it is contextual. - /// - /// - /// Gets or sets the result subcode. - /// - /// The subcode further classifies a failure. For example. - /// - /// - /// Gets or sets the message - /// - /// The message is a detail explanation of subcode. - /// - internal ResultInfo(int? code, int? subcode, string message) + /// The result code associated with the operation. + /// The subcode that further classifies the result. + /// The message is a detail explanation of subcode. + internal ResultInfo(int code, int subcode, string message) { Code = code; Subcode = subcode; Message = message; } - /// - /// Gets or sets the result code - /// - /// For synchronous failures, this maps one-to-one with HTTP responses. For asynchronous failures or messages, it is contextual. - /// - public int? Code { get; } - /// - /// Gets or sets the result subcode. - /// - /// The subcode further classifies a failure. For example. - /// - public int? Subcode { get; } - /// - /// Gets or sets the message - /// - /// The message is a detail explanation of subcode. - /// + /// The result code associated with the operation. + public int Code { get; } + /// The subcode that further classifies the result. + public int Subcode { get; } + /// The message is a detail explanation of subcode. public string Message { get; } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ToneInfo.Serialization.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ToneInfo.Serialization.cs index f97a5a860928..88f829d9ce48 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ToneInfo.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ToneInfo.Serialization.cs @@ -10,52 +10,26 @@ namespace Azure.Communication.CallingServer { - public partial class ToneInfo : IUtf8JsonSerializable + public partial class ToneInfo { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(SequenceId)) - { - writer.WritePropertyName("sequenceId"); - writer.WriteNumberValue(SequenceId.Value); - } - if (Optional.IsDefined(Tone)) - { - writer.WritePropertyName("tone"); - writer.WriteStringValue(Tone.Value.ToString()); - } - writer.WriteEndObject(); - } - internal static ToneInfo DeserializeToneInfo(JsonElement element) { - Optional sequenceId = default; - Optional tone = default; + int sequenceId = default; + ToneValue tone = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("sequenceId")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } sequenceId = property.Value.GetInt32(); continue; } if (property.NameEquals("tone")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } tone = new ToneValue(property.Value.GetString()); continue; } } - return new ToneInfo(Optional.ToNullable(sequenceId), Optional.ToNullable(tone)); + return new ToneInfo(sequenceId, tone); } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ToneInfo.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ToneInfo.cs index e22dc97f01a0..0fc8ed115fa8 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ToneInfo.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ToneInfo.cs @@ -7,34 +7,21 @@ namespace Azure.Communication.CallingServer { - /// Gets or sets the tone info. + /// The information about the tone. public partial class ToneInfo { /// Initializes a new instance of ToneInfo. - public ToneInfo() - { - } - - /// Initializes a new instance of ToneInfo. - /// - /// Gets or sets the sequence id. This id can be used to determine if the same tone - /// - /// was played multiple times or if any tones were missed. - /// - /// Gets or sets the tone detected. - internal ToneInfo(int? sequenceId, ToneValue? tone) + /// The sequence id which can be used to determine if the same tone was played multiple times or if any tones were missed. + /// The tone value. + internal ToneInfo(int sequenceId, ToneValue tone) { SequenceId = sequenceId; Tone = tone; } - /// - /// Gets or sets the sequence id. This id can be used to determine if the same tone - /// - /// was played multiple times or if any tones were missed. - /// - public int? SequenceId { get; set; } - /// Gets or sets the tone detected. - public ToneValue? Tone { get; set; } + /// The sequence id which can be used to determine if the same tone was played multiple times or if any tones were missed. + public int SequenceId { get; } + /// The tone value. + public ToneValue Tone { get; } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ToneReceivedEvent.Serialization.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ToneReceivedEvent.Serialization.cs index 0862e6b60f7b..9c2f01a2901a 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ToneReceivedEvent.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ToneReceivedEvent.Serialization.cs @@ -10,37 +10,16 @@ namespace Azure.Communication.CallingServer { - public partial class ToneReceivedEvent : IUtf8JsonSerializable + public partial class ToneReceivedEvent { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(ToneInfo)) - { - writer.WritePropertyName("toneInfo"); - writer.WriteObjectValue(ToneInfo); - } - if (Optional.IsDefined(CallConnectionId)) - { - writer.WritePropertyName("callConnectionId"); - writer.WriteStringValue(CallConnectionId); - } - writer.WriteEndObject(); - } - internal static ToneReceivedEvent DeserializeToneReceivedEvent(JsonElement element) { - Optional toneInfo = default; + ToneInfo toneInfo = default; Optional callConnectionId = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("toneInfo")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } toneInfo = ToneInfo.DeserializeToneInfo(property.Value); continue; } @@ -50,7 +29,7 @@ internal static ToneReceivedEvent DeserializeToneReceivedEvent(JsonElement eleme continue; } } - return new ToneReceivedEvent(toneInfo.Value, callConnectionId.Value); + return new ToneReceivedEvent(toneInfo, callConnectionId.Value); } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ToneReceivedEvent.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ToneReceivedEvent.cs index 4a49e7c31f95..645c5e5e72b0 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ToneReceivedEvent.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ToneReceivedEvent.cs @@ -5,14 +5,24 @@ #nullable disable +using System; + namespace Azure.Communication.CallingServer { /// The subscribe to tone event. public partial class ToneReceivedEvent { /// Initializes a new instance of ToneReceivedEvent. - public ToneReceivedEvent() + /// The tone info. + /// is null. + internal ToneReceivedEvent(ToneInfo toneInfo) { + if (toneInfo == null) + { + throw new ArgumentNullException(nameof(toneInfo)); + } + + ToneInfo = toneInfo; } /// Initializes a new instance of ToneReceivedEvent. @@ -25,8 +35,8 @@ internal ToneReceivedEvent(ToneInfo toneInfo, string callConnectionId) } /// The tone info. - public ToneInfo ToneInfo { get; set; } + public ToneInfo ToneInfo { get; } /// The call connection id. - public string CallConnectionId { get; set; } + public string CallConnectionId { get; } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ToneValue.cs b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ToneValue.cs index 2881449048c2..b61260b6d57e 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ToneValue.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Generated/Models/ToneValue.cs @@ -10,7 +10,7 @@ namespace Azure.Communication.CallingServer { - /// Gets or sets the tone detected. + /// The tone value. public readonly partial struct ToneValue : IEquatable { private readonly string _value; diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Models/CallConnectionState.cs b/sdk/communication/Azure.Communication.CallingServer/src/Models/CallConnectionState.cs index 8e4c960c780c..0175802d929d 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Models/CallConnectionState.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Models/CallConnectionState.cs @@ -8,7 +8,7 @@ namespace Azure.Communication.CallingServer /// /// The states of a call. /// - [CodeGenModel("CallConnectionState", Usage = new string[] { "input", "output" }, Formats = new string[] { "json" })] + [CodeGenModel("CallConnectionState", Usage = new string[] { "output" }, Formats = new string[] { "json" })] public readonly partial struct CallConnectionState { } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Models/CallParticipant.cs b/sdk/communication/Azure.Communication.CallingServer/src/Models/CallParticipant.cs index ba4d6836ff18..938623f882f4 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Models/CallParticipant.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Models/CallParticipant.cs @@ -6,16 +6,11 @@ namespace Azure.Communication.CallingServer /// The participant in a call. public class CallParticipant { - /// Initializes a new instance of CallParticipant. - public CallParticipant() - { - } - /// Initializes a new instance of CallParticipant. /// The communication identifier. /// Participant Id. /// Is participant muted. - public CallParticipant(CommunicationIdentifier identifier, string participantId, bool? isMuted) + internal CallParticipant(CommunicationIdentifier identifier, string participantId, bool isMuted) { Identifier = identifier; ParticipantId = participantId; @@ -23,12 +18,12 @@ public CallParticipant(CommunicationIdentifier identifier, string participantId, } /// The communication identifier. - public CommunicationIdentifier Identifier { get; set; } + public CommunicationIdentifier Identifier { get; } /// Participant Id. - public string ParticipantId { get; set; } + public string ParticipantId { get; } /// Is participant muted. - public bool? IsMuted { get; set; } + public bool IsMuted { get; } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Models/CallingServerError.cs b/sdk/communication/Azure.Communication.CallingServer/src/Models/CallingServerError.cs deleted file mode 100644 index 24b8597fd5be..000000000000 --- a/sdk/communication/Azure.Communication.CallingServer/src/Models/CallingServerError.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using Azure.Core; - -namespace Azure.Communication.CallingServer -{ - [CodeGenModel("CommunicationError")] - public partial class CallingServerError - { - } -} diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Models/CallingServerErrorResponse.cs b/sdk/communication/Azure.Communication.CallingServer/src/Models/CallingServerErrorResponse.cs deleted file mode 100644 index 8ef473a70d79..000000000000 --- a/sdk/communication/Azure.Communication.CallingServer/src/Models/CallingServerErrorResponse.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using Azure.Core; - -namespace Azure.Communication.CallingServer -{ - [CodeGenModel("CommunicationErrorResponse")] - public partial class CallingServerErrorResponse - { - } -} diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Models/CallingServerModelFactory.cs b/sdk/communication/Azure.Communication.CallingServer/src/Models/CallingServerModelFactory.cs index 328a22c85140..0a7a92aa462e 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Models/CallingServerModelFactory.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Models/CallingServerModelFactory.cs @@ -9,7 +9,7 @@ namespace Azure.Communication.CallingServer /// Calling server model factory /// [CodeGenModel("AzureCommunicationServicesModelFactory")] - internal partial class CallingServerModelFactory + public partial class CallingServerModelFactory { } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Models/CommunicationParticipant.cs b/sdk/communication/Azure.Communication.CallingServer/src/Models/CommunicationParticipant.cs deleted file mode 100644 index 7ce1548733bd..000000000000 --- a/sdk/communication/Azure.Communication.CallingServer/src/Models/CommunicationParticipant.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -namespace Azure.Communication.CallingServer -{ - /// Class to represent entry in roster. - public class CommunicationParticipant - { - /// Initializes a new instance of CommunicationParticipant. - public CommunicationParticipant() - { - } - - /// Initializes a new instance of CommunicationParticipant. - /// The communication identifier. - /// Participant Id. - /// Is participant muted. - public CommunicationParticipant(CommunicationIdentifier identifier, string participantId, bool? isMuted) - { - Identifier = identifier; - ParticipantId = participantId; - IsMuted = isMuted; - } - - /// The communication identifier. - public CommunicationIdentifier Identifier { get; set; } - - /// Participant Id. - public string ParticipantId { get; set; } - - /// Is participant muted. - public bool? IsMuted { get; set; } - } -} diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Models/CommunicationParticipantInternal.cs b/sdk/communication/Azure.Communication.CallingServer/src/Models/CommunicationParticipantInternal.cs deleted file mode 100644 index 54ecdbcdfd2f..000000000000 --- a/sdk/communication/Azure.Communication.CallingServer/src/Models/CommunicationParticipantInternal.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using Azure.Core; - -namespace Azure.Communication.CallingServer -{ - /// - /// The participant in a call. - /// - [CodeGenModel("CommunicationParticipant", Usage = new string[] { "output" }, Formats = new string[] { "json" })] - internal partial class CommunicationParticipantInternal - { - } -} diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Models/Events/AddParticipantResultEvent.cs b/sdk/communication/Azure.Communication.CallingServer/src/Models/Events/AddParticipantResultEvent.cs index df835004b51d..29ed58bab1cb 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Models/Events/AddParticipantResultEvent.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Models/Events/AddParticipantResultEvent.cs @@ -9,7 +9,7 @@ namespace Azure.Communication.CallingServer /// /// The added participants result event. /// - [CodeGenModel("AddParticipantResultEvent", Usage = new string[] { "input, output" }, Formats = new string[] { "json" })] + [CodeGenModel("AddParticipantResultEvent", Usage = new string[] { "output" }, Formats = new string[] { "json" })] public partial class AddParticipantResultEvent : CallingServerEventBase { /// diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Models/Events/CallConnectionStateChangedEvent.cs b/sdk/communication/Azure.Communication.CallingServer/src/Models/Events/CallConnectionStateChangedEvent.cs index 0a0a0a7376e4..10f8ca12a864 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Models/Events/CallConnectionStateChangedEvent.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Models/Events/CallConnectionStateChangedEvent.cs @@ -9,7 +9,7 @@ namespace Azure.Communication.CallingServer /// /// The call connection state change event. /// - [CodeGenModel("CallConnectionStateChangedEvent", Usage = new string[] { "input, output" }, Formats = new string[] { "json" })] + [CodeGenModel("CallConnectionStateChangedEvent", Usage = new string[] { "output" }, Formats = new string[] { "json" })] public partial class CallConnectionStateChangedEvent : CallingServerEventBase { /// diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Models/Events/CallRecordingStateChangeEvent.cs b/sdk/communication/Azure.Communication.CallingServer/src/Models/Events/CallRecordingStateChangeEvent.cs index 1b84ea2dd947..81ca894900d5 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Models/Events/CallRecordingStateChangeEvent.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Models/Events/CallRecordingStateChangeEvent.cs @@ -9,7 +9,7 @@ namespace Azure.Communication.CallingServer /// /// The call recording state change event. /// - [CodeGenModel("CallRecordingStateChangeEvent", Usage = new string[] { "input, output" }, Formats = new string[] { "json" })] + [CodeGenModel("CallRecordingStateChangeEvent", Usage = new string[] { "output" }, Formats = new string[] { "json" })] public partial class CallRecordingStateChangeEvent : CallingServerEventBase { /// diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Models/Events/ParticipantsUpdatedEvent.cs b/sdk/communication/Azure.Communication.CallingServer/src/Models/Events/ParticipantsUpdatedEvent.cs index fc1e4c4c3d1b..4e6293852ee3 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Models/Events/ParticipantsUpdatedEvent.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Models/Events/ParticipantsUpdatedEvent.cs @@ -13,8 +13,12 @@ namespace Azure.Communication.CallingServer public class ParticipantsUpdatedEvent : CallingServerEventBase { /// Initializes a new instance of ParticipantsUpdatedEvent. - public ParticipantsUpdatedEvent() + /// The call connection id. + /// The list of participants. + internal ParticipantsUpdatedEvent(string callConnectionId, IEnumerable participants) { + CallConnectionId = callConnectionId; + Participants = participants; } /// @@ -28,18 +32,15 @@ public static ParticipantsUpdatedEvent Deserialize(string content) JsonElement element = document.RootElement; var participantsUpdatedEventInternal = ParticipantsUpdatedEventInternal.DeserializeParticipantsUpdatedEventInternal(element); + var callParticipants = participantsUpdatedEventInternal.Participants?.Select(x => new CallParticipant(identifier: CommunicationIdentifierSerializer.Deserialize(x.Identifier), isMuted: x.IsMuted, participantId: x.ParticipantId)); - return new ParticipantsUpdatedEvent - { - CallConnectionId = participantsUpdatedEventInternal.CallConnectionId, - Participants = participantsUpdatedEventInternal.Participants?.Select(x => new CommunicationParticipant { Identifier = CommunicationIdentifierSerializer.Deserialize(x.Identifier), IsMuted = x.IsMuted, ParticipantId = x.ParticipantId }) - }; + return new ParticipantsUpdatedEvent(participantsUpdatedEventInternal.CallConnectionId, callParticipants); } /// The call connection id. - public string CallConnectionId { get; set; } + public string CallConnectionId { get; } /// The list of participants. - public IEnumerable Participants { get; set; } + public IEnumerable Participants { get; } } } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Models/Events/PlayAudioResultEvent.cs b/sdk/communication/Azure.Communication.CallingServer/src/Models/Events/PlayAudioResultEvent.cs index 6521c7b799e5..c871bfab7f40 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Models/Events/PlayAudioResultEvent.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Models/Events/PlayAudioResultEvent.cs @@ -9,7 +9,7 @@ namespace Azure.Communication.CallingServer /// /// The play audio result event. /// - [CodeGenModel("PlayAudioResultEvent", Usage = new string[] { "input, output" }, Formats = new string[] { "json" })] + [CodeGenModel("PlayAudioResultEvent", Usage = new string[] { "output" }, Formats = new string[] { "json" })] public partial class PlayAudioResultEvent : CallingServerEventBase { /// diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Models/Events/ToneReceivedEvent.cs b/sdk/communication/Azure.Communication.CallingServer/src/Models/Events/ToneReceivedEvent.cs index cb209c5d8685..49aafc51de0e 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Models/Events/ToneReceivedEvent.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Models/Events/ToneReceivedEvent.cs @@ -9,7 +9,7 @@ namespace Azure.Communication.CallingServer /// /// The subscribe to tone event /// - [CodeGenModel("ToneReceivedEvent", Usage = new string[] { "model", "input, output" }, Formats = new string[] { "json" })] + [CodeGenModel("ToneReceivedEvent", Usage = new string[] { "model", "output" }, Formats = new string[] { "json" })] public partial class ToneReceivedEvent : CallingServerEventBase { /// diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Models/ToneInfo.cs b/sdk/communication/Azure.Communication.CallingServer/src/Models/ToneInfo.cs index aa712ecc98c7..ad05aec9e750 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Models/ToneInfo.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Models/ToneInfo.cs @@ -8,7 +8,7 @@ namespace Azure.Communication.CallingServer /// /// The tone info /// - [CodeGenModel("ToneInfo", Usage = new[] { "input", "output" }, Formats = new[] { "json" })] + [CodeGenModel("ToneInfo", Usage = new[] { "output" }, Formats = new[] { "json" })] public partial class ToneInfo { } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/Models/ToneValue.cs b/sdk/communication/Azure.Communication.CallingServer/src/Models/ToneValue.cs index dd8021414b35..665bd6758bda 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/Models/ToneValue.cs +++ b/sdk/communication/Azure.Communication.CallingServer/src/Models/ToneValue.cs @@ -8,7 +8,7 @@ namespace Azure.Communication.CallingServer /// /// The tone. /// - [CodeGenModel("ToneValue", Usage = new string[] { "input", "output" }, Formats = new string[] { "json" })] + [CodeGenModel("ToneValue", Usage = new string[] { "output" }, Formats = new string[] { "json" })] public readonly partial struct ToneValue { } diff --git a/sdk/communication/Azure.Communication.CallingServer/src/autorest.md b/sdk/communication/Azure.Communication.CallingServer/src/autorest.md index 2188936401f2..7f943bd1c644 100644 --- a/sdk/communication/Azure.Communication.CallingServer/src/autorest.md +++ b/sdk/communication/Azure.Communication.CallingServer/src/autorest.md @@ -13,7 +13,7 @@ If any of the new objects needs to be overwritten, add the required changes to t ```yaml require: - - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/5ffa6f90f1916423bd09855f1bfe32d2bd78ecab/specification/communication/data-plane/CallingServer/readme.md + - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/b4b5fa5ee23f8cce9e1ade4a82076b4c34b25651/specification/communication/data-plane/CallingServer/readme.md payload-flattening-threshold: 10 clear-output-folder: true directive: