Skip to content

Commit

Permalink
[ACS][CallAutomation][CallRecording] Call recording BYOS Review feedb…
Browse files Browse the repository at this point in the history
…ack items (#34795)

* call recording byos api review feedback items

* minor fix
  • Loading branch information
sarkar-rajarshi authored Mar 9, 2023
1 parent 0618f36 commit b8e2296
Show file tree
Hide file tree
Showing 21 changed files with 294 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ internal AnswerCallResult() { }
public Azure.Communication.CallAutomation.CallConnectionProperties CallConnectionProperties { get { throw null; } }
public System.Threading.Tasks.Task<Azure.Communication.CallAutomation.AnswerCallEventResult> WaitForEvent(System.TimeSpan eventTimeout = default(System.TimeSpan)) { throw null; }
}
public partial class BlobStorage : Azure.Communication.CallAutomation.ExternalStorage
{
public BlobStorage(System.Uri containerUri) { }
public System.Uri ContainerUri { get { throw null; } }
}
public partial class CallAutomationClient
{
protected CallAutomationClient() { }
Expand Down Expand Up @@ -488,6 +493,11 @@ public abstract partial class EventResultBase
protected EventResultBase() { }
public bool IsSuccessEvent { get { throw null; } }
}
public abstract partial class ExternalStorage
{
protected ExternalStorage() { }
public Azure.Communication.CallAutomation.RecordingStorageType StorageType { get { throw null; } protected set { } }
}
public partial class FileSource : Azure.Communication.CallAutomation.PlaySource
{
public FileSource(System.Uri fileUri) { }
Expand Down Expand Up @@ -900,6 +910,11 @@ public ServerCallLocator(string id) { }
public override int GetHashCode() { throw null; }
public override string ToString() { throw null; }
}
public partial class SsmlSource
{
public SsmlSource(string ssmlText) { }
public string SsmlText { get { throw null; } }
}
public partial class StartRecognizingEventResult : Azure.Communication.CallAutomation.EventResultBase
{
internal StartRecognizingEventResult() { }
Expand All @@ -915,12 +930,11 @@ public partial class StartRecordingOptions
{
public StartRecordingOptions(Azure.Communication.CallAutomation.CallLocator callLocator) { }
public System.Collections.Generic.IList<Azure.Communication.CommunicationIdentifier> AudioChannelParticipantOrdering { get { throw null; } }
public System.Uri ExternalStorageLocation { get { throw null; } set { } }
public Azure.Communication.CallAutomation.ExternalStorage ExternalStorage { get { throw null; } set { } }
public Azure.Communication.CallAutomation.RecordingChannel RecordingChannel { get { throw null; } set { } }
public Azure.Communication.CallAutomation.RecordingContent RecordingContent { get { throw null; } set { } }
public Azure.Communication.CallAutomation.RecordingFormat RecordingFormat { get { throw null; } set { } }
public System.Uri RecordingStateCallbackEndpoint { get { throw null; } set { } }
public Azure.Communication.CallAutomation.RecordingStorageType? RecordingStorageType { get { throw null; } set { } }
}
public partial class TextSource : Azure.Communication.CallAutomation.PlaySource
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ public virtual Response<RecordingStateResult> StartRecording(StartRecordingOptio
RecordingChannelType = options.RecordingChannel,
RecordingContentType = options.RecordingContent,
RecordingFormatType = options.RecordingFormat,
RecordingStorageType = options.RecordingStorageType,
ExternalStorageLocation = options.ExternalStorageLocation?.AbsoluteUri,
};

if (options.AudioChannelParticipantOrdering != null && options.AudioChannelParticipantOrdering.Any())
Expand All @@ -72,7 +70,12 @@ public virtual Response<RecordingStateResult> StartRecording(StartRecordingOptio
{
request.AudioChannelParticipantOrdering.Add(CommunicationIdentifierSerializer.Serialize(c));
}
};
}

if (options.ExternalStorage is not null)
{
request.ExternalStorage = TranslateExternalStorageToInternal(options.ExternalStorage);
}

var repeatabilityHeaders = new RepeatabilityHeaders();
return _callRecordingRestClient.StartRecording(request,
Expand Down Expand Up @@ -107,8 +110,6 @@ public virtual async Task<Response<RecordingStateResult>> StartRecordingAsync(St
RecordingChannelType = options.RecordingChannel,
RecordingContentType = options.RecordingContent,
RecordingFormatType = options.RecordingFormat,
RecordingStorageType = options.RecordingStorageType,
ExternalStorageLocation = options.ExternalStorageLocation?.AbsoluteUri,
};

if (options.AudioChannelParticipantOrdering != null && options.AudioChannelParticipantOrdering.Any())
Expand All @@ -119,6 +120,11 @@ public virtual async Task<Response<RecordingStateResult>> StartRecordingAsync(St
}
};

if (options.ExternalStorage is not null)
{
request.ExternalStorage = TranslateExternalStorageToInternal(options.ExternalStorage);
}

var repeatabilityHeaders = new RepeatabilityHeaders();
return await _callRecordingRestClient.StartRecordingAsync(request,
repeatabilityHeaders.RepeatabilityRequestId,
Expand Down Expand Up @@ -597,5 +603,24 @@ public virtual async Task<Response> DeleteRecordingAsync(Uri recordingLocation,
throw;
}
}

#region private functions

private static ExternalStorageInternal TranslateExternalStorageToInternal(ExternalStorage externalStorage)
{
ExternalStorageInternal result = null;

if (externalStorage is BlobStorage blobStorage)
{
result = new ExternalStorageInternal(blobStorage.StorageType)
{
BlobStorage = new BlobStorageInternal(blobStorage.ContainerUri.AbsoluteUri),
};
}

return result;
}

#endregion private functions
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b8e2296

Please sign in to comment.