diff --git a/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/_operations/_patch.py b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/_operations/_patch.py index 11175e891495..1121c94523f2 100644 --- a/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/_operations/_patch.py +++ b/sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/_operations/_patch.py @@ -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. @@ -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: """ @@ -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 @@ -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. @@ -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: @@ -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 @@ -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. @@ -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: @@ -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 @@ -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. @@ -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: @@ -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 + 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