Skip to content

Commit 4b42415

Browse files
msyyciscai-msftannatisch
authored
[webpubsub] update for api-version 2021-10-01 (Azure#21393)
* head-as-boolean * build_auth_token * review * handwrite fix for text/plain * review * update __init__ * update patch format * review * revert reamde.me * regenerate * bump min azure-core version for aiohttp fix * rengerate * test * review * update changelog * async for get_client_access_token * dependency * Code regen * Fix smoke test * bump azure-core min dep to 1.20.1 * add client access token tests * record tests * add back in JSONType typehints and remove whitespace * rerecord with unblank * make super call 2.7 compatible * address my comments * get samples running * context manage from connection string async sample Co-authored-by: iscai-msft <iscai@microsoft.com> Co-authored-by: antisch <antisch@microsoft.com>
1 parent 03d6d4a commit 4b42415

34 files changed

+876
-301
lines changed

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
# Release History
22

3-
## 1.0.0b3 (Unreleased)
3+
## 1.0.0 (2021-11-09)
44

5-
### Features Added
5+
### Breaking changes
66

7-
### Breaking Changes
7+
- rename operation `generate_client_token` to `get_client_access_token`
8+
- moved operation `build_authentication_token` into `get_client_access_token` on the client
9+
- rename parameter `role` to `roles` of operation `get_client_access_token`
10+
- remove the `operations` namespace from `azure.messaging.webpubsubservice`
11+
- rename operation `check_permission` to `has_permission`
12+
- operations `connection_exists`, `group_exists`, `user_exists`, and `has_permission` now return boolean values instead of raising
813

9-
### Bugs Fixed
10-
11-
### Other Changes
1214

1315
## 1.0.0b2 (2021-10-14)
1416

15-
- Change api-version to `2021-10-01`
17+
- Change api-version to `2021-10-01`
1618
- Add operations to client
1719
- Support AAD
1820
- Support Api Management Proxy

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ When the client is connected, it can send messages to the upstream application,
8383

8484
## Examples
8585

86-
### Broadcast messages
86+
### Broadcast messages
8787

8888
```python
8989
>>> from azure.messaging.webpubsubservice import WebPubSubServiceClient
@@ -93,7 +93,7 @@ When the client is connected, it can send messages to the upstream application,
9393
>>> service = WebPubSubServiceClient(endpoint='<endpoint>', credential=DefaultAzureCredential())
9494
>>> with open('file.json', 'r') as f:
9595
try:
96-
service.send_to_all('ahub', content=f, content_type='application/json')
96+
service.send_to_all('ahub', content=f)
9797
except HttpResponseError as e:
9898
print('service responds error: {}'.format(e.response.json()))
9999

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,5 @@
1515
try:
1616
from ._patch import patch_sdk # type: ignore
1717
patch_sdk()
18-
19-
from ._patch import build_authentication_token
20-
from ._patch import WebPubSubServiceClient
21-
__all__ = ['WebPubSubServiceClient', 'build_authentication_token']
2218
except ImportError:
2319
pass

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ class WebPubSubServiceClientConfiguration(Configuration):
3030
:type endpoint: str
3131
:param credential: Credential needed for the client to connect to Azure.
3232
:type credential: ~azure.core.credentials.TokenCredential
33+
:keyword api_version: Api Version. The default value is "2021-10-01". Note that overriding this default value may result in unsupported behavior.
34+
:paramtype api_version: str
3335
"""
3436

3537
def __init__(
@@ -39,15 +41,17 @@ def __init__(
3941
**kwargs # type: Any
4042
):
4143
# type: (...) -> None
44+
super(WebPubSubServiceClientConfiguration, self).__init__(**kwargs)
45+
api_version = kwargs.pop('api_version', "2021-10-01") # type: str
46+
4247
if endpoint is None:
4348
raise ValueError("Parameter 'endpoint' must not be None.")
4449
if credential is None:
4550
raise ValueError("Parameter 'credential' must not be None.")
46-
super(WebPubSubServiceClientConfiguration, self).__init__(**kwargs)
4751

4852
self.endpoint = endpoint
4953
self.credential = credential
50-
self.api_version = "2021-10-01"
54+
self.api_version = api_version
5155
self.credential_scopes = kwargs.pop('credential_scopes', ['https://webpubsub.azure.com/.default'])
5256
kwargs.setdefault('sdk_moniker', 'messaging-webpubsubservice/{}'.format(VERSION))
5357
self._configure(**kwargs)

sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/aio/operations/__init__.py renamed to sdk/webpubsub/azure-messaging-webpubsubservice/azure/messaging/webpubsubservice/_operations/__init__.py

File renamed without changes.

0 commit comments

Comments
 (0)