Skip to content

Commit a262189

Browse files
author
SDKAuto
committed
CodeGen from PR 16131 in Azure/azure-rest-api-specs
Merge 21461e032fbcf75dd1f5f22f72861f6f58b6376a into a7e864e
1 parent 6207bfc commit a262189

21 files changed

+452
-372
lines changed

sdk/powerbidedicated/azure-mgmt-powerbidedicated/MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
include _meta.json
12
recursive-include tests *.py *.yaml
23
include *.md
34
include azure/__init__.py
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"autorest": "3.4.5",
3+
"use": [
4+
"@autorest/[email protected]",
5+
"@autorest/[email protected]"
6+
],
7+
"commit": "b74b30ff8d275fc806841d3a8dcb54e3ad7f0e01",
8+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9+
"autorest_command": "autorest specification/powerbidedicated/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.4.5",
10+
"readme": "specification/powerbidedicated/resource-manager/readme.md"
11+
}

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
# coding=utf-8
22
# --------------------------------------------------------------------------
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.
3+
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.4.5, generator: @autorest/[email protected])
64
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
75
# --------------------------------------------------------------------------
86

97
from ._power_bi_dedicated import PowerBIDedicated
10-
from ._version import VERSION
11-
12-
__version__ = VERSION
138
__all__ = ['PowerBIDedicated']
149

1510
try:
Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,43 @@
11
# coding=utf-8
22
# --------------------------------------------------------------------------
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.
3+
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.4.5, generator: @autorest/[email protected])
64
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
75
# --------------------------------------------------------------------------
86

97
from typing import TYPE_CHECKING
108

119
from azure.core.configuration import Configuration
1210
from azure.core.pipeline import policies
13-
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
14-
15-
from ._version import VERSION
1611

1712
if TYPE_CHECKING:
1813
# pylint: disable=unused-import,ungrouped-imports
1914
from typing import Any
2015

21-
from azure.core.credentials import TokenCredential
22-
16+
VERSION = "unknown"
2317

2418
class PowerBIDedicatedConfiguration(Configuration):
2519
"""Configuration for PowerBIDedicated.
2620
2721
Note that all parameters used to create this instance are saved as instance
2822
attributes.
2923
30-
:param credential: Credential needed for the client to connect to Azure.
31-
:type credential: ~azure.core.credentials.TokenCredential
3224
:param subscription_id: A unique identifier for a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
3325
:type subscription_id: str
3426
"""
3527

3628
def __init__(
3729
self,
38-
credential, # type: "TokenCredential"
3930
subscription_id, # type: str
4031
**kwargs # type: Any
4132
):
4233
# type: (...) -> None
43-
if credential is None:
44-
raise ValueError("Parameter 'credential' must not be None.")
4534
if subscription_id is None:
4635
raise ValueError("Parameter 'subscription_id' must not be None.")
4736
super(PowerBIDedicatedConfiguration, self).__init__(**kwargs)
4837

49-
self.credential = credential
5038
self.subscription_id = subscription_id
5139
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))
40+
kwargs.setdefault('sdk_moniker', 'powerbidedicated/{}'.format(VERSION))
5441
self._configure(**kwargs)
5542

5643
def _configure(
@@ -62,10 +49,8 @@ def _configure(
6249
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
6350
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
6451
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
65-
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
52+
self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs)
6653
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
6754
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
6855
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
6956
self.authentication_policy = kwargs.get('authentication_policy')
70-
if self.credential and not self.authentication_policy:
71-
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{
2+
"chosen_version": "2021-01-01",
3+
"total_api_version_list": ["2021-01-01"],
4+
"client": {
5+
"name": "PowerBIDedicated",
6+
"filename": "_power_bi_dedicated",
7+
"description": "PowerBI Dedicated Web API provides a RESTful set of web services that enables users to create, retrieve, update, and delete Power BI dedicated capacities.",
8+
"base_url": "\u0027https://management.azure.com\u0027",
9+
"custom_base_url": null,
10+
"azure_arm": false,
11+
"has_lro_operations": true,
12+
"client_side_validation": false,
13+
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.core\": [\"PipelineClient\"]}, \"local\": {\"._configuration\": [\"PowerBIDedicatedConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
14+
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.core\": [\"AsyncPipelineClient\"]}, \"local\": {\"._configuration\": [\"PowerBIDedicatedConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
15+
},
16+
"global_parameters": {
17+
"sync": {
18+
"subscription_id": {
19+
"signature": "subscription_id, # type: str",
20+
"description": "A unique identifier for a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
21+
"docstring_type": "str",
22+
"required": true
23+
}
24+
},
25+
"async": {
26+
"subscription_id": {
27+
"signature": "subscription_id: str,",
28+
"description": "A unique identifier for a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
29+
"docstring_type": "str",
30+
"required": true
31+
}
32+
},
33+
"constant": {
34+
},
35+
"call": "subscription_id",
36+
"service_client_specific": {
37+
"sync": {
38+
"api_version": {
39+
"signature": "api_version=None, # type: Optional[str]",
40+
"description": "API version to use if no profile is provided, or if missing in profile.",
41+
"docstring_type": "str",
42+
"required": false
43+
},
44+
"base_url": {
45+
"signature": "base_url=None, # type: Optional[str]",
46+
"description": "Service URL",
47+
"docstring_type": "str",
48+
"required": false
49+
},
50+
"profile": {
51+
"signature": "profile=KnownProfiles.default, # type: KnownProfiles",
52+
"description": "A profile definition, from KnownProfiles to dict.",
53+
"docstring_type": "azure.profiles.KnownProfiles",
54+
"required": false
55+
}
56+
},
57+
"async": {
58+
"api_version": {
59+
"signature": "api_version: Optional[str] = None,",
60+
"description": "API version to use if no profile is provided, or if missing in profile.",
61+
"docstring_type": "str",
62+
"required": false
63+
},
64+
"base_url": {
65+
"signature": "base_url: Optional[str] = None,",
66+
"description": "Service URL",
67+
"docstring_type": "str",
68+
"required": false
69+
},
70+
"profile": {
71+
"signature": "profile: KnownProfiles = KnownProfiles.default,",
72+
"description": "A profile definition, from KnownProfiles to dict.",
73+
"docstring_type": "azure.profiles.KnownProfiles",
74+
"required": false
75+
}
76+
}
77+
}
78+
},
79+
"config": {
80+
"credential": false,
81+
"credential_scopes": null,
82+
"credential_default_policy_type": "BearerTokenCredentialPolicy",
83+
"credential_default_policy_type_has_async_version": true,
84+
"credential_key_header_name": null,
85+
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}}",
86+
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}}"
87+
},
88+
"operation_groups": {
89+
"capacities": "CapacitiesOperations",
90+
"operations": "Operations",
91+
"auto_scale_vcores": "AutoScaleVCoresOperations"
92+
}
93+
}

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

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
# coding=utf-8
22
# --------------------------------------------------------------------------
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.
3+
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.4.5, generator: @autorest/[email protected])
64
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
75
# --------------------------------------------------------------------------
86

97
from typing import TYPE_CHECKING
108

11-
from azure.mgmt.core import ARMPipelineClient
9+
from azure.core import PipelineClient
1210
from msrest import Deserializer, Serializer
1311

1412
if TYPE_CHECKING:
1513
# pylint: disable=unused-import,ungrouped-imports
1614
from typing import Any, Optional
1715

18-
from azure.core.credentials import TokenCredential
16+
from azure.core.pipeline.transport import HttpRequest, HttpResponse
1917

2018
from ._configuration import PowerBIDedicatedConfiguration
2119
from .operations import CapacitiesOperations
@@ -28,13 +26,11 @@ class PowerBIDedicated(object):
2826
"""PowerBI Dedicated Web API provides a RESTful set of web services that enables users to create, retrieve, update, and delete Power BI dedicated capacities.
2927
3028
:ivar capacities: CapacitiesOperations operations
31-
:vartype capacities: azure.mgmt.powerbidedicated.operations.CapacitiesOperations
29+
:vartype capacities: power_bi_dedicated.operations.CapacitiesOperations
3230
:ivar operations: Operations operations
33-
:vartype operations: azure.mgmt.powerbidedicated.operations.Operations
31+
:vartype operations: power_bi_dedicated.operations.Operations
3432
:ivar auto_scale_vcores: AutoScaleVCoresOperations operations
35-
:vartype auto_scale_vcores: azure.mgmt.powerbidedicated.operations.AutoScaleVCoresOperations
36-
:param credential: Credential needed for the client to connect to Azure.
37-
:type credential: ~azure.core.credentials.TokenCredential
33+
:vartype auto_scale_vcores: power_bi_dedicated.operations.AutoScaleVCoresOperations
3834
:param subscription_id: A unique identifier for a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
3935
:type subscription_id: str
4036
:param str base_url: Service URL
@@ -43,16 +39,15 @@ class PowerBIDedicated(object):
4339

4440
def __init__(
4541
self,
46-
credential, # type: "TokenCredential"
4742
subscription_id, # type: str
4843
base_url=None, # type: Optional[str]
4944
**kwargs # type: Any
5045
):
5146
# type: (...) -> None
5247
if not base_url:
5348
base_url = 'https://management.azure.com'
54-
self._config = PowerBIDedicatedConfiguration(credential, subscription_id, **kwargs)
55-
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
49+
self._config = PowerBIDedicatedConfiguration(subscription_id, **kwargs)
50+
self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs)
5651

5752
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
5853
self._serialize = Serializer(client_models)
@@ -66,6 +61,24 @@ def __init__(
6661
self.auto_scale_vcores = AutoScaleVCoresOperations(
6762
self._client, self._config, self._serialize, self._deserialize)
6863

64+
def _send_request(self, http_request, **kwargs):
65+
# type: (HttpRequest, Any) -> HttpResponse
66+
"""Runs the network request through the client's chained policies.
67+
68+
:param http_request: The network request you want to make. Required.
69+
:type http_request: ~azure.core.pipeline.transport.HttpRequest
70+
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
71+
:return: The response of your network call. Does not do error handling on your response.
72+
:rtype: ~azure.core.pipeline.transport.HttpResponse
73+
"""
74+
path_format_arguments = {
75+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
76+
}
77+
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
78+
stream = kwargs.pop("stream", True)
79+
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
80+
return pipeline_response.http_response
81+
6982
def close(self):
7083
# type: () -> None
7184
self._client.close()

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# coding=utf-8
22
# --------------------------------------------------------------------------
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.
3+
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.4.5, generator: @autorest/[email protected])
64
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
75
# --------------------------------------------------------------------------
86

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,38 @@
11
# coding=utf-8
22
# --------------------------------------------------------------------------
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.
3+
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.4.5, generator: @autorest/[email protected])
64
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
75
# --------------------------------------------------------------------------
86

9-
from typing import Any, TYPE_CHECKING
7+
from typing import Any
108

119
from azure.core.configuration import Configuration
1210
from azure.core.pipeline import policies
13-
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
14-
15-
from .._version import VERSION
16-
17-
if TYPE_CHECKING:
18-
# pylint: disable=unused-import,ungrouped-imports
19-
from azure.core.credentials_async import AsyncTokenCredential
2011

12+
VERSION = "unknown"
2113

2214
class PowerBIDedicatedConfiguration(Configuration):
2315
"""Configuration for PowerBIDedicated.
2416
2517
Note that all parameters used to create this instance are saved as instance
2618
attributes.
2719
28-
:param credential: Credential needed for the client to connect to Azure.
29-
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
3020
:param subscription_id: A unique identifier for a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
3121
:type subscription_id: str
3222
"""
3323

3424
def __init__(
3525
self,
36-
credential: "AsyncTokenCredential",
3726
subscription_id: str,
3827
**kwargs: Any
3928
) -> None:
40-
if credential is None:
41-
raise ValueError("Parameter 'credential' must not be None.")
4229
if subscription_id is None:
4330
raise ValueError("Parameter 'subscription_id' must not be None.")
4431
super(PowerBIDedicatedConfiguration, self).__init__(**kwargs)
4532

46-
self.credential = credential
4733
self.subscription_id = subscription_id
4834
self.api_version = "2021-01-01"
49-
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
50-
kwargs.setdefault('sdk_moniker', 'mgmt-powerbidedicated/{}'.format(VERSION))
35+
kwargs.setdefault('sdk_moniker', 'powerbidedicated/{}'.format(VERSION))
5136
self._configure(**kwargs)
5237

5338
def _configure(
@@ -58,10 +43,8 @@ def _configure(
5843
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
5944
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
6045
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
61-
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
46+
self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs)
6247
self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
6348
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
6449
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
6550
self.authentication_policy = kwargs.get('authentication_policy')
66-
if self.credential and not self.authentication_policy:
67-
self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)

0 commit comments

Comments
 (0)