Skip to content

Commit 41d37cb

Browse files
author
SDKAuto
committed
CodeGen from PR 34282 in Azure/azure-rest-api-specs
Merge 2b252a191ed197f02261e920594d8743ad208bcf into 4c0f7731c93696af01bd2bb9927bf28d2afcbc98
1 parent 37034c4 commit 41d37cb

Some content is hidden

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

52 files changed

+4228
-3488
lines changed

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

+46
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,51 @@
11
# Release History
22

3+
## 2.0.0 (2025-04-28)
4+
5+
### Features Added
6+
7+
- Model `AutoScaleVCoreListResult` added property `next_link`
8+
- Model `CapacitySku` added property `capacity`
9+
- Model `DedicatedCapacities` added property `next_link`
10+
- Model `DedicatedCapacity` added property `tenant_id`
11+
- Model `DedicatedCapacity` added property `friendly_name`
12+
- Model `DedicatedCapacityMutableProperties` added property `tenant_id`
13+
- Model `DedicatedCapacityMutableProperties` added property `friendly_name`
14+
- Model `DedicatedCapacityProperties` added property `tenant_id`
15+
- Model `DedicatedCapacityProperties` added property `friendly_name`
16+
- Model `DedicatedCapacityUpdateParameters` added property `tenant_id`
17+
- Model `DedicatedCapacityUpdateParameters` added property `friendly_name`
18+
- Model `Operation` added property `origin`
19+
- Model `Operation` added property `properties`
20+
- Model `OperationDisplay` added property `description`
21+
- Model `SkuDetailsForExistingResource` added property `resource_type`
22+
- Added enum `CreatedByType`
23+
- Added model `LogSpecification`
24+
- Added model `MetricSpecification`
25+
- Added model `MetricSpecificationDimensionsItem`
26+
- Added model `OperationProperties`
27+
- Added model `ServiceSpecification`
28+
- Added model `TrackedResource`
29+
- Model `AutoScaleVCoresOperations` added parameter `kwargs` in method `__init__`
30+
- Model `CapacitiesOperations` added parameter `kwargs` in method `__init__`
31+
- Model `Operations` added parameter `kwargs` in method `__init__`
32+
- Method `AutoScaleVCoresOperations.create` has a new overload `def create(self: None, resource_group_name: str, vcore_name: str, v_core_parameters: AutoScaleVCore, content_type: str)`
33+
- Method `AutoScaleVCoresOperations.create` has a new overload `def create(self: None, resource_group_name: str, vcore_name: str, v_core_parameters: IO[bytes], content_type: str)`
34+
- Method `AutoScaleVCoresOperations.update` has a new overload `def update(self: None, resource_group_name: str, vcore_name: str, v_core_update_parameters: AutoScaleVCoreUpdateParameters, content_type: str)`
35+
- Method `AutoScaleVCoresOperations.update` has a new overload `def update(self: None, resource_group_name: str, vcore_name: str, v_core_update_parameters: IO[bytes], content_type: str)`
36+
- Method `CapacitiesOperations.begin_create` has a new overload `def begin_create(self: None, resource_group_name: str, dedicated_capacity_name: str, capacity_parameters: DedicatedCapacity, content_type: str)`
37+
- Method `CapacitiesOperations.begin_create` has a new overload `def begin_create(self: None, resource_group_name: str, dedicated_capacity_name: str, capacity_parameters: IO[bytes], content_type: str)`
38+
- Method `CapacitiesOperations.begin_update` has a new overload `def begin_update(self: None, resource_group_name: str, dedicated_capacity_name: str, capacity_update_parameters: DedicatedCapacityUpdateParameters, content_type: str)`
39+
- Method `CapacitiesOperations.begin_update` has a new overload `def begin_update(self: None, resource_group_name: str, dedicated_capacity_name: str, capacity_update_parameters: IO[bytes], content_type: str)`
40+
- Method `CapacitiesOperations.check_name_availability` has a new overload `def check_name_availability(self: None, location: str, capacity_parameters: CheckCapacityNameAvailabilityParameters, content_type: str)`
41+
- Method `CapacitiesOperations.check_name_availability` has a new overload `def check_name_availability(self: None, location: str, capacity_parameters: IO[bytes], content_type: str)`
42+
43+
### Breaking Changes
44+
45+
- Model `Resource` deleted or renamed its instance variable `location`
46+
- Model `Resource` deleted or renamed its instance variable `tags`
47+
- Deleted or renamed model `IdentityType`
48+
349
## 1.1.0b1 (2022-10-28)
450

551
### Features Added
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,61 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Power BI Dedicated Management Client Library.
4-
This package has been tested with Python 3.7+.
4+
This package has been tested with Python 3.9+.
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-
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 [Power BI Dedicated 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://aka.ms/azsdk/python/mgmt/samples)
15+
- Python 3.9+ 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-powerbidedicated
22+
pip install azure-identity
23+
```
2224

23-
If you encounter any bugs or have suggestions, please file an issue in the
24-
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
25-
section of the project.
25+
### Authentication
26+
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the 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.powerbidedicated import PowerBIDedicated
40+
import os
2641

42+
sub_id = os.getenv("AZURE_SUBSCRIPTION_ID")
43+
client = PowerBIDedicated(credential=DefaultAzureCredential(), subscription_id=sub_id)
44+
```
2745

46+
## Examples
2847

48+
Code samples for this package can be found at:
49+
- [Search Power BI Dedicated 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
58+
59+
If you encounter any bugs or have suggestions, please file an issue in the
60+
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
61+
section of the project.
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "e82a24def11ffc98cc263884f9f1742c99f2df5e",
2+
"commit": "11b4c940bc9e24d17bca61b13d26553516021192",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.2",
4+
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.2.1",
7-
"@autorest/modelerfour@4.24.3"
6+
"@autorest/python@6.34.1",
7+
"@autorest/modelerfour@4.27.0"
88
],
9-
"autorest_command": "autorest specification/powerbidedicated/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.1 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/powerbidedicated/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.34.1 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/powerbidedicated/resource-manager/readme.md"
1111
}

sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/__init__.py

+9-3
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 ._power_bi_dedicated import PowerBIDedicated
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._power_bi_dedicated import PowerBIDedicated # 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 * # type: ignore # 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
"PowerBIDedicated",
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/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/_configuration.py

+6-18
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,34 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
import sys
109
from typing import Any, TYPE_CHECKING
1110

12-
from azure.core.configuration import Configuration
1311
from azure.core.pipeline import policies
1412
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1513

1614
from ._version import VERSION
1715

18-
if sys.version_info >= (3, 8):
19-
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
20-
else:
21-
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
22-
2316
if TYPE_CHECKING:
24-
# pylint: disable=unused-import,ungrouped-imports
2517
from azure.core.credentials import TokenCredential
2618

2719

28-
class PowerBIDedicatedConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
20+
class PowerBIDedicatedConfiguration: # pylint: disable=too-many-instance-attributes
2921
"""Configuration for PowerBIDedicated.
3022
3123
Note that all parameters used to create this instance are saved as instance
3224
attributes.
3325
3426
:param credential: Credential needed for the client to connect to Azure. Required.
3527
:type credential: ~azure.core.credentials.TokenCredential
36-
:param subscription_id: A unique identifier for a Microsoft Azure subscription. The
37-
subscription ID forms part of the URI for every service call. Required.
28+
:param subscription_id: The ID of the target subscription. Required.
3829
:type subscription_id: str
3930
:keyword api_version: Api Version. Default value is "2021-01-01". Note that overriding this
4031
default value may result in unsupported behavior.
4132
:paramtype api_version: str
4233
"""
4334

4435
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
45-
super(PowerBIDedicatedConfiguration, self).__init__(**kwargs)
46-
api_version = kwargs.pop("api_version", "2021-01-01") # type: Literal["2021-01-01"]
36+
api_version: str = kwargs.pop("api_version", "2021-01-01")
4737

4838
if credential is None:
4939
raise ValueError("Parameter 'credential' must not be None.")
@@ -55,20 +45,18 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
5545
self.api_version = api_version
5646
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
5747
kwargs.setdefault("sdk_moniker", "mgmt-powerbidedicated/{}".format(VERSION))
48+
self.polling_interval = kwargs.get("polling_interval", 30)
5849
self._configure(**kwargs)
5950

60-
def _configure(
61-
self, **kwargs # type: Any
62-
):
63-
# type: (...) -> None
51+
def _configure(self, **kwargs: Any) -> None:
6452
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
6553
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
6654
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
6755
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
6856
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
69-
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
7057
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
7158
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
59+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
7260
self.authentication_policy = kwargs.get("authentication_policy")
7361
if self.credential and not self.authentication_policy:
7462
self.authentication_policy = ARMChallengeAuthenticationPolicy(

sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/_power_bi_dedicated.py

+49-27
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,40 @@
77
# --------------------------------------------------------------------------
88

99
from copy import deepcopy
10-
from typing import Any, TYPE_CHECKING
10+
from typing import Any, Optional, TYPE_CHECKING, cast
11+
from typing_extensions import Self
1112

13+
from azure.core.pipeline import policies
1214
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
1316
from azure.mgmt.core import ARMPipelineClient
17+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
1419

15-
from . import models
20+
from . import models as _models
1621
from ._configuration import PowerBIDedicatedConfiguration
17-
from ._serialization import Deserializer, Serializer
22+
from ._utils.serialization import Deserializer, Serializer
1823
from .operations import AutoScaleVCoresOperations, CapacitiesOperations, Operations
1924

2025
if TYPE_CHECKING:
21-
# pylint: disable=unused-import,ungrouped-imports
2226
from azure.core.credentials import TokenCredential
2327

2428

25-
class PowerBIDedicated: # pylint: disable=client-accepts-api-version-keyword
29+
class PowerBIDedicated:
2630
"""PowerBI Dedicated Web API provides a RESTful set of web services that enables users to create,
2731
retrieve, update, and delete Power BI dedicated capacities.
2832
29-
:ivar capacities: CapacitiesOperations operations
30-
:vartype capacities: azure.mgmt.powerbidedicated.operations.CapacitiesOperations
3133
:ivar operations: Operations operations
3234
:vartype operations: azure.mgmt.powerbidedicated.operations.Operations
3335
:ivar auto_scale_vcores: AutoScaleVCoresOperations operations
3436
:vartype auto_scale_vcores: azure.mgmt.powerbidedicated.operations.AutoScaleVCoresOperations
37+
:ivar capacities: CapacitiesOperations operations
38+
:vartype capacities: azure.mgmt.powerbidedicated.operations.CapacitiesOperations
3539
:param credential: Credential needed for the client to connect to Azure. Required.
3640
:type credential: ~azure.core.credentials.TokenCredential
37-
:param subscription_id: A unique identifier for a Microsoft Azure subscription. The
38-
subscription ID forms part of the URI for every service call. Required.
41+
:param subscription_id: The ID of the target subscription. Required.
3942
:type subscription_id: str
40-
:param base_url: Service URL. Default value is "https://management.azure.com".
43+
:param base_url: Service URL. Default value is None.
4144
:type base_url: str
4245
:keyword api_version: Api Version. Default value is "2021-01-01". Note that overriding this
4346
default value may result in unsupported behavior.
@@ -47,26 +50,48 @@ class PowerBIDedicated: # pylint: disable=client-accepts-api-version-keyword
4750
"""
4851

4952
def __init__(
50-
self,
51-
credential: "TokenCredential",
52-
subscription_id: str,
53-
base_url: str = "https://management.azure.com",
54-
**kwargs: Any
53+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
5554
) -> None:
56-
self._config = PowerBIDedicatedConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
57-
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
55+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
56+
_endpoints = get_arm_endpoints(_cloud)
57+
if not base_url:
58+
base_url = _endpoints["resource_manager"]
59+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
60+
self._config = PowerBIDedicatedConfiguration(
61+
credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs
62+
)
5863

59-
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
64+
_policies = kwargs.pop("policies", None)
65+
if _policies is None:
66+
_policies = [
67+
policies.RequestIdPolicy(**kwargs),
68+
self._config.headers_policy,
69+
self._config.user_agent_policy,
70+
self._config.proxy_policy,
71+
policies.ContentDecodePolicy(**kwargs),
72+
ARMAutoResourceProviderRegistrationPolicy(),
73+
self._config.redirect_policy,
74+
self._config.retry_policy,
75+
self._config.authentication_policy,
76+
self._config.custom_hook_policy,
77+
self._config.logging_policy,
78+
policies.DistributedTracingPolicy(**kwargs),
79+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
80+
self._config.http_logging_policy,
81+
]
82+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
83+
84+
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
6085
self._serialize = Serializer(client_models)
6186
self._deserialize = Deserializer(client_models)
6287
self._serialize.client_side_validation = False
63-
self.capacities = CapacitiesOperations(self._client, self._config, self._serialize, self._deserialize)
6488
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
6589
self.auto_scale_vcores = AutoScaleVCoresOperations(
6690
self._client, self._config, self._serialize, self._deserialize
6791
)
92+
self.capacities = CapacitiesOperations(self._client, self._config, self._serialize, self._deserialize)
6893

69-
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
94+
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
7095
"""Runs the network request through the client's chained policies.
7196
7297
>>> from azure.core.rest import HttpRequest
@@ -86,17 +111,14 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
86111

87112
request_copy = deepcopy(request)
88113
request_copy.url = self._client.format_url(request_copy.url)
89-
return self._client.send_request(request_copy, **kwargs)
114+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
90115

91-
def close(self):
92-
# type: () -> None
116+
def close(self) -> None:
93117
self._client.close()
94118

95-
def __enter__(self):
96-
# type: () -> PowerBIDedicated
119+
def __enter__(self) -> Self:
97120
self._client.__enter__()
98121
return self
99122

100-
def __exit__(self, *exc_details):
101-
# type: (Any) -> None
123+
def __exit__(self, *exc_details: Any) -> None:
102124
self._client.__exit__(*exc_details)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
6+
# --------------------------------------------------------------------------

0 commit comments

Comments
 (0)