Skip to content

Commit

Permalink
add comment for errors thrown (Azure#29744)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardcho-msft authored Apr 10, 2023
1 parent c05e0e9 commit 2d9b15b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ def create_call(
:type azure_cognitive_services_endpoint_url: str
:return: Instance of CreateCallResult.
:rtype: CreateCallResult
:raises ~azure.core.exceptions.HttpResponseError
"""

if not target:
Expand Down Expand Up @@ -264,6 +265,7 @@ def create_group_call(
:type voip_headers: Dict[str, str]
:return: Instance of CreateCallResult.
:rtype: CreateCallResult
:raises ~azure.core.exceptions.HttpResponseError
"""

if not targets:
Expand Down Expand Up @@ -345,6 +347,7 @@ def answer_call(
:type repeatability_first_sent: str
:return: Instance of AnswerCallResult.
:rtype: AnswerCallResult
:raises ~azure.core.exceptions.HttpResponseError
"""

if not incoming_call_context:
Expand Down Expand Up @@ -396,6 +399,7 @@ def redirect_call(
:type target: CallInvite
:return: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError
"""

if not incoming_call_context:
Expand Down Expand Up @@ -437,6 +441,7 @@ def reject_call(
:type call_reject_reason: str or CallRejectReason
:return: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError
"""

if not incoming_call_context:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def get_call_properties(self, **kwargs) -> CallConnectionProperties:
:return: CallConnectionProperties
:type: CallConnectionProperties
:raises ~azure.core.exceptions.HttpResponseError
"""
return CallConnectionProperties._from_generated( # pylint:disable=protected-access
self._call_connection_client.get_call(call_connection_id=self.call_connection_id, **kwargs))
Expand All @@ -105,6 +106,7 @@ def hang_up(self, is_for_everyone: bool, **kwargs) -> None:
:type repeatability_first_sent: str
:return: None
:type: None
:raises ~azure.core.exceptions.HttpResponseError
"""

repeatability_request_id = kwargs.pop("repeatability_request_id", None)
Expand All @@ -129,6 +131,7 @@ def get_participant(self, participantMri: str, **kwargs) -> CallParticipant:
:param participant_raw_id: Raw id of the participant to retrieve. Required.
:type participant_raw_id: str
:return: CallParticipant
:raises ~azure.core.exceptions.HttpResponseError
"""
return CallParticipant._from_generated( # pylint:disable=protected-access
self._call_connection_client.get_participant(self.call_connection_id, participantMri, **kwargs))
Expand All @@ -143,6 +146,7 @@ def list_participants(self, **kwargs) -> GetParticipantsResponse:
:param participant_raw_id: Raw id of the participant to retrieve. Required.
:type participant_raw_id: str
:return: GetParticipantsResponse
:raises ~azure.core.exceptions.HttpResponseError
"""
return GetParticipantsResponse._from_generated( # pylint:disable=protected-access
self._call_connection_client.get_participants(self.call_connection_id, **kwargs))
Expand All @@ -168,6 +172,7 @@ def transfer_call_to_participant(self, target: CallInvite, **kwargs: Any) -> Tra
Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None.
:type repeatability_first_sent: str
:return: TransferCallResponse
:raises ~azure.core.exceptions.HttpResponseError
"""
user_custom_context = CustomContext(
voip_headers=target.voipHeaders, sip_headers=target.sipHeaders)
Expand Down Expand Up @@ -210,6 +215,7 @@ def add_participant(self, participant: CallInvite, **kwargs: Any) -> AddParticip
Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None.
:type repeatability_first_sent: str
:return: AddParticipantResponse
:raises ~azure.core.exceptions.HttpResponseError
"""
user_custom_context = CustomContext(
voip_headers=participant.voipHeaders, sip_headers=participant.sipHeaders)
Expand Down Expand Up @@ -254,6 +260,7 @@ def remove_participant(self, participant: CommunicationIdentifier, **kwargs: Any
Example: Sun, 06 Nov 1994 08:49:37 GMT. Default value is None.
:type repeatability_first_sent: str
:return: AddParticipantResponse
:raises ~azure.core.exceptions.HttpResponseError
"""

remove_participant_request = RemoveParticipantRequest(participant_to_remove=serialize_identifier(participant),
Expand Down

0 comments on commit 2d9b15b

Please sign in to comment.