Skip to content

Commit

Permalink
update based on latest swagger (#34197)
Browse files Browse the repository at this point in the history
* update based on latest swagger

* api changes
  • Loading branch information
richardcho-msft committed Feb 17, 2023
1 parent bf8cc4c commit 2c6a227
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ private CreateCallRequestInternal CreateCallRequest(CreateCallOptions options)
? null
: new PhoneNumberIdentifierModel(options?.CallInvite?.SourceCallerIdNumber?.PhoneNumber),
SourceDisplayName = options?.CallInvite?.SourceDisplayName,
SourceIdentity = CommunicationIdentifierSerializer.Serialize(Source),
SourceIdentity = Source == null ? null : CommunicationIdentifierSerializer.Serialize(Source),
};
// Add custom cognitive service domain name
if (options.AzureCognitiveServicesEndpointUrl != null)
Expand Down Expand Up @@ -704,7 +704,7 @@ public virtual CallConnection GetCallConnection(string callConnectionId)
scope.Start();
try
{
return new CallConnection(callConnectionId, CallConnectionRestClient, CallMediaRestClient, _clientDiagnostics, EventProcessor, Source);
return new CallConnection(callConnectionId, CallConnectionRestClient, CallMediaRestClient, _clientDiagnostics, EventProcessor);
}
catch (Exception ex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,19 @@ public class CallConnection
internal CallConnectionRestClient RestClient { get; }
internal CallMediaRestClient CallMediaRestClient { get; }
internal EventProcessor EventProcessor { get; }
internal CommunicationUserIdentifier Source { get; }

/// <summary>
/// The call connection id.
/// </summary>
public virtual string CallConnectionId { get; internal set; }

internal CallConnection(string callConnectionId, CallConnectionRestClient callConnectionRestClient, CallMediaRestClient callCallMediaRestClient, ClientDiagnostics clientDiagnostics, EventProcessor eventProcessor, CommunicationUserIdentifier source = null)
internal CallConnection(string callConnectionId, CallConnectionRestClient callConnectionRestClient, CallMediaRestClient callCallMediaRestClient, ClientDiagnostics clientDiagnostics, EventProcessor eventProcessor)
{
CallConnectionId = callConnectionId;
RestClient = callConnectionRestClient;
CallMediaRestClient = callCallMediaRestClient;
_clientDiagnostics = clientDiagnostics;
EventProcessor = eventProcessor;
Source = source;
}

/// <summary>Initializes a new instance of <see cref="CallConnection"/> for mocking.</summary>
Expand Down Expand Up @@ -416,7 +414,7 @@ public virtual Response<AddParticipantResult> AddParticipant(AddParticipantOptio
}
}

private AddParticipantRequestInternal CreateAddParticipantRequest(AddParticipantOptions options)
private static AddParticipantRequestInternal CreateAddParticipantRequest(AddParticipantOptions options)
{
// validate ParticipantToAdd is not null
Argument.AssertNotNull(options.ParticipantToAdd, nameof(options.ParticipantToAdd));
Expand All @@ -427,7 +425,6 @@ private AddParticipantRequestInternal CreateAddParticipantRequest(AddParticipant
? null
: new PhoneNumberIdentifierModel(options.ParticipantToAdd.SourceCallerIdNumber.PhoneNumber),
SourceDisplayName = options.ParticipantToAdd.SourceDisplayName,
SourceIdentity = Source == null ? null : CommunicationIdentifierSerializer.Serialize(Source),
OperationContext = options.OperationContext == default ? Guid.NewGuid().ToString() : options.OperationContext
};

Expand Down

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.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ tag: package-2023-01-15-preview
model-namespace: false

require:
- https://github.com/williamzhao87/azure-rest-api-specs/blob/cb2cd38aa4a7258e59a912edbb21a21468fb9c6f/specification/communication/data-plane/CallAutomation/readme.md
- https://github.com/williamzhao87/azure-rest-api-specs/blob/0d0cd5af40aa17af76ce0307ac5512351c38e3bc/specification/communication/data-plane/CallAutomation/readme.md
title: Azure Communication Services

generation1-convenience-client: true
Expand Down

0 comments on commit 2c6a227

Please sign in to comment.