Skip to content

Commit aa84722

Browse files
authored
Add list_connections_in_group for Web PubSub SDK (Azure#40911)
1 parent b1b3540 commit aa84722

File tree

25 files changed

+2935
-173
lines changed

25 files changed

+2935
-173
lines changed

sdk/webpubsub/azure-messaging-webpubsubservice/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Release History
22

3+
## 1.3.0 (Unreleased)
4+
5+
### Features Added
6+
- Added new APIs "list_connections"
7+
38
## 1.2.2 (2025-02-28)
49

510
### Features Added

sdk/webpubsub/azure-messaging-webpubsubservice/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "python",
44
"TagPrefix": "python/webpubsub/azure-messaging-webpubsubservice",
5-
"Tag": "python/webpubsub/azure-messaging-webpubsubservice_9aa2aadef9"
5+
"Tag": "python/webpubsub/azure-messaging-webpubsubservice_34edba9a6b"
66
}

sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,28 @@
55
# Code generated by Microsoft (R) AutoRest Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._client import WebPubSubServiceClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._client import WebPubSubServiceClient # type: ignore
1016
from ._version import VERSION
1117

1218
__version__ = VERSION
1319

1420
try:
1521
from ._patch import __all__ as _patch_all
16-
from ._patch import * # pylint: disable=unused-wildcard-import
22+
from ._patch import *
1723
except ImportError:
1824
_patch_all = []
1925
from ._patch import patch_sdk as _patch_sdk
2026

2127
__all__ = [
2228
"WebPubSubServiceClient",
2329
]
24-
__all__.extend([p for p in _patch_all if p not in __all__])
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2531

2632
_patch_sdk()

sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/_client.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,13 @@
1616

1717
from ._configuration import WebPubSubServiceClientConfiguration
1818
from ._operations import WebPubSubServiceClientOperationsMixin
19-
from ._serialization import Deserializer, Serializer
19+
from ._utils.serialization import Deserializer, Serializer
2020

2121
if TYPE_CHECKING:
22-
# pylint: disable=unused-import,ungrouped-imports
2322
from azure.core.credentials import TokenCredential
2423

2524

26-
class WebPubSubServiceClient(
27-
WebPubSubServiceClientOperationsMixin
28-
): # pylint: disable=client-accepts-api-version-keyword
25+
class WebPubSubServiceClient(WebPubSubServiceClientOperationsMixin):
2926
"""WebPubSubServiceClient.
3027
3128
:param hub: Target hub name, which should start with alphabetic characters and only contain
@@ -35,14 +32,15 @@ class WebPubSubServiceClient(
3532
:type endpoint: str
3633
:param credential: Credential needed for the client to connect to Azure. Required.
3734
:type credential: ~azure.core.credentials.TokenCredential
38-
:keyword api_version: Api Version. Default value is "2024-01-01". Note that overriding this
35+
:keyword api_version: Api Version. Default value is "2024-12-01". Note that overriding this
3936
default value may result in unsupported behavior.
4037
:paramtype api_version: str
4138
"""
4239

4340
def __init__(self, hub: str, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None:
4441
_endpoint = "{endpoint}"
4542
self._config = WebPubSubServiceClientConfiguration(hub=hub, endpoint=endpoint, credential=credential, **kwargs)
43+
4644
_policies = kwargs.pop("policies", None)
4745
if _policies is None:
4846
_policies = [

sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/_configuration.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@
1313
from ._version import VERSION
1414

1515
if TYPE_CHECKING:
16-
# pylint: disable=unused-import,ungrouped-imports
1716
from azure.core.credentials import TokenCredential
1817

1918

20-
class WebPubSubServiceClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
19+
class WebPubSubServiceClientConfiguration: # pylint: disable=too-many-instance-attributes
2120
"""Configuration for WebPubSubServiceClient.
2221
2322
Note that all parameters used to create this instance are saved as instance
@@ -30,13 +29,13 @@ class WebPubSubServiceClientConfiguration: # pylint: disable=too-many-instance-
3029
:type endpoint: str
3130
:param credential: Credential needed for the client to connect to Azure. Required.
3231
:type credential: ~azure.core.credentials.TokenCredential
33-
:keyword api_version: Api Version. Default value is "2024-01-01". Note that overriding this
32+
:keyword api_version: Api Version. Default value is "2024-12-01". Note that overriding this
3433
default value may result in unsupported behavior.
3534
:paramtype api_version: str
3635
"""
3736

3837
def __init__(self, hub: str, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None:
39-
api_version: str = kwargs.pop("api_version", "2024-01-01")
38+
api_version: str = kwargs.pop("api_version", "2024-12-01")
4039

4140
if hub is None:
4241
raise ValueError("Parameter 'hub' must not be None.")
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
from typing import Optional
2+
3+
class GroupMember:
4+
"""Represents a member in a group.
5+
6+
:param connection_id: A unique identifier of a connection.
7+
:type connection_id: str
8+
:param user_id: The user ID of the connection. A user can have multiple connections.
9+
:type user_id: Optional[str]
10+
"""
11+
12+
def __init__(self, connection_id: str, user_id: Optional[str] = None) -> None:
13+
self._connection_id = connection_id
14+
self._user_id = user_id
15+
16+
@property
17+
def connection_id(self) -> str:
18+
"""Gets the connection ID.
19+
20+
:return: The connection ID.
21+
:rtype: str
22+
"""
23+
return self._connection_id
24+
25+
@property
26+
def user_id(self) -> Optional[str]:
27+
"""Gets the user ID.
28+
29+
:return: The user ID.
30+
:rtype: Optional[str]
31+
"""
32+
return self._user_id
33+
34+
def __repr__(self) -> str:
35+
return f"GroupMember(connection_id={self._connection_id!r}, user_id={self._user_id!r}, id={id(self)})"[:1024]

sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/_operations/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,21 @@
55
# Code generated by Microsoft (R) AutoRest Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._operations import WebPubSubServiceClientOperationsMixin
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._operations import WebPubSubServiceClientOperationsMixin # type: ignore
1016

1117
from ._patch import __all__ as _patch_all
12-
from ._patch import * # pylint: disable=unused-wildcard-import
18+
from ._patch import *
1319
from ._patch import patch_sdk as _patch_sdk
1420

1521
__all__ = [
1622
"WebPubSubServiceClientOperationsMixin",
1723
]
18-
__all__.extend([p for p in _patch_all if p not in __all__])
24+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
1925
_patch_sdk()

0 commit comments

Comments
 (0)