From 0782ff30d74bc19e38ba43a1ade23d2c6f21c740 Mon Sep 17 00:00:00 2001 From: Juntu Chen <95723208+juntuchen-msft@users.noreply.github.com> Date: Tue, 18 Jul 2023 19:06:52 -0400 Subject: [PATCH] Juntuchen/callback uri override (#37652) * added logic to pass callbackUri override * updated api * Update autorest.md * Update autorest.md --- .../Azure.Communication.CallAutomation.netstandard2.0.cs | 3 +++ .../src/CallConnection.cs | 8 ++++---- .../Models/AddParticipantRequestInternal.Serialization.cs | 5 +++++ .../src/Generated/Models/AddParticipantRequestInternal.cs | 2 ++ .../RemoveParticipantRequestInternal.Serialization.cs | 5 +++++ .../Generated/Models/RemoveParticipantRequestInternal.cs | 2 ++ .../TransferToParticipantRequestInternal.Serialization.cs | 5 +++++ .../Models/TransferToParticipantRequestInternal.cs | 2 ++ .../src/Models/AddParticipantOptions.cs | 5 +++++ .../src/Models/RemoveParticipantOptions.cs | 5 +++++ .../src/Models/TransferToParticipantOptions.cs | 5 +++++ .../Azure.Communication.CallAutomation/src/autorest.md | 2 +- 12 files changed, 44 insertions(+), 5 deletions(-) diff --git a/sdk/communication/Azure.Communication.CallAutomation/api/Azure.Communication.CallAutomation.netstandard2.0.cs b/sdk/communication/Azure.Communication.CallAutomation/api/Azure.Communication.CallAutomation.netstandard2.0.cs index a9d60af64da84..5f61b4420d8b1 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/api/Azure.Communication.CallAutomation.netstandard2.0.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/api/Azure.Communication.CallAutomation.netstandard2.0.cs @@ -17,6 +17,7 @@ internal AddParticipantFailed() { } public partial class AddParticipantOptions { public AddParticipantOptions(Azure.Communication.CallAutomation.CallInvite participantToAdd) { } + public string CallbackUriOverride { get { throw null; } set { } } public int? InvitationTimeoutInSeconds { get { throw null; } set { } } public string OperationContext { get { throw null; } set { } } public Azure.Communication.CallAutomation.CallInvite ParticipantToAdd { get { throw null; } } @@ -1127,6 +1128,7 @@ internal RemoveParticipantFailed() { } public partial class RemoveParticipantOptions { public RemoveParticipantOptions(Azure.Communication.CommunicationIdentifier participantToRemove) { } + public string CallbackUriOverride { get { throw null; } set { } } public string OperationContext { get { throw null; } set { } } public Azure.Communication.CommunicationIdentifier ParticipantToRemove { get { throw null; } } } @@ -1275,6 +1277,7 @@ public partial class TransferToParticipantOptions public TransferToParticipantOptions(Azure.Communication.CommunicationUserIdentifier targetIdentity) { } public TransferToParticipantOptions(Azure.Communication.MicrosoftTeamsUserIdentifier targetIdentity) { } public TransferToParticipantOptions(Azure.Communication.PhoneNumberIdentifier targetPhoneNumberIdentity) { } + public string CallbackUriOverride { get { throw null; } set { } } public Azure.Communication.CallAutomation.CustomContext CustomContext { get { throw null; } } public string OperationContext { get { throw null; } set { } } public Azure.Communication.CommunicationIdentifier Target { get { throw null; } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/CallConnection.cs b/sdk/communication/Azure.Communication.CallAutomation/src/CallConnection.cs index 3d30430f71716..dcb7aa1da5987 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/CallConnection.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/CallConnection.cs @@ -316,7 +316,7 @@ private static TransferToParticipantRequestInternal CreateTransferToParticipantR { request.OperationContext = options.OperationContext == default ? Guid.NewGuid().ToString() : options.OperationContext; } - + request.CallbackUriOverride = options.CallbackUriOverride; return request; } @@ -442,7 +442,7 @@ private static AddParticipantRequestInternal CreateAddParticipantRequest(AddPart { request.InvitationTimeoutInSeconds = options.InvitationTimeoutInSeconds; } - + request.CallbackUriOverride = options.CallbackUriOverride; request.CustomContext = new CustomContextInternal( options.ParticipantToAdd.CustomContext.SipHeaders == null ? new ChangeTrackingDictionary() : options.ParticipantToAdd.CustomContext.SipHeaders, options.ParticipantToAdd.CustomContext.VoipHeaders == null ? new ChangeTrackingDictionary() : options.ParticipantToAdd.CustomContext.VoipHeaders); @@ -599,7 +599,7 @@ public virtual async Task> RemoveParticipantAs { request.OperationContext = options.OperationContext == default ? Guid.NewGuid().ToString() : options.OperationContext; } - + request.CallbackUriOverride = options.CallbackUriOverride; var response = await RestClient.RemoveParticipantAsync( CallConnectionId, request, @@ -660,7 +660,7 @@ public virtual Response RemoveParticipant(RemovePartici { options.OperationContext = options.OperationContext == default ? Guid.NewGuid().ToString() : options.OperationContext; } - + request.CallbackUriOverride = options.CallbackUriOverride; var response = RestClient.RemoveParticipant( CallConnectionId, request, diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantRequestInternal.Serialization.cs index ff69e3343153f..f87db4f7c3f70 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantRequestInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantRequestInternal.Serialization.cs @@ -42,6 +42,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("customContext"u8); writer.WriteObjectValue(CustomContext); } + if (Optional.IsDefined(CallbackUriOverride)) + { + writer.WritePropertyName("callbackUriOverride"u8); + writer.WriteStringValue(CallbackUriOverride); + } writer.WriteEndObject(); } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantRequestInternal.cs index d4b91e3291a17..e147652cb8da2 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantRequestInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/AddParticipantRequestInternal.cs @@ -45,5 +45,7 @@ public AddParticipantRequestInternal(CommunicationIdentifierModel participantToA public string OperationContext { get; set; } /// Used by customer to send custom context to targets. public CustomContextInternal CustomContext { get; set; } + /// The callback URI override. + public string CallbackUriOverride { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantRequestInternal.Serialization.cs index 44b0d4ab955fc..5ad6f9f82db30 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantRequestInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantRequestInternal.Serialization.cs @@ -22,6 +22,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("operationContext"u8); writer.WriteStringValue(OperationContext); } + if (Optional.IsDefined(CallbackUriOverride)) + { + writer.WritePropertyName("callbackUriOverride"u8); + writer.WriteStringValue(CallbackUriOverride); + } writer.WriteEndObject(); } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantRequestInternal.cs index d9ed55c1c915d..4f2135cf86b67 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantRequestInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/RemoveParticipantRequestInternal.cs @@ -28,5 +28,7 @@ public RemoveParticipantRequestInternal(CommunicationIdentifierModel participant public CommunicationIdentifierModel ParticipantToRemove { get; } /// Used by customers when calling mid-call actions to correlate the request to the response event. public string OperationContext { get; set; } + /// The callback URI override. + public string CallbackUriOverride { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TransferToParticipantRequestInternal.Serialization.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TransferToParticipantRequestInternal.Serialization.cs index fba8d206e6817..bc5e4542f7780 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TransferToParticipantRequestInternal.Serialization.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TransferToParticipantRequestInternal.Serialization.cs @@ -27,6 +27,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("operationContext"u8); writer.WriteStringValue(OperationContext); } + if (Optional.IsDefined(CallbackUriOverride)) + { + writer.WritePropertyName("callbackUriOverride"u8); + writer.WriteStringValue(CallbackUriOverride); + } writer.WriteEndObject(); } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TransferToParticipantRequestInternal.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TransferToParticipantRequestInternal.cs index baa6300ed5c74..2e38d6a0cde7f 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TransferToParticipantRequestInternal.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Generated/Models/TransferToParticipantRequestInternal.cs @@ -30,5 +30,7 @@ public TransferToParticipantRequestInternal(CommunicationIdentifierModel targetP public CustomContextInternal CustomContext { get; set; } /// Used by customers when calling mid-call actions to correlate the request to the response event. public string OperationContext { get; set; } + /// The callback URI override. + public string CallbackUriOverride { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/AddParticipantOptions.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/AddParticipantOptions.cs index 90feb87da33b1..aec519b0fe7e0 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/AddParticipantOptions.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/AddParticipantOptions.cs @@ -34,5 +34,10 @@ public AddParticipantOptions(CallInvite participantToAdd) /// The maximum value is 180 seconds. /// public int? InvitationTimeoutInSeconds { get; set; } + + /// + /// The callback URI override for this transfer call request. + /// + public string CallbackUriOverride { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/RemoveParticipantOptions.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/RemoveParticipantOptions.cs index 0b7a7e495b91e..6bc3ed1240adf 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/RemoveParticipantOptions.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/RemoveParticipantOptions.cs @@ -25,5 +25,10 @@ public RemoveParticipantOptions(CommunicationIdentifier participantToRemove) /// The operation context. /// public string OperationContext { get; set; } + + /// + /// The callback URI override for this transfer call request. + /// + public string CallbackUriOverride { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/TransferToParticipantOptions.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/TransferToParticipantOptions.cs index c2d7f301683cb..b4d2bd70b3a87 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/TransferToParticipantOptions.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/TransferToParticipantOptions.cs @@ -55,5 +55,10 @@ public TransferToParticipantOptions(MicrosoftTeamsUserIdentifier targetIdentity) /// The Custom Context which contains SIP and voip headers /// public CustomContext CustomContext { get; } + + /// + /// The callback URI override for this transfer call request. + /// + public string CallbackUriOverride { get; set; } } } diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/autorest.md b/sdk/communication/Azure.Communication.CallAutomation/src/autorest.md index fec16352def83..40bf655f828fd 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/autorest.md +++ b/sdk/communication/Azure.Communication.CallAutomation/src/autorest.md @@ -10,7 +10,7 @@ model-namespace: false tag: package-2023-01-15-preview require: - - https://github.com/williamzhao87/azure-rest-api-specs/blob/e8612807fcc6148904e2ee316a2086a1db74f71c/specification/communication/data-plane/CallAutomation/readme.md + - https://github.com/juntuchen-msft/azure-rest-api-specs/blob/502207255f635c3658b27fbea5f8c3748b273aff/specification/communication/data-plane/CallAutomation/readme.md title: Azure Communication Services