Skip to content
Merged
Show file tree
Hide file tree
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
15 changes: 15 additions & 0 deletions sdk/communication/azure-mgmt-communication/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Release History

## 2.0.0b3 (2023-03-23)

### Features Added

- Added operation CommunicationServicesOperations.regenerate_key
- Added operation CommunicationServicesOperations.update
- Added operation group SenderUsernamesOperations

### Breaking Changes

- Model DomainResource no longer has parameter valid_sender_usernames
- Model UpdateDomainRequestParameters no longer has parameter valid_sender_usernames
- Removed operation CommunicationServicesOperations.begin_regenerate_key
- Removed operation CommunicationServicesOperations.begin_update

## 2.0.0b2 (2022-11-28)

### Other Changes
Expand Down
50 changes: 43 additions & 7 deletions sdk/communication/azure-mgmt-communication/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,53 @@ For a more complete view of Azure libraries, see the [azure sdk python release](

_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_

# Usage
## Getting started

### Prerequisites

To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)

For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/)
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.
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)
- Python 3.7+ is required to use this package.
- [Azure subscription](https://azure.microsoft.com/free/)

### Install the package

# Provide Feedback
```bash
pip install azure-mgmt-communication
pip install azure-identity
```

### Authentication

By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.

- `AZURE_CLIENT_ID` for Azure client ID.
- `AZURE_TENANT_ID` for Azure tenant ID.
- `AZURE_CLIENT_SECRET` for Azure client secret.

In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`.

With above configuration, client can be authenticated by following code:

```python
from azure.identity import DefaultAzureCredential
from azure.mgmt.communication import CommunicationServiceManagementClient
import os

sub_id = os.getenv("AZURE_SUBSCRIPTION_ID")
client = CommunicationServiceManagementClient(credential=DefaultAzureCredential(), subscription_id=sub_id)
```

## Examples

Code samples for this package can be found at:
- [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
- [Azure Python Mgmt SDK Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)


## Troubleshooting

## Next steps

## Provide Feedback

If you encounter any bugs or have suggestions, please file an issue in the
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
Expand Down
6 changes: 3 additions & 3 deletions sdk/communication/azure-mgmt-communication/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "1fefe3f5cee88319b17c08a2dbf95e1e983a9f8c",
"commit": "6999a987a54bd6e1895c3abc9da7637503cb56e7",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/python@6.2.7",
"@autorest/python@6.4.3",
"@autorest/modelerfour@4.24.3"
],
"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",
"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",
"readme": "specification/communication/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@
from . import models as _models
from ._configuration import CommunicationServiceManagementClientConfiguration
from ._serialization import Deserializer, Serializer
from .operations import CommunicationServicesOperations, DomainsOperations, EmailServicesOperations, Operations
from .operations import (
CommunicationServicesOperations,
DomainsOperations,
EmailServicesOperations,
Operations,
SenderUsernamesOperations,
)

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

client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
Expand All @@ -69,6 +77,9 @@ def __init__(
)
self.domains = DomainsOperations(self._client, self._config, self._serialize, self._deserialize)
self.email_services = EmailServicesOperations(self._client, self._config, self._serialize, self._deserialize)
self.sender_usernames = SenderUsernamesOperations(
self._client, self._config, self._serialize, self._deserialize
)

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

def __exit__(self, *exc_details) -> None:
def __exit__(self, *exc_details: Any) -> None:
self._client.__exit__(*exc_details)
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ class CommunicationServiceManagementClientConfiguration(Configuration): # pylin

:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2022-07-01-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2023-03-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
"""

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

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Loading