Skip to content

Commit 70981d5

Browse files
azure-sdkmsyyc
andauthored
[AutoRelease] t2-communication-2023-03-20-22792(can only be merged by SDK owner) (#29453)
* code and test * Update CHANGELOG.md --------- Co-authored-by: PythonSdkPipelines <PythonSdkPipelines> Co-authored-by: Yuchao Yan <yuchaoyan@microsoft.com>
1 parent 419943d commit 70981d5

43 files changed

Lines changed: 2147 additions & 1011 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

sdk/communication/azure-mgmt-communication/CHANGELOG.md

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

3+
## 2.0.0b3 (2023-03-23)
4+
5+
### Features Added
6+
7+
- Added operation CommunicationServicesOperations.regenerate_key
8+
- Added operation CommunicationServicesOperations.update
9+
- Added operation group SenderUsernamesOperations
10+
11+
### Breaking Changes
12+
13+
- Model DomainResource no longer has parameter valid_sender_usernames
14+
- Model UpdateDomainRequestParameters no longer has parameter valid_sender_usernames
15+
- Removed operation CommunicationServicesOperations.begin_regenerate_key
16+
- Removed operation CommunicationServicesOperations.begin_update
17+
318
## 2.0.0b2 (2022-11-28)
419

520
### Other Changes

sdk/communication/azure-mgmt-communication/README.md

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,53 @@ For a more complete view of Azure libraries, see the [azure sdk python release](
88

99
_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_
1010

11-
# Usage
11+
## Getting started
1212

13+
### Prerequisites
1314

14-
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)
15-
16-
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/)
17-
Code samples for this package can be found at [Communication Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
18-
Additional code samples for different Azure services are available at [Samples Repo](https://github.com/Azure-Samples/azure-samples-python-management/tree/main/samples/communication)
15+
- Python 3.7+ is required to use this package.
16+
- [Azure subscription](https://azure.microsoft.com/free/)
1917

18+
### Install the package
2019

21-
# Provide Feedback
20+
```bash
21+
pip install azure-mgmt-communication
22+
pip install azure-identity
23+
```
24+
25+
### Authentication
26+
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
28+
29+
- `AZURE_CLIENT_ID` for Azure client ID.
30+
- `AZURE_TENANT_ID` for Azure tenant ID.
31+
- `AZURE_CLIENT_SECRET` for Azure client secret.
32+
33+
In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`.
34+
35+
With above configuration, client can be authenticated by following code:
36+
37+
```python
38+
from azure.identity import DefaultAzureCredential
39+
from azure.mgmt.communication import CommunicationServiceManagementClient
40+
import os
41+
42+
sub_id = os.getenv("AZURE_SUBSCRIPTION_ID")
43+
client = CommunicationServiceManagementClient(credential=DefaultAzureCredential(), subscription_id=sub_id)
44+
```
45+
46+
## Examples
47+
48+
Code samples for this package can be found at:
49+
- [Search Communication Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com
50+
- [Azure Python Mgmt SDK Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
51+
52+
53+
## Troubleshooting
54+
55+
## Next steps
56+
57+
## Provide Feedback
2258

2359
If you encounter any bugs or have suggestions, please file an issue in the
2460
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "1fefe3f5cee88319b17c08a2dbf95e1e983a9f8c",
2+
"commit": "6999a987a54bd6e1895c3abc9da7637503cb56e7",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.9.2",
55
"use": [
6-
"@autorest/python@6.2.7",
6+
"@autorest/python@6.4.3",
77
"@autorest/modelerfour@4.24.3"
88
],
9-
"autorest_command": "autorest specification/communication/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.2.7 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/communication/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.4.3 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
1010
"readme": "specification/communication/resource-manager/readme.md"
1111
}

sdk/communication/azure-mgmt-communication/azure/mgmt/communication/_communication_service_management_client.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515
from . import models as _models
1616
from ._configuration import CommunicationServiceManagementClientConfiguration
1717
from ._serialization import Deserializer, Serializer
18-
from .operations import CommunicationServicesOperations, DomainsOperations, EmailServicesOperations, Operations
18+
from .operations import (
19+
CommunicationServicesOperations,
20+
DomainsOperations,
21+
EmailServicesOperations,
22+
Operations,
23+
SenderUsernamesOperations,
24+
)
1925

2026
if TYPE_CHECKING:
2127
# pylint: disable=unused-import,ungrouped-imports
@@ -34,13 +40,15 @@ class CommunicationServiceManagementClient: # pylint: disable=client-accepts-ap
3440
:vartype domains: azure.mgmt.communication.operations.DomainsOperations
3541
:ivar email_services: EmailServicesOperations operations
3642
:vartype email_services: azure.mgmt.communication.operations.EmailServicesOperations
43+
:ivar sender_usernames: SenderUsernamesOperations operations
44+
:vartype sender_usernames: azure.mgmt.communication.operations.SenderUsernamesOperations
3745
:param credential: Credential needed for the client to connect to Azure. Required.
3846
:type credential: ~azure.core.credentials.TokenCredential
39-
:param subscription_id: The ID of the target subscription. Required.
47+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
4048
:type subscription_id: str
4149
:param base_url: Service URL. Default value is "https://management.azure.com".
4250
:type base_url: str
43-
:keyword api_version: Api Version. Default value is "2022-07-01-preview". Note that overriding
51+
:keyword api_version: Api Version. Default value is "2023-03-01-preview". Note that overriding
4452
this default value may result in unsupported behavior.
4553
:paramtype api_version: str
4654
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -57,7 +65,7 @@ def __init__(
5765
self._config = CommunicationServiceManagementClientConfiguration(
5866
credential=credential, subscription_id=subscription_id, **kwargs
5967
)
60-
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
68+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
6169

6270
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
6371
self._serialize = Serializer(client_models)
@@ -69,6 +77,9 @@ def __init__(
6977
)
7078
self.domains = DomainsOperations(self._client, self._config, self._serialize, self._deserialize)
7179
self.email_services = EmailServicesOperations(self._client, self._config, self._serialize, self._deserialize)
80+
self.sender_usernames = SenderUsernamesOperations(
81+
self._client, self._config, self._serialize, self._deserialize
82+
)
7283

7384
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
7485
"""Runs the network request through the client's chained policies.
@@ -99,5 +110,5 @@ def __enter__(self) -> "CommunicationServiceManagementClient":
99110
self._client.__enter__()
100111
return self
101112

102-
def __exit__(self, *exc_details) -> None:
113+
def __exit__(self, *exc_details: Any) -> None:
103114
self._client.__exit__(*exc_details)

sdk/communication/azure-mgmt-communication/azure/mgmt/communication/_configuration.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ class CommunicationServiceManagementClientConfiguration(Configuration): # pylin
3333
3434
:param credential: Credential needed for the client to connect to Azure. Required.
3535
:type credential: ~azure.core.credentials.TokenCredential
36-
:param subscription_id: The ID of the target subscription. Required.
36+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3737
:type subscription_id: str
38-
:keyword api_version: Api Version. Default value is "2022-07-01-preview". Note that overriding
38+
:keyword api_version: Api Version. Default value is "2023-03-01-preview". Note that overriding
3939
this default value may result in unsupported behavior.
4040
:paramtype api_version: str
4141
"""
4242

4343
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
4444
super(CommunicationServiceManagementClientConfiguration, self).__init__(**kwargs)
45-
api_version: Literal["2022-07-01-preview"] = kwargs.pop("api_version", "2022-07-01-preview")
45+
api_version: Literal["2023-03-01-preview"] = kwargs.pop("api_version", "2023-03-01-preview")
4646

4747
if credential is None:
4848
raise ValueError("Parameter 'credential' must not be None.")

0 commit comments

Comments
 (0)