Skip to content

Commit 890d486

Browse files
[AutoRelease] t2-powerbidedicated-2022-10-28-35016(Do not merge) (Azure#27156)
* code and test * Update CHANGELOG.md * Update _version.py Co-authored-by: PythonSdkPipelines <PythonSdkPipelines> Co-authored-by: zhenbiao wei <424401670@qq.com>
1 parent 9404ab0 commit 890d486

Some content is hidden

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

48 files changed

+7500
-3267
lines changed

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

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

3+
## 1.1.0b1 (2022-10-28)
4+
5+
### Features Added
6+
7+
- Model CapacitySku has a new parameter capacity
8+
- Model DedicatedCapacity has a new parameter friendly_name
9+
- Model DedicatedCapacity has a new parameter tenant_id
10+
- Model DedicatedCapacityMutableProperties has a new parameter friendly_name
11+
- Model DedicatedCapacityMutableProperties has a new parameter tenant_id
12+
- Model DedicatedCapacityProperties has a new parameter friendly_name
13+
- Model DedicatedCapacityProperties has a new parameter tenant_id
14+
- Model DedicatedCapacityUpdateParameters has a new parameter friendly_name
15+
- Model DedicatedCapacityUpdateParameters has a new parameter tenant_id
16+
- Model Operation has a new parameter origin
17+
- Model Operation has a new parameter properties
18+
- Model OperationDisplay has a new parameter description
19+
- Model SkuDetailsForExistingResource has a new parameter resource_type
20+
321
## 1.0.0 (2021-03-26)
422

523
**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/powerbidedicated/py.typed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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.6+.
4+
This package has been tested with Python 3.7+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
@@ -12,8 +12,6 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313

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

1816
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/)
1917
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.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"commit": "e82a24def11ffc98cc263884f9f1742c99f2df5e",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"autorest": "3.9.2",
5+
"use": [
6+
"@autorest/python@6.2.1",
7+
"@autorest/modelerfour@4.24.3"
8+
],
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",
10+
"readme": "specification/powerbidedicated/resource-manager/readme.md"
11+
}

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,17 @@
1010
from ._version import VERSION
1111

1212
__version__ = VERSION
13-
__all__ = ['PowerBIDedicated']
1413

1514
try:
16-
from ._patch import patch_sdk # type: ignore
17-
patch_sdk()
15+
from ._patch import __all__ as _patch_all
16+
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
1817
except ImportError:
19-
pass
18+
_patch_all = []
19+
from ._patch import patch_sdk as _patch_sdk
20+
21+
__all__ = [
22+
"PowerBIDedicated",
23+
]
24+
__all__.extend([p for p in _patch_all if p not in __all__])
25+
26+
_patch_sdk()

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

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,66 +6,71 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from typing import TYPE_CHECKING
9+
import sys
10+
from typing import Any, TYPE_CHECKING
1011

1112
from azure.core.configuration import Configuration
1213
from azure.core.pipeline import policies
13-
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
14+
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1415

1516
from ._version import VERSION
1617

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+
1723
if TYPE_CHECKING:
1824
# pylint: disable=unused-import,ungrouped-imports
19-
from typing import Any
20-
2125
from azure.core.credentials import TokenCredential
2226

2327

24-
class PowerBIDedicatedConfiguration(Configuration):
28+
class PowerBIDedicatedConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
2529
"""Configuration for PowerBIDedicated.
2630
2731
Note that all parameters used to create this instance are saved as instance
2832
attributes.
2933
30-
:param credential: Credential needed for the client to connect to Azure.
34+
:param credential: Credential needed for the client to connect to Azure. Required.
3135
:type credential: ~azure.core.credentials.TokenCredential
32-
:param subscription_id: A unique identifier for a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
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.
3338
:type subscription_id: str
39+
:keyword api_version: Api Version. Default value is "2021-01-01". Note that overriding this
40+
default value may result in unsupported behavior.
41+
:paramtype api_version: str
3442
"""
3543

36-
def __init__(
37-
self,
38-
credential, # type: "TokenCredential"
39-
subscription_id, # type: str
40-
**kwargs # type: Any
41-
):
42-
# type: (...) -> None
44+
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"]
47+
4348
if credential is None:
4449
raise ValueError("Parameter 'credential' must not be None.")
4550
if subscription_id is None:
4651
raise ValueError("Parameter 'subscription_id' must not be None.")
47-
super(PowerBIDedicatedConfiguration, self).__init__(**kwargs)
4852

4953
self.credential = credential
5054
self.subscription_id = subscription_id
51-
self.api_version = "2021-01-01"
52-
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
53-
kwargs.setdefault('sdk_moniker', 'mgmt-powerbidedicated/{}'.format(VERSION))
55+
self.api_version = api_version
56+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
57+
kwargs.setdefault("sdk_moniker", "mgmt-powerbidedicated/{}".format(VERSION))
5458
self._configure(**kwargs)
5559

5660
def _configure(
57-
self,
58-
**kwargs # type: Any
61+
self, **kwargs # type: Any
5962
):
6063
# type: (...) -> None
61-
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
62-
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
63-
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
64-
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
65-
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
66-
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
67-
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
68-
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
69-
self.authentication_policy = kwargs.get('authentication_policy')
64+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
65+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
66+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
67+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
68+
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
69+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
70+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
71+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
72+
self.authentication_policy = kwargs.get("authentication_policy")
7073
if self.credential and not self.authentication_policy:
71-
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
74+
self.authentication_policy = ARMChallengeAuthenticationPolicy(
75+
self.credential, *self.credential_scopes, **kwargs
76+
)
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+
"""

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

Lines changed: 54 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,65 +6,87 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from typing import TYPE_CHECKING
9+
from copy import deepcopy
10+
from typing import Any, TYPE_CHECKING
1011

12+
from azure.core.rest import HttpRequest, HttpResponse
1113
from azure.mgmt.core import ARMPipelineClient
12-
from msrest import Deserializer, Serializer
14+
15+
from . import models
16+
from ._configuration import PowerBIDedicatedConfiguration
17+
from ._serialization import Deserializer, Serializer
18+
from .operations import AutoScaleVCoresOperations, CapacitiesOperations, Operations
1319

1420
if TYPE_CHECKING:
1521
# pylint: disable=unused-import,ungrouped-imports
16-
from typing import Any, Optional
17-
1822
from azure.core.credentials import TokenCredential
1923

20-
from ._configuration import PowerBIDedicatedConfiguration
21-
from .operations import CapacitiesOperations
22-
from .operations import Operations
23-
from .operations import AutoScaleVCoresOperations
24-
from . import models
2524

26-
27-
class PowerBIDedicated(object):
28-
"""PowerBI Dedicated Web API provides a RESTful set of web services that enables users to create, retrieve, update, and delete Power BI dedicated capacities.
25+
class PowerBIDedicated: # pylint: disable=client-accepts-api-version-keyword
26+
"""PowerBI Dedicated Web API provides a RESTful set of web services that enables users to create,
27+
retrieve, update, and delete Power BI dedicated capacities.
2928
3029
:ivar capacities: CapacitiesOperations operations
3130
:vartype capacities: azure.mgmt.powerbidedicated.operations.CapacitiesOperations
3231
:ivar operations: Operations operations
3332
:vartype operations: azure.mgmt.powerbidedicated.operations.Operations
3433
:ivar auto_scale_vcores: AutoScaleVCoresOperations operations
3534
:vartype auto_scale_vcores: azure.mgmt.powerbidedicated.operations.AutoScaleVCoresOperations
36-
:param credential: Credential needed for the client to connect to Azure.
35+
:param credential: Credential needed for the client to connect to Azure. Required.
3736
:type credential: ~azure.core.credentials.TokenCredential
38-
:param subscription_id: A unique identifier for a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
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.
3939
:type subscription_id: str
40-
:param str base_url: Service URL
41-
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
40+
:param base_url: Service URL. Default value is "https://management.azure.com".
41+
:type base_url: str
42+
:keyword api_version: Api Version. Default value is "2021-01-01". Note that overriding this
43+
default value may result in unsupported behavior.
44+
:paramtype api_version: str
45+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
46+
Retry-After header is present.
4247
"""
4348

4449
def __init__(
4550
self,
46-
credential, # type: "TokenCredential"
47-
subscription_id, # type: str
48-
base_url=None, # type: Optional[str]
49-
**kwargs # type: Any
50-
):
51-
# type: (...) -> None
52-
if not base_url:
53-
base_url = 'https://management.azure.com'
54-
self._config = PowerBIDedicatedConfiguration(credential, subscription_id, **kwargs)
51+
credential: "TokenCredential",
52+
subscription_id: str,
53+
base_url: str = "https://management.azure.com",
54+
**kwargs: Any
55+
) -> None:
56+
self._config = PowerBIDedicatedConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
5557
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
5658

5759
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
5860
self._serialize = Serializer(client_models)
59-
self._serialize.client_side_validation = False
6061
self._deserialize = Deserializer(client_models)
61-
62-
self.capacities = CapacitiesOperations(
63-
self._client, self._config, self._serialize, self._deserialize)
64-
self.operations = Operations(
65-
self._client, self._config, self._serialize, self._deserialize)
62+
self._serialize.client_side_validation = False
63+
self.capacities = CapacitiesOperations(self._client, self._config, self._serialize, self._deserialize)
64+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
6665
self.auto_scale_vcores = AutoScaleVCoresOperations(
67-
self._client, self._config, self._serialize, self._deserialize)
66+
self._client, self._config, self._serialize, self._deserialize
67+
)
68+
69+
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
70+
"""Runs the network request through the client's chained policies.
71+
72+
>>> from azure.core.rest import HttpRequest
73+
>>> request = HttpRequest("GET", "https://www.example.org/")
74+
<HttpRequest [GET], url: 'https://www.example.org/'>
75+
>>> response = client._send_request(request)
76+
<HttpResponse: 200 OK>
77+
78+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
79+
80+
:param request: The network request you want to make. Required.
81+
:type request: ~azure.core.rest.HttpRequest
82+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
83+
:return: The response of your network call. Does not do error handling on your response.
84+
:rtype: ~azure.core.rest.HttpResponse
85+
"""
86+
87+
request_copy = deepcopy(request)
88+
request_copy.url = self._client.format_url(request_copy.url)
89+
return self._client.send_request(request_copy, **kwargs)
6890

6991
def close(self):
7092
# type: () -> None

0 commit comments

Comments
 (0)