Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WebPubSub] Update 1.1.0 #34552

Merged
merged 3 commits into from
Mar 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def get_client_access_token(self, **kwargs: Any) -> JSON:

@distributed_trace
def send_to_all( # pylint: disable=inconsistent-return-statements
self, message: IO, *, excluded: Optional[List[str]] = None, filter: Optional[str] = None, **kwargs: Any
self, message: IO, *, excluded: Optional[List[str]] = None, filter: Optional[str] = None, content_type: Optional[str] = None, **kwargs: Any
) -> None:
"""Broadcast content inside request body to all the connected client connections.

Expand All @@ -142,6 +142,8 @@ def send_to_all( # pylint: disable=inconsistent-return-statements
messages. Default value is None.
:paramtype filter: str
:return: None
:keyword content_type: The content type of the payload. Default value is None. Allowed values are 'application/json', 'application/octet-stream' and 'text/plain'
:paramtype content_type: str
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
Expand All @@ -156,7 +158,7 @@ def send_to_all( # pylint: disable=inconsistent-return-statements
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = kwargs.pop("params", {}) or {}

content_type = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) # type: str
content_type = _headers.pop("Content-Type", "application/json") if content_type is None else content_type
cls = kwargs.pop("cls", None) # type: ClsType[None]

_json = None
Expand Down Expand Up @@ -201,7 +203,7 @@ def send_to_all( # pylint: disable=inconsistent-return-statements

@distributed_trace
def send_to_user( # pylint: disable=inconsistent-return-statements
self, user_id: str, message: IO, *, filter: Optional[str] = None, **kwargs: Any
self, user_id: str, message: IO, *, filter: Optional[str] = None, content_type: Optional[str] = None, **kwargs: Any
) -> None:
"""Send content inside request body to the specific user.

Expand All @@ -214,6 +216,8 @@ def send_to_user( # pylint: disable=inconsistent-return-statements
:keyword filter: Following OData filter syntax to filter out the subscribers receiving the
messages. Default value is None.
:paramtype filter: str
:keyword content_type: The content type of the payload. Default value is None. Allowed values are 'application/json', 'application/octet-stream' and 'text/plain'
:paramtype content_type: str
:return: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
Expand All @@ -229,7 +233,7 @@ def send_to_user( # pylint: disable=inconsistent-return-statements
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = kwargs.pop("params", {}) or {}

content_type = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) # type: str
content_type = _headers.pop("Content-Type", "application/json") if content_type is None else content_type
cls = kwargs.pop("cls", None) # type: ClsType[None]

_json = None
Expand Down Expand Up @@ -280,6 +284,7 @@ def send_to_group( # pylint: disable=inconsistent-return-statements
*,
excluded: Optional[List[str]] = None,
filter: Optional[str] = None,
content_type: Optional[str] = None,
**kwargs: Any
) -> None:
"""Send content inside request body to a group of connections.
Expand All @@ -296,6 +301,8 @@ def send_to_group( # pylint: disable=inconsistent-return-statements
:keyword filter: Following OData filter syntax to filter out the subscribers receiving the
messages. Default value is None.
:paramtype filter: str
:keyword content_type: The content type of the payload. Default value is None. Allowed values are 'application/json', 'application/octet-stream' and 'text/plain'
:paramtype content_type: str
:return: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
Expand All @@ -311,7 +318,7 @@ def send_to_group( # pylint: disable=inconsistent-return-statements
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = kwargs.pop("params", {}) or {}

content_type = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) # type: str
content_type = _headers.pop("Content-Type", "application/json") if content_type is None else content_type
cls = kwargs.pop("cls", None) # type: ClsType[None]

_json = None
Expand Down Expand Up @@ -357,7 +364,7 @@ def send_to_group( # pylint: disable=inconsistent-return-statements

@distributed_trace
def send_to_connection( # pylint: disable=inconsistent-return-statements
self, connection_id: str, message: IO, **kwargs: Any
self, connection_id: str, message: IO, *, content_type: Optional[str] = None, **kwargs: Any
) -> None:
"""Send content inside request body to the specific connection.

Expand All @@ -367,6 +374,8 @@ def send_to_connection( # pylint: disable=inconsistent-return-statements
:type connection_id: str
:param message: The payload body. Required.
:type message: IO
:keyword content_type: The content type of the payload. Default value is None. Allowed values are 'application/json', 'application/octet-stream' and 'text/plain'
:paramtype content_type: str
:return: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
Expand All @@ -382,7 +391,7 @@ def send_to_connection( # pylint: disable=inconsistent-return-statements
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = kwargs.pop("params", {}) or {}

content_type = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) # type: str
msyyc marked this conversation as resolved.
Show resolved Hide resolved
content_type = _headers.pop("Content-Type", "application/json") if content_type is None else content_type
msyyc marked this conversation as resolved.
Show resolved Hide resolved
cls = kwargs.pop("cls", None) # type: ClsType[None]

_json = None
Expand Down
Loading