Skip to content

Commit ce5e69e

Browse files
azure-sdkmsyycChenxiJiang333
authored
[AutoRelease] t2-powerbiembedded-2024-06-24-82297(can only be merged by SDK owner) (#36215)
* code and test * Update CHANGELOG.md * update-testcase --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: Yuchao Yan <[email protected]> Co-authored-by: ChenxiJiang333 <[email protected]>
1 parent c7a223b commit ce5e69e

File tree

72 files changed

+6520
-2403
lines changed

Some content is hidden

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

72 files changed

+6520
-2403
lines changed

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

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

3+
## 3.0.0 (2024-06-24)
4+
5+
This version uses a next-generation code generator that introduces important breaking changes, but also important new features (like unified authentication and async programming).
6+
7+
**General breaking changes**
8+
9+
- Credential system has been completly revamped:
10+
11+
- `azure.common.credentials` or `msrestazure.azure_active_directory` instances are no longer supported, use the `azure-identity` classes instead: https://pypi.org/project/azure-identity/
12+
- `credentials` parameter has been renamed `credential`
13+
14+
- The `config` attribute no longer exists on a client, configuration should be passed as kwarg. Example: `MyClient(credential, subscription_id, enable_logging=True)`. For a complete set of
15+
supported options, see the [parameters accept in init documentation of azure-core](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#available-policies)
16+
- You can't import a `version` module anymore, use `__version__` instead
17+
- Operations that used to return a `msrest.polling.LROPoller` now returns a `azure.core.polling.LROPoller` and are prefixed with `begin_`.
18+
- Exceptions tree have been simplified and most exceptions are now `azure.core.exceptions.HttpResponseError` (`CloudError` has been removed).
19+
- Most of the operation kwarg have changed. Some of the most noticeable:
20+
21+
- `raw` has been removed. Equivalent feature can be found using `cls`, a callback that will give access to internal HTTP response for advanced user
22+
- For a complete set of
23+
supported options, see the [parameters accept in Request documentation of azure-core](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#available-policies)
24+
25+
**General new features**
26+
27+
- Type annotations support using `typing`. SDKs are mypy ready.
28+
- This client has now stable and official support for async. Check the `aio` namespace of your package to find the async client.
29+
- This client now support natively tracing library like OpenCensus or OpenTelemetry. See this [tracing quickstart](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/core/azure-core-tracing-opentelemetry) for an overview.
30+
31+
### Features Added
32+
33+
- Added operation group PowerBIEmbeddedManagementClientOperationsMixin
34+
35+
### Breaking Changes
36+
37+
- Operation WorkspaceCollectionsOperations.check_name_availability has a new required parameter body
38+
- Operation WorkspaceCollectionsOperations.check_name_availability has a new required parameter kwargs
39+
- Operation WorkspaceCollectionsOperations.check_name_availability no longer has parameter name
40+
- Operation WorkspaceCollectionsOperations.check_name_availability no longer has parameter type
41+
- Operation WorkspaceCollectionsOperations.create has a new required parameter body
42+
- Operation WorkspaceCollectionsOperations.create has a new required parameter kwargs
43+
- Operation WorkspaceCollectionsOperations.create no longer has parameter location
44+
- Operation WorkspaceCollectionsOperations.create no longer has parameter tags
45+
- Operation WorkspaceCollectionsOperations.get_access_keys has a new required parameter kwargs
46+
- Operation WorkspaceCollectionsOperations.get_by_name has a new required parameter kwargs
47+
- Operation WorkspaceCollectionsOperations.list_by_resource_group has a new required parameter kwargs
48+
- Operation WorkspaceCollectionsOperations.list_by_subscription has a new required parameter kwargs
49+
- Operation WorkspaceCollectionsOperations.migrate has a new required parameter body
50+
- Operation WorkspaceCollectionsOperations.migrate has a new required parameter kwargs
51+
- Operation WorkspaceCollectionsOperations.migrate no longer has parameter resources
52+
- Operation WorkspaceCollectionsOperations.migrate no longer has parameter target_resource_group
53+
- Operation WorkspaceCollectionsOperations.regenerate_key has a new required parameter body
54+
- Operation WorkspaceCollectionsOperations.regenerate_key has a new required parameter kwargs
55+
- Operation WorkspaceCollectionsOperations.regenerate_key no longer has parameter key_name
56+
- Operation WorkspaceCollectionsOperations.update has a new required parameter body
57+
- Operation WorkspaceCollectionsOperations.update has a new required parameter kwargs
58+
- Operation WorkspaceCollectionsOperations.update no longer has parameter tags
59+
- Operation WorkspacesOperations.list has a new required parameter kwargs
60+
- Renamed operation WorkspaceCollectionsOperations.delete to WorkspaceCollectionsOperations.begin_delete
61+
362
## 2.0.0 (2018-05-25)
463

564
**Features**
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
include _meta.json
2-
recursive-include tests *.py *.yaml
2+
recursive-include tests *.py *.json
3+
recursive-include samples *.py *.md
34
include *.md
45
include azure/__init__.py
56
include azure/mgmt/__init__.py
67
include LICENSE
8+
include azure/mgmt/powerbiembedded/py.typed

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

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,61 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Power BI Embedded Management Client Library.
4-
This package has been tested with Python 3.6+.
4+
This package has been tested with Python 3.8+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
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+
- Python 3.8+ is required to use this package.
16+
- [Azure subscription](https://azure.microsoft.com/free/)
1517

18+
### Install the package
1619

17-
18-
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/power-bi)
19-
Code samples for this package can be found at [Power BI Embedded Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
20-
Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
20+
```bash
21+
pip install azure-mgmt-powerbiembedded
22+
pip install azure-identity
23+
```
2124

25+
### Authentication
2226

23-
# Provide Feedback
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.powerbiembedded import PowerBIEmbeddedManagementClient
40+
import os
41+
42+
sub_id = os.getenv("AZURE_SUBSCRIPTION_ID")
43+
client = PowerBIEmbeddedManagementClient(credential=DefaultAzureCredential(), subscription_id=sub_id)
44+
```
45+
46+
## Examples
47+
48+
Code samples for this package can be found at:
49+
- [Search Power BI Embedded 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
2458

2559
If you encounter any bugs or have suggestions, please file an issue in the
2660
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
2761
section of the project.
28-
29-
30-
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-powerbiembedded%2FREADME.png)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"commit": "9f9d14b5db982b1d554651348adc9bef4b098bdb",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"autorest": "3.10.2",
5+
"use": [
6+
"@autorest/[email protected]",
7+
"@autorest/[email protected]"
8+
],
9+
"autorest_command": "autorest specification/powerbiembedded/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/[email protected] --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
10+
"readme": "specification/powerbiembedded/resource-manager/readme.md"
11+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"AssetsRepo": "Azure/azure-sdk-assets",
3+
"AssetsRepoPrefixPath": "python",
4+
"TagPrefix": "python/powerbiembedded/azure-mgmt-powerbiembedded",
5+
"Tag": "python/powerbiembedded/azure-mgmt-powerbiembedded_3a0f8a6592"
6+
}
Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
# coding=utf-8
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
4-
# Licensed under the MIT License. See License.txt in the project root for
5-
# license information.
6-
#
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
75
# Code generated by Microsoft (R) AutoRest Code Generator.
8-
# Changes may cause incorrect behavior and will be lost if the code is
9-
# regenerated.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
107
# --------------------------------------------------------------------------
118

12-
from .power_bi_embedded_management_client import PowerBIEmbeddedManagementClient
13-
from .version import VERSION
14-
15-
__all__ = ['PowerBIEmbeddedManagementClient']
9+
from ._power_bi_embedded_management_client import PowerBIEmbeddedManagementClient
10+
from ._version import VERSION
1611

1712
__version__ = VERSION
1813

14+
try:
15+
from ._patch import __all__ as _patch_all
16+
from ._patch import * # pylint: disable=unused-wildcard-import
17+
except ImportError:
18+
_patch_all = []
19+
from ._patch import patch_sdk as _patch_sdk
20+
21+
__all__ = [
22+
"PowerBIEmbeddedManagementClient",
23+
]
24+
__all__.extend([p for p in _patch_all if p not in __all__])
25+
26+
_patch_sdk()
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from typing import Any, TYPE_CHECKING
10+
11+
from azure.core.pipeline import policies
12+
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
13+
14+
from ._version import VERSION
15+
16+
if TYPE_CHECKING:
17+
# pylint: disable=unused-import,ungrouped-imports
18+
from azure.core.credentials import TokenCredential
19+
20+
21+
class PowerBIEmbeddedManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
22+
"""Configuration for PowerBIEmbeddedManagementClient.
23+
24+
Note that all parameters used to create this instance are saved as instance
25+
attributes.
26+
27+
:param credential: Credential needed for the client to connect to Azure. Required.
28+
:type credential: ~azure.core.credentials.TokenCredential
29+
:param subscription_id: Gets subscription credentials which uniquely identify a Microsoft Azure
30+
subscription. The subscription ID forms part of the URI for every service call. Required.
31+
:type subscription_id: str
32+
:keyword api_version: Api Version. Default value is "2016-01-29". Note that overriding this
33+
default value may result in unsupported behavior.
34+
:paramtype api_version: str
35+
"""
36+
37+
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
38+
api_version: str = kwargs.pop("api_version", "2016-01-29")
39+
40+
if credential is None:
41+
raise ValueError("Parameter 'credential' must not be None.")
42+
if subscription_id is None:
43+
raise ValueError("Parameter 'subscription_id' must not be None.")
44+
45+
self.credential = credential
46+
self.subscription_id = subscription_id
47+
self.api_version = api_version
48+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
49+
kwargs.setdefault("sdk_moniker", "mgmt-powerbiembedded/{}".format(VERSION))
50+
self.polling_interval = kwargs.get("polling_interval", 30)
51+
self._configure(**kwargs)
52+
53+
def _configure(self, **kwargs: Any) -> None:
54+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
55+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
56+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
57+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
58+
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
59+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
60+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
61+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
62+
self.authentication_policy = kwargs.get("authentication_policy")
63+
if self.credential and not self.authentication_policy:
64+
self.authentication_policy = ARMChallengeAuthenticationPolicy(
65+
self.credential, *self.credential_scopes, **kwargs
66+
)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# ------------------------------------
2+
# Copyright (c) Microsoft Corporation.
3+
# Licensed under the MIT License.
4+
# ------------------------------------
5+
"""Customize generated code here.
6+
7+
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
8+
"""
9+
from typing import List
10+
11+
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
12+
13+
14+
def patch_sdk():
15+
"""Do not remove from this file.
16+
17+
`patch_sdk` is a last resort escape hatch that allows you to do customizations
18+
you can't accomplish using the techniques described in
19+
https://aka.ms/azsdk/python/dpcodegen/python/customize
20+
"""

0 commit comments

Comments
 (0)