From 1db87d37e5ee50950db78aa5daffaffc79222420 Mon Sep 17 00:00:00 2001 From: Zed <601306339@qq.com> Date: Fri, 26 Mar 2021 10:44:59 +0800 Subject: [PATCH] powerbidedicated sdk generate --- .../azure-mgmt-powerbidedicated/CHANGELOG.md | 17 + .../azure/mgmt/powerbidedicated/__init__.py | 3 - .../mgmt/powerbidedicated/_configuration.py | 5 +- .../powerbidedicated/_power_bi_dedicated.py | 5 + .../azure/mgmt/powerbidedicated/_version.py | 3 +- .../powerbidedicated/aio/_configuration.py | 5 +- .../aio/_power_bi_dedicated.py | 5 + .../aio/operations/__init__.py | 2 + .../_auto_scale_vcores_operations.py | 444 +++++++++++++++ .../aio/operations/_capacities_operations.py | 61 +- .../aio/operations/_operations.py | 2 +- .../mgmt/powerbidedicated/models/__init__.py | 46 +- .../mgmt/powerbidedicated/models/_models.py | 471 ++++++++++++--- .../powerbidedicated/models/_models_py3.py | 534 ++++++++++++++---- .../models/_power_bi_dedicated_enums.py | 35 +- .../powerbidedicated/operations/__init__.py | 2 + .../_auto_scale_vcores_operations.py | 454 +++++++++++++++ .../operations/_capacities_operations.py | 61 +- .../operations/_operations.py | 2 +- 19 files changed, 1892 insertions(+), 265 deletions(-) create mode 100644 sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/_auto_scale_vcores_operations.py create mode 100644 sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/_auto_scale_vcores_operations.py diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/CHANGELOG.md b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/CHANGELOG.md index dcb449fac9d0..40701190046e 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/CHANGELOG.md +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/CHANGELOG.md @@ -1,5 +1,22 @@ # Release History +## 1.0.0 (2021-03-26) + +**Features** + + - Model DedicatedCapacityUpdateParameters has a new parameter mode + - Model DedicatedCapacityMutableProperties has a new parameter mode + - Model Resource has a new parameter system_data + - Model DedicatedCapacity has a new parameter mode + - Model DedicatedCapacity has a new parameter system_data + - Model DedicatedCapacityProperties has a new parameter mode + - Added operation group AutoScaleVCoresOperations + +**Breaking changes** + + - Model Resource no longer has parameter sku + - Model ErrorResponse has a new signature + ## 1.0.0b1 (2020-12-02) This is beta preview version. diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/__init__.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/__init__.py index 85242d086108..1c2ce4d7de4f 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/__init__.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/__init__.py @@ -7,9 +7,6 @@ # -------------------------------------------------------------------------- from ._power_bi_dedicated import PowerBIDedicated -from ._version import VERSION - -__version__ = VERSION __all__ = ['PowerBIDedicated'] try: diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/_configuration.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/_configuration.py index ae7c52ffecdf..aab710854602 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/_configuration.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/_configuration.py @@ -12,14 +12,13 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy -from ._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any from azure.core.credentials import TokenCredential +VERSION = "unknown" class PowerBIDedicatedConfiguration(Configuration): """Configuration for PowerBIDedicated. @@ -48,7 +47,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2017-10-01" + self.api_version = "2021-01-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-powerbidedicated/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/_power_bi_dedicated.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/_power_bi_dedicated.py index 93b6367f6a98..4290021c67cc 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/_power_bi_dedicated.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/_power_bi_dedicated.py @@ -20,6 +20,7 @@ from ._configuration import PowerBIDedicatedConfiguration from .operations import CapacitiesOperations from .operations import Operations +from .operations import AutoScaleVCoresOperations from . import models @@ -30,6 +31,8 @@ class PowerBIDedicated(object): :vartype capacities: azure.mgmt.powerbidedicated.operations.CapacitiesOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.powerbidedicated.operations.Operations + :ivar auto_scale_vcores: AutoScaleVCoresOperations operations + :vartype auto_scale_vcores: azure.mgmt.powerbidedicated.operations.AutoScaleVCoresOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: A unique identifier for a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. @@ -60,6 +63,8 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.operations = Operations( self._client, self._config, self._serialize, self._deserialize) + self.auto_scale_vcores = AutoScaleVCoresOperations( + self._client, self._config, self._serialize, self._deserialize) def close(self): # type: () -> None diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/_version.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/_version.py index 515f51c112dd..c47f66669f1b 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/_version.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/_version.py @@ -6,5 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b1" - +VERSION = "1.0.0" diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/_configuration.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/_configuration.py index 83593702966f..f14f7428f469 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/_configuration.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/_configuration.py @@ -12,12 +12,11 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy -from .._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential +VERSION = "unknown" class PowerBIDedicatedConfiguration(Configuration): """Configuration for PowerBIDedicated. @@ -45,7 +44,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2017-10-01" + self.api_version = "2021-01-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-powerbidedicated/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/_power_bi_dedicated.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/_power_bi_dedicated.py index ace802ddf646..c104e7384419 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/_power_bi_dedicated.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/_power_bi_dedicated.py @@ -18,6 +18,7 @@ from ._configuration import PowerBIDedicatedConfiguration from .operations import CapacitiesOperations from .operations import Operations +from .operations import AutoScaleVCoresOperations from .. import models @@ -28,6 +29,8 @@ class PowerBIDedicated(object): :vartype capacities: azure.mgmt.powerbidedicated.aio.operations.CapacitiesOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.powerbidedicated.aio.operations.Operations + :ivar auto_scale_vcores: AutoScaleVCoresOperations operations + :vartype auto_scale_vcores: azure.mgmt.powerbidedicated.aio.operations.AutoScaleVCoresOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: A unique identifier for a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. @@ -57,6 +60,8 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.operations = Operations( self._client, self._config, self._serialize, self._deserialize) + self.auto_scale_vcores = AutoScaleVCoresOperations( + self._client, self._config, self._serialize, self._deserialize) async def close(self) -> None: await self._client.close() diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/__init__.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/__init__.py index c7e89554f78f..4178fdb5dcc7 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/__init__.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/__init__.py @@ -8,8 +8,10 @@ from ._capacities_operations import CapacitiesOperations from ._operations import Operations +from ._auto_scale_vcores_operations import AutoScaleVCoresOperations __all__ = [ 'CapacitiesOperations', 'Operations', + 'AutoScaleVCoresOperations', ] diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/_auto_scale_vcores_operations.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/_auto_scale_vcores_operations.py new file mode 100644 index 000000000000..971a0f8af7ff --- /dev/null +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/_auto_scale_vcores_operations.py @@ -0,0 +1,444 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AutoScaleVCoresOperations: + """AutoScaleVCoresOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.powerbidedicated.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + vcore_name: str, + **kwargs + ) -> "_models.AutoScaleVCore": + """Gets details about the specified auto scale v-core. + + :param resource_group_name: The name of the Azure Resource group of which a given + PowerBIDedicated capacity is part. This name must be at least 1 character in length, and no + more than 90. + :type resource_group_name: str + :param vcore_name: The name of the auto scale v-core. It must be a minimum of 3 characters, and + a maximum of 63. + :type vcore_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AutoScaleVCore, or the result of cls(response) + :rtype: ~azure.mgmt.powerbidedicated.models.AutoScaleVCore + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoScaleVCore"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'vcoreName': self._serialize.url("vcore_name", vcore_name, 'str', max_length=63, min_length=3, pattern=r'^[-a-zA-Z0-9_]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AutoScaleVCore', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/autoScaleVCores/{vcoreName}'} # type: ignore + + async def create( + self, + resource_group_name: str, + vcore_name: str, + v_core_parameters: "_models.AutoScaleVCore", + **kwargs + ) -> "_models.AutoScaleVCore": + """Provisions the specified auto scale v-core based on the configuration specified in the request. + + :param resource_group_name: The name of the Azure Resource group of which a given + PowerBIDedicated capacity is part. This name must be at least 1 character in length, and no + more than 90. + :type resource_group_name: str + :param vcore_name: The name of the auto scale v-core. It must be a minimum of 3 characters, and + a maximum of 63. + :type vcore_name: str + :param v_core_parameters: Contains the information used to provision the auto scale v-core. + :type v_core_parameters: ~azure.mgmt.powerbidedicated.models.AutoScaleVCore + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AutoScaleVCore, or the result of cls(response) + :rtype: ~azure.mgmt.powerbidedicated.models.AutoScaleVCore + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoScaleVCore"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'vcoreName': self._serialize.url("vcore_name", vcore_name, 'str', max_length=63, min_length=3, pattern=r'^[-a-zA-Z0-9_]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(v_core_parameters, 'AutoScaleVCore') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AutoScaleVCore', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/autoScaleVCores/{vcoreName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + vcore_name: str, + **kwargs + ) -> None: + """Deletes the specified auto scale v-core. + + :param resource_group_name: The name of the Azure Resource group of which a given + PowerBIDedicated capacity is part. This name must be at least 1 character in length, and no + more than 90. + :type resource_group_name: str + :param vcore_name: The name of the auto scale v-core. It must be a minimum of 3 characters, and + a maximum of 63. + :type vcore_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'vcoreName': self._serialize.url("vcore_name", vcore_name, 'str', max_length=63, min_length=3, pattern=r'^[-a-zA-Z0-9_]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/autoScaleVCores/{vcoreName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + vcore_name: str, + v_core_update_parameters: "_models.AutoScaleVCoreUpdateParameters", + **kwargs + ) -> "_models.AutoScaleVCore": + """Updates the current state of the specified auto scale v-core. + + :param resource_group_name: The name of the Azure Resource group of which a given + PowerBIDedicated capacity is part. This name must be at least 1 character in length, and no + more than 90. + :type resource_group_name: str + :param vcore_name: The name of the auto scale v-core. It must be a minimum of 3 characters, and + a maximum of 63. + :type vcore_name: str + :param v_core_update_parameters: Request object that contains the updated information for the + auto scale v-core. + :type v_core_update_parameters: ~azure.mgmt.powerbidedicated.models.AutoScaleVCoreUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AutoScaleVCore, or the result of cls(response) + :rtype: ~azure.mgmt.powerbidedicated.models.AutoScaleVCore + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoScaleVCore"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'vcoreName': self._serialize.url("vcore_name", vcore_name, 'str', max_length=63, min_length=3, pattern=r'^[-a-zA-Z0-9_]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(v_core_update_parameters, 'AutoScaleVCoreUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AutoScaleVCore', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/autoScaleVCores/{vcoreName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.AutoScaleVCoreListResult"]: + """Gets all the auto scale v-cores for the given resource group. + + :param resource_group_name: The name of the Azure Resource group of which a given + PowerBIDedicated capacity is part. This name must be at least 1 character in length, and no + more than 90. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AutoScaleVCoreListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.powerbidedicated.models.AutoScaleVCoreListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoScaleVCoreListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AutoScaleVCoreListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/autoScaleVCores'} # type: ignore + + def list_by_subscription( + self, + **kwargs + ) -> AsyncIterable["_models.AutoScaleVCoreListResult"]: + """Lists all the auto scale v-cores for the given subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AutoScaleVCoreListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.powerbidedicated.models.AutoScaleVCoreListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoScaleVCoreListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AutoScaleVCoreListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.PowerBIDedicated/autoScaleVCores'} # type: ignore diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/_capacities_operations.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/_capacities_operations.py index 8717fa536745..413cd0f29457 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/_capacities_operations.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/_capacities_operations.py @@ -68,7 +68,7 @@ async def get_details( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -94,7 +94,8 @@ async def get_details( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DedicatedCapacity', pipeline_response) @@ -116,7 +117,7 @@ async def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -147,7 +148,8 @@ async def _create_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize('DedicatedCapacity', pipeline_response) @@ -247,7 +249,8 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" + api_version = "2021-01-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -264,6 +267,7 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) @@ -271,7 +275,8 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -357,7 +362,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -388,7 +393,8 @@ async def _update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize('DedicatedCapacity', pipeline_response) @@ -488,7 +494,8 @@ async def _suspend_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" + api_version = "2021-01-01" + accept = "application/json" # Construct URL url = self._suspend_initial.metadata['url'] # type: ignore @@ -505,6 +512,7 @@ async def _suspend_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) @@ -512,7 +520,8 @@ async def _suspend_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -597,7 +606,8 @@ async def _resume_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" + api_version = "2021-01-01" + accept = "application/json" # Construct URL url = self._resume_initial.metadata['url'] # type: ignore @@ -614,6 +624,7 @@ async def _resume_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) @@ -621,7 +632,8 @@ async def _resume_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -716,7 +728,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -757,8 +769,9 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -783,7 +796,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -823,8 +836,9 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -849,7 +863,7 @@ async def list_skus( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -873,7 +887,8 @@ async def list_skus( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SkuEnumerationForNewResourceResult', pipeline_response) @@ -908,7 +923,7 @@ async def list_skus_for_capacity( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -934,7 +949,8 @@ async def list_skus_for_capacity( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SkuEnumerationForExistingResourceResult', pipeline_response) @@ -966,7 +982,7 @@ async def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -996,7 +1012,8 @@ async def check_name_availability( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CheckCapacityNameAvailabilityResult', pipeline_response) diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/_operations.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/_operations.py index 1b130a018689..969aa7adae39 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/_operations.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/aio/operations/_operations.py @@ -57,7 +57,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/__init__.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/__init__.py index 378e63dd0e6d..c6c8542fa8ce 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/__init__.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/__init__.py @@ -7,6 +7,13 @@ # -------------------------------------------------------------------------- try: + from ._models_py3 import AutoScaleVCore + from ._models_py3 import AutoScaleVCoreListResult + from ._models_py3 import AutoScaleVCoreMutableProperties + from ._models_py3 import AutoScaleVCoreProperties + from ._models_py3 import AutoScaleVCoreSku + from ._models_py3 import AutoScaleVCoreUpdateParameters + from ._models_py3 import CapacitySku from ._models_py3 import CheckCapacityNameAvailabilityParameters from ._models_py3 import CheckCapacityNameAvailabilityResult from ._models_py3 import DedicatedCapacities @@ -16,15 +23,23 @@ from ._models_py3 import DedicatedCapacityProperties from ._models_py3 import DedicatedCapacityUpdateParameters from ._models_py3 import ErrorResponse + from ._models_py3 import ErrorResponseError from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import OperationListResult from ._models_py3 import Resource - from ._models_py3 import ResourceSku from ._models_py3 import SkuDetailsForExistingResource from ._models_py3 import SkuEnumerationForExistingResourceResult from ._models_py3 import SkuEnumerationForNewResourceResult + from ._models_py3 import SystemData except (SyntaxError, ImportError): + from ._models import AutoScaleVCore # type: ignore + from ._models import AutoScaleVCoreListResult # type: ignore + from ._models import AutoScaleVCoreMutableProperties # type: ignore + from ._models import AutoScaleVCoreProperties # type: ignore + from ._models import AutoScaleVCoreSku # type: ignore + from ._models import AutoScaleVCoreUpdateParameters # type: ignore + from ._models import CapacitySku # type: ignore from ._models import CheckCapacityNameAvailabilityParameters # type: ignore from ._models import CheckCapacityNameAvailabilityResult # type: ignore from ._models import DedicatedCapacities # type: ignore @@ -34,22 +49,34 @@ from ._models import DedicatedCapacityProperties # type: ignore from ._models import DedicatedCapacityUpdateParameters # type: ignore from ._models import ErrorResponse # type: ignore + from ._models import ErrorResponseError # type: ignore from ._models import Operation # type: ignore from ._models import OperationDisplay # type: ignore from ._models import OperationListResult # type: ignore from ._models import Resource # type: ignore - from ._models import ResourceSku # type: ignore from ._models import SkuDetailsForExistingResource # type: ignore from ._models import SkuEnumerationForExistingResourceResult # type: ignore from ._models import SkuEnumerationForNewResourceResult # type: ignore + from ._models import SystemData # type: ignore from ._power_bi_dedicated_enums import ( - ProvisioningState, - SkuTier, + CapacityProvisioningState, + CapacitySkuTier, + IdentityType, + Mode, State, + VCoreProvisioningState, + VCoreSkuTier, ) __all__ = [ + 'AutoScaleVCore', + 'AutoScaleVCoreListResult', + 'AutoScaleVCoreMutableProperties', + 'AutoScaleVCoreProperties', + 'AutoScaleVCoreSku', + 'AutoScaleVCoreUpdateParameters', + 'CapacitySku', 'CheckCapacityNameAvailabilityParameters', 'CheckCapacityNameAvailabilityResult', 'DedicatedCapacities', @@ -59,15 +86,20 @@ 'DedicatedCapacityProperties', 'DedicatedCapacityUpdateParameters', 'ErrorResponse', + 'ErrorResponseError', 'Operation', 'OperationDisplay', 'OperationListResult', 'Resource', - 'ResourceSku', 'SkuDetailsForExistingResource', 'SkuEnumerationForExistingResourceResult', 'SkuEnumerationForNewResourceResult', - 'ProvisioningState', - 'SkuTier', + 'SystemData', + 'CapacityProvisioningState', + 'CapacitySkuTier', + 'IdentityType', + 'Mode', 'State', + 'VCoreProvisioningState', + 'VCoreSkuTier', ] diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/_models.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/_models.py index 39bc25cfbd5a..7ab1e4a3b84c 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/_models.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/_models.py @@ -10,6 +10,291 @@ import msrest.serialization +class Resource(msrest.serialization.Model): + """Represents an instance of an PowerBI Dedicated resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: An identifier that represents the PowerBI Dedicated resource. + :vartype id: str + :ivar name: The name of the PowerBI Dedicated resource. + :vartype name: str + :ivar type: The type of the PowerBI Dedicated resource. + :vartype type: str + :param location: Required. Location of the PowerBI Dedicated resource. + :type location: str + :param tags: A set of tags. Key-value pairs of additional resource provisioning properties. + :type tags: dict[str, str] + :param system_data: Metadata pertaining to creation and last modification of the resource. + :type system_data: ~azure.mgmt.powerbidedicated.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs['location'] + self.tags = kwargs.get('tags', None) + self.system_data = kwargs.get('system_data', None) + + +class AutoScaleVCore(Resource): + """Represents an instance of an auto scale v-core resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: An identifier that represents the PowerBI Dedicated resource. + :vartype id: str + :ivar name: The name of the PowerBI Dedicated resource. + :vartype name: str + :ivar type: The type of the PowerBI Dedicated resource. + :vartype type: str + :param location: Required. Location of the PowerBI Dedicated resource. + :type location: str + :param tags: A set of tags. Key-value pairs of additional resource provisioning properties. + :type tags: dict[str, str] + :param system_data: Metadata pertaining to creation and last modification of the resource. + :type system_data: ~azure.mgmt.powerbidedicated.models.SystemData + :param sku: Required. The SKU of the auto scale v-core resource. + :type sku: ~azure.mgmt.powerbidedicated.models.AutoScaleVCoreSku + :param capacity_limit: The maximum capacity of an auto scale v-core resource. + :type capacity_limit: int + :param capacity_object_id: The object ID of the capacity resource associated with the auto + scale v-core resource. + :type capacity_object_id: str + :ivar provisioning_state: The current deployment state of an auto scale v-core resource. The + provisioningState is to indicate states for resource provisioning. Possible values include: + "Succeeded". + :vartype provisioning_state: str or ~azure.mgmt.powerbidedicated.models.VCoreProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'sku': {'key': 'sku', 'type': 'AutoScaleVCoreSku'}, + 'capacity_limit': {'key': 'properties.capacityLimit', 'type': 'int'}, + 'capacity_object_id': {'key': 'properties.capacityObjectId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AutoScaleVCore, self).__init__(**kwargs) + self.sku = kwargs['sku'] + self.capacity_limit = kwargs.get('capacity_limit', None) + self.capacity_object_id = kwargs.get('capacity_object_id', None) + self.provisioning_state = None + + +class AutoScaleVCoreListResult(msrest.serialization.Model): + """An array of auto scale v-core resources. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. An array of auto scale v-core resources. + :type value: list[~azure.mgmt.powerbidedicated.models.AutoScaleVCore] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AutoScaleVCore]'}, + } + + def __init__( + self, + **kwargs + ): + super(AutoScaleVCoreListResult, self).__init__(**kwargs) + self.value = kwargs['value'] + + +class AutoScaleVCoreMutableProperties(msrest.serialization.Model): + """An object that represents a set of mutable auto scale v-core resource properties. + + :param capacity_limit: The maximum capacity of an auto scale v-core resource. + :type capacity_limit: int + """ + + _attribute_map = { + 'capacity_limit': {'key': 'capacityLimit', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AutoScaleVCoreMutableProperties, self).__init__(**kwargs) + self.capacity_limit = kwargs.get('capacity_limit', None) + + +class AutoScaleVCoreProperties(AutoScaleVCoreMutableProperties): + """Properties of an auto scale v-core resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param capacity_limit: The maximum capacity of an auto scale v-core resource. + :type capacity_limit: int + :param capacity_object_id: The object ID of the capacity resource associated with the auto + scale v-core resource. + :type capacity_object_id: str + :ivar provisioning_state: The current deployment state of an auto scale v-core resource. The + provisioningState is to indicate states for resource provisioning. Possible values include: + "Succeeded". + :vartype provisioning_state: str or ~azure.mgmt.powerbidedicated.models.VCoreProvisioningState + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'capacity_limit': {'key': 'capacityLimit', 'type': 'int'}, + 'capacity_object_id': {'key': 'capacityObjectId', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AutoScaleVCoreProperties, self).__init__(**kwargs) + self.capacity_object_id = kwargs.get('capacity_object_id', None) + self.provisioning_state = None + + +class AutoScaleVCoreSku(msrest.serialization.Model): + """Represents the SKU name and Azure pricing tier for auto scale v-core resource. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the SKU level. + :type name: str + :param tier: The name of the Azure pricing tier to which the SKU applies. Possible values + include: "AutoScale". + :type tier: str or ~azure.mgmt.powerbidedicated.models.VCoreSkuTier + :param capacity: The capacity of an auto scale v-core resource. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AutoScaleVCoreSku, self).__init__(**kwargs) + self.name = kwargs['name'] + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) + + +class AutoScaleVCoreUpdateParameters(msrest.serialization.Model): + """Update request specification. + + :param sku: The SKU of the auto scale v-core resource. + :type sku: ~azure.mgmt.powerbidedicated.models.AutoScaleVCoreSku + :param tags: A set of tags. Key-value pairs of additional provisioning properties. + :type tags: dict[str, str] + :param capacity_limit: The maximum capacity of an auto scale v-core resource. + :type capacity_limit: int + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'AutoScaleVCoreSku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'capacity_limit': {'key': 'properties.capacityLimit', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AutoScaleVCoreUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + self.capacity_limit = kwargs.get('capacity_limit', None) + + +class CapacitySku(msrest.serialization.Model): + """Represents the SKU name and Azure pricing tier for PowerBI Dedicated capacity resource. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the SKU level. + :type name: str + :param tier: The name of the Azure pricing tier to which the SKU applies. Possible values + include: "PBIE_Azure", "Premium", "AutoPremiumHost". + :type tier: str or ~azure.mgmt.powerbidedicated.models.CapacitySkuTier + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CapacitySku, self).__init__(**kwargs) + self.name = kwargs['name'] + self.tier = kwargs.get('tier', None) + + class CheckCapacityNameAvailabilityParameters(msrest.serialization.Model): """Details of capacity name request body. @@ -89,57 +374,6 @@ def __init__( self.value = kwargs['value'] -class Resource(msrest.serialization.Model): - """Represents an instance of an PowerBI Dedicated resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: An identifier that represents the PowerBI Dedicated resource. - :vartype id: str - :ivar name: The name of the PowerBI Dedicated resource. - :vartype name: str - :ivar type: The type of the PowerBI Dedicated resource. - :vartype type: str - :param location: Required. Location of the PowerBI Dedicated resource. - :type location: str - :param sku: Required. The SKU of the PowerBI Dedicated resource. - :type sku: ~azure.mgmt.powerbidedicated.models.ResourceSku - :param tags: A set of tags. Key-value pairs of additional resource provisioning properties. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'sku': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'ResourceSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.sku = kwargs['sku'] - self.tags = kwargs.get('tags', None) - - class DedicatedCapacity(Resource): """Represents an instance of a Dedicated Capacity resource. @@ -155,12 +389,16 @@ class DedicatedCapacity(Resource): :vartype type: str :param location: Required. Location of the PowerBI Dedicated resource. :type location: str - :param sku: Required. The SKU of the PowerBI Dedicated resource. - :type sku: ~azure.mgmt.powerbidedicated.models.ResourceSku :param tags: A set of tags. Key-value pairs of additional resource provisioning properties. :type tags: dict[str, str] + :param system_data: Metadata pertaining to creation and last modification of the resource. + :type system_data: ~azure.mgmt.powerbidedicated.models.SystemData + :param sku: Required. The SKU of the PowerBI Dedicated capacity resource. + :type sku: ~azure.mgmt.powerbidedicated.models.CapacitySku :param administration: A collection of Dedicated capacity administrators. :type administration: ~azure.mgmt.powerbidedicated.models.DedicatedCapacityAdministrators + :param mode: The capacity mode. Possible values include: "Gen1", "Gen2". + :type mode: str or ~azure.mgmt.powerbidedicated.models.Mode :ivar state: The current state of PowerBI Dedicated resource. The state is to indicate more states outside of resource provisioning. Possible values include: "Deleting", "Succeeded", "Failed", "Paused", "Suspended", "Provisioning", "Updating", "Suspending", "Pausing", @@ -170,7 +408,8 @@ class DedicatedCapacity(Resource): provisioningState is to indicate states for resource provisioning. Possible values include: "Deleting", "Succeeded", "Failed", "Paused", "Suspended", "Provisioning", "Updating", "Suspending", "Pausing", "Resuming", "Preparing", "Scaling". - :vartype provisioning_state: str or ~azure.mgmt.powerbidedicated.models.ProvisioningState + :vartype provisioning_state: str or + ~azure.mgmt.powerbidedicated.models.CapacityProvisioningState """ _validation = { @@ -188,9 +427,11 @@ class DedicatedCapacity(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'ResourceSku'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'sku': {'key': 'sku', 'type': 'CapacitySku'}, 'administration': {'key': 'properties.administration', 'type': 'DedicatedCapacityAdministrators'}, + 'mode': {'key': 'properties.mode', 'type': 'str'}, 'state': {'key': 'properties.state', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } @@ -200,7 +441,9 @@ def __init__( **kwargs ): super(DedicatedCapacity, self).__init__(**kwargs) + self.sku = kwargs['sku'] self.administration = kwargs.get('administration', None) + self.mode = kwargs.get('mode', None) self.state = None self.provisioning_state = None @@ -229,10 +472,13 @@ class DedicatedCapacityMutableProperties(msrest.serialization.Model): :param administration: A collection of Dedicated capacity administrators. :type administration: ~azure.mgmt.powerbidedicated.models.DedicatedCapacityAdministrators + :param mode: The capacity mode. Possible values include: "Gen1", "Gen2". + :type mode: str or ~azure.mgmt.powerbidedicated.models.Mode """ _attribute_map = { 'administration': {'key': 'administration', 'type': 'DedicatedCapacityAdministrators'}, + 'mode': {'key': 'mode', 'type': 'str'}, } def __init__( @@ -241,6 +487,7 @@ def __init__( ): super(DedicatedCapacityMutableProperties, self).__init__(**kwargs) self.administration = kwargs.get('administration', None) + self.mode = kwargs.get('mode', None) class DedicatedCapacityProperties(DedicatedCapacityMutableProperties): @@ -250,6 +497,8 @@ class DedicatedCapacityProperties(DedicatedCapacityMutableProperties): :param administration: A collection of Dedicated capacity administrators. :type administration: ~azure.mgmt.powerbidedicated.models.DedicatedCapacityAdministrators + :param mode: The capacity mode. Possible values include: "Gen1", "Gen2". + :type mode: str or ~azure.mgmt.powerbidedicated.models.Mode :ivar state: The current state of PowerBI Dedicated resource. The state is to indicate more states outside of resource provisioning. Possible values include: "Deleting", "Succeeded", "Failed", "Paused", "Suspended", "Provisioning", "Updating", "Suspending", "Pausing", @@ -259,7 +508,8 @@ class DedicatedCapacityProperties(DedicatedCapacityMutableProperties): provisioningState is to indicate states for resource provisioning. Possible values include: "Deleting", "Succeeded", "Failed", "Paused", "Suspended", "Provisioning", "Updating", "Suspending", "Pausing", "Resuming", "Preparing", "Scaling". - :vartype provisioning_state: str or ~azure.mgmt.powerbidedicated.models.ProvisioningState + :vartype provisioning_state: str or + ~azure.mgmt.powerbidedicated.models.CapacityProvisioningState """ _validation = { @@ -269,6 +519,7 @@ class DedicatedCapacityProperties(DedicatedCapacityMutableProperties): _attribute_map = { 'administration': {'key': 'administration', 'type': 'DedicatedCapacityAdministrators'}, + 'mode': {'key': 'mode', 'type': 'str'}, 'state': {'key': 'state', 'type': 'str'}, 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, } @@ -286,17 +537,20 @@ class DedicatedCapacityUpdateParameters(msrest.serialization.Model): """Provision request specification. :param sku: The SKU of the Dedicated capacity resource. - :type sku: ~azure.mgmt.powerbidedicated.models.ResourceSku + :type sku: ~azure.mgmt.powerbidedicated.models.CapacitySku :param tags: A set of tags. Key-value pairs of additional provisioning properties. :type tags: dict[str, str] :param administration: A collection of Dedicated capacity administrators. :type administration: ~azure.mgmt.powerbidedicated.models.DedicatedCapacityAdministrators + :param mode: The capacity mode. Possible values include: "Gen1", "Gen2". + :type mode: str or ~azure.mgmt.powerbidedicated.models.Mode """ _attribute_map = { - 'sku': {'key': 'sku', 'type': 'ResourceSku'}, + 'sku': {'key': 'sku', 'type': 'CapacitySku'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'administration': {'key': 'properties.administration', 'type': 'DedicatedCapacityAdministrators'}, + 'mode': {'key': 'properties.mode', 'type': 'str'}, } def __init__( @@ -307,11 +561,31 @@ def __init__( self.sku = kwargs.get('sku', None) self.tags = kwargs.get('tags', None) self.administration = kwargs.get('administration', None) + self.mode = kwargs.get('mode', None) class ErrorResponse(msrest.serialization.Model): """Describes the format of Error response. + :param error: The error object. + :type error: ~azure.mgmt.powerbidedicated.models.ErrorResponseError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseError'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseError(msrest.serialization.Model): + """The error object. + :param code: Error code. :type code: str :param message: Error message indicating why the operation failed. @@ -327,7 +601,7 @@ def __init__( self, **kwargs ): - super(ErrorResponse, self).__init__(**kwargs) + super(ErrorResponseError, self).__init__(**kwargs) self.code = kwargs.get('code', None) self.message = kwargs.get('message', None) @@ -426,45 +700,15 @@ def __init__( self.next_link = None -class ResourceSku(msrest.serialization.Model): - """Represents the SKU name and Azure pricing tier for PowerBI Dedicated resource. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Name of the SKU level. - :type name: str - :param tier: The name of the Azure pricing tier to which the SKU applies. Possible values - include: "PBIE_Azure". - :type tier: str or ~azure.mgmt.powerbidedicated.models.SkuTier - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceSku, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) - - class SkuDetailsForExistingResource(msrest.serialization.Model): """An object that represents SKU details for existing resources. :param sku: The SKU in SKU details for existing resources. - :type sku: ~azure.mgmt.powerbidedicated.models.ResourceSku + :type sku: ~azure.mgmt.powerbidedicated.models.CapacitySku """ _attribute_map = { - 'sku': {'key': 'sku', 'type': 'ResourceSku'}, + 'sku': {'key': 'sku', 'type': 'CapacitySku'}, } def __init__( @@ -498,11 +742,11 @@ class SkuEnumerationForNewResourceResult(msrest.serialization.Model): """An object that represents enumerating SKUs for new resources. :param value: The collection of available SKUs for new resources. - :type value: list[~azure.mgmt.powerbidedicated.models.ResourceSku] + :type value: list[~azure.mgmt.powerbidedicated.models.CapacitySku] """ _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceSku]'}, + 'value': {'key': 'value', 'type': '[CapacitySku]'}, } def __init__( @@ -511,3 +755,44 @@ def __init__( ): super(SkuEnumerationForNewResourceResult, self).__init__(**kwargs) self.value = kwargs.get('value', None) + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: An identifier for the identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.powerbidedicated.models.IdentityType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: An identifier for the identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure.mgmt.powerbidedicated.models.IdentityType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/_models_py3.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/_models_py3.py index 6c135e98fb14..72ea08ea8a8e 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/_models_py3.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/_models_py3.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import datetime from typing import Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError @@ -14,6 +15,320 @@ from ._power_bi_dedicated_enums import * +class Resource(msrest.serialization.Model): + """Represents an instance of an PowerBI Dedicated resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: An identifier that represents the PowerBI Dedicated resource. + :vartype id: str + :ivar name: The name of the PowerBI Dedicated resource. + :vartype name: str + :ivar type: The type of the PowerBI Dedicated resource. + :vartype type: str + :param location: Required. Location of the PowerBI Dedicated resource. + :type location: str + :param tags: A set of tags. Key-value pairs of additional resource provisioning properties. + :type tags: dict[str, str] + :param system_data: Metadata pertaining to creation and last modification of the resource. + :type system_data: ~azure.mgmt.powerbidedicated.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + system_data: Optional["SystemData"] = None, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + self.system_data = system_data + + +class AutoScaleVCore(Resource): + """Represents an instance of an auto scale v-core resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: An identifier that represents the PowerBI Dedicated resource. + :vartype id: str + :ivar name: The name of the PowerBI Dedicated resource. + :vartype name: str + :ivar type: The type of the PowerBI Dedicated resource. + :vartype type: str + :param location: Required. Location of the PowerBI Dedicated resource. + :type location: str + :param tags: A set of tags. Key-value pairs of additional resource provisioning properties. + :type tags: dict[str, str] + :param system_data: Metadata pertaining to creation and last modification of the resource. + :type system_data: ~azure.mgmt.powerbidedicated.models.SystemData + :param sku: Required. The SKU of the auto scale v-core resource. + :type sku: ~azure.mgmt.powerbidedicated.models.AutoScaleVCoreSku + :param capacity_limit: The maximum capacity of an auto scale v-core resource. + :type capacity_limit: int + :param capacity_object_id: The object ID of the capacity resource associated with the auto + scale v-core resource. + :type capacity_object_id: str + :ivar provisioning_state: The current deployment state of an auto scale v-core resource. The + provisioningState is to indicate states for resource provisioning. Possible values include: + "Succeeded". + :vartype provisioning_state: str or ~azure.mgmt.powerbidedicated.models.VCoreProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'sku': {'key': 'sku', 'type': 'AutoScaleVCoreSku'}, + 'capacity_limit': {'key': 'properties.capacityLimit', 'type': 'int'}, + 'capacity_object_id': {'key': 'properties.capacityObjectId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + sku: "AutoScaleVCoreSku", + tags: Optional[Dict[str, str]] = None, + system_data: Optional["SystemData"] = None, + capacity_limit: Optional[int] = None, + capacity_object_id: Optional[str] = None, + **kwargs + ): + super(AutoScaleVCore, self).__init__(location=location, tags=tags, system_data=system_data, **kwargs) + self.sku = sku + self.capacity_limit = capacity_limit + self.capacity_object_id = capacity_object_id + self.provisioning_state = None + + +class AutoScaleVCoreListResult(msrest.serialization.Model): + """An array of auto scale v-core resources. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. An array of auto scale v-core resources. + :type value: list[~azure.mgmt.powerbidedicated.models.AutoScaleVCore] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AutoScaleVCore]'}, + } + + def __init__( + self, + *, + value: List["AutoScaleVCore"], + **kwargs + ): + super(AutoScaleVCoreListResult, self).__init__(**kwargs) + self.value = value + + +class AutoScaleVCoreMutableProperties(msrest.serialization.Model): + """An object that represents a set of mutable auto scale v-core resource properties. + + :param capacity_limit: The maximum capacity of an auto scale v-core resource. + :type capacity_limit: int + """ + + _attribute_map = { + 'capacity_limit': {'key': 'capacityLimit', 'type': 'int'}, + } + + def __init__( + self, + *, + capacity_limit: Optional[int] = None, + **kwargs + ): + super(AutoScaleVCoreMutableProperties, self).__init__(**kwargs) + self.capacity_limit = capacity_limit + + +class AutoScaleVCoreProperties(AutoScaleVCoreMutableProperties): + """Properties of an auto scale v-core resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param capacity_limit: The maximum capacity of an auto scale v-core resource. + :type capacity_limit: int + :param capacity_object_id: The object ID of the capacity resource associated with the auto + scale v-core resource. + :type capacity_object_id: str + :ivar provisioning_state: The current deployment state of an auto scale v-core resource. The + provisioningState is to indicate states for resource provisioning. Possible values include: + "Succeeded". + :vartype provisioning_state: str or ~azure.mgmt.powerbidedicated.models.VCoreProvisioningState + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'capacity_limit': {'key': 'capacityLimit', 'type': 'int'}, + 'capacity_object_id': {'key': 'capacityObjectId', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + capacity_limit: Optional[int] = None, + capacity_object_id: Optional[str] = None, + **kwargs + ): + super(AutoScaleVCoreProperties, self).__init__(capacity_limit=capacity_limit, **kwargs) + self.capacity_object_id = capacity_object_id + self.provisioning_state = None + + +class AutoScaleVCoreSku(msrest.serialization.Model): + """Represents the SKU name and Azure pricing tier for auto scale v-core resource. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the SKU level. + :type name: str + :param tier: The name of the Azure pricing tier to which the SKU applies. Possible values + include: "AutoScale". + :type tier: str or ~azure.mgmt.powerbidedicated.models.VCoreSkuTier + :param capacity: The capacity of an auto scale v-core resource. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__( + self, + *, + name: str, + tier: Optional[Union[str, "VCoreSkuTier"]] = None, + capacity: Optional[int] = None, + **kwargs + ): + super(AutoScaleVCoreSku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity + + +class AutoScaleVCoreUpdateParameters(msrest.serialization.Model): + """Update request specification. + + :param sku: The SKU of the auto scale v-core resource. + :type sku: ~azure.mgmt.powerbidedicated.models.AutoScaleVCoreSku + :param tags: A set of tags. Key-value pairs of additional provisioning properties. + :type tags: dict[str, str] + :param capacity_limit: The maximum capacity of an auto scale v-core resource. + :type capacity_limit: int + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'AutoScaleVCoreSku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'capacity_limit': {'key': 'properties.capacityLimit', 'type': 'int'}, + } + + def __init__( + self, + *, + sku: Optional["AutoScaleVCoreSku"] = None, + tags: Optional[Dict[str, str]] = None, + capacity_limit: Optional[int] = None, + **kwargs + ): + super(AutoScaleVCoreUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.tags = tags + self.capacity_limit = capacity_limit + + +class CapacitySku(msrest.serialization.Model): + """Represents the SKU name and Azure pricing tier for PowerBI Dedicated capacity resource. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the SKU level. + :type name: str + :param tier: The name of the Azure pricing tier to which the SKU applies. Possible values + include: "PBIE_Azure", "Premium", "AutoPremiumHost". + :type tier: str or ~azure.mgmt.powerbidedicated.models.CapacitySkuTier + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + tier: Optional[Union[str, "CapacitySkuTier"]] = None, + **kwargs + ): + super(CapacitySku, self).__init__(**kwargs) + self.name = name + self.tier = tier + + class CheckCapacityNameAvailabilityParameters(msrest.serialization.Model): """Details of capacity name request body. @@ -102,61 +417,6 @@ def __init__( self.value = value -class Resource(msrest.serialization.Model): - """Represents an instance of an PowerBI Dedicated resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: An identifier that represents the PowerBI Dedicated resource. - :vartype id: str - :ivar name: The name of the PowerBI Dedicated resource. - :vartype name: str - :ivar type: The type of the PowerBI Dedicated resource. - :vartype type: str - :param location: Required. Location of the PowerBI Dedicated resource. - :type location: str - :param sku: Required. The SKU of the PowerBI Dedicated resource. - :type sku: ~azure.mgmt.powerbidedicated.models.ResourceSku - :param tags: A set of tags. Key-value pairs of additional resource provisioning properties. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'sku': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'ResourceSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - location: str, - sku: "ResourceSku", - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = location - self.sku = sku - self.tags = tags - - class DedicatedCapacity(Resource): """Represents an instance of a Dedicated Capacity resource. @@ -172,12 +432,16 @@ class DedicatedCapacity(Resource): :vartype type: str :param location: Required. Location of the PowerBI Dedicated resource. :type location: str - :param sku: Required. The SKU of the PowerBI Dedicated resource. - :type sku: ~azure.mgmt.powerbidedicated.models.ResourceSku :param tags: A set of tags. Key-value pairs of additional resource provisioning properties. :type tags: dict[str, str] + :param system_data: Metadata pertaining to creation and last modification of the resource. + :type system_data: ~azure.mgmt.powerbidedicated.models.SystemData + :param sku: Required. The SKU of the PowerBI Dedicated capacity resource. + :type sku: ~azure.mgmt.powerbidedicated.models.CapacitySku :param administration: A collection of Dedicated capacity administrators. :type administration: ~azure.mgmt.powerbidedicated.models.DedicatedCapacityAdministrators + :param mode: The capacity mode. Possible values include: "Gen1", "Gen2". + :type mode: str or ~azure.mgmt.powerbidedicated.models.Mode :ivar state: The current state of PowerBI Dedicated resource. The state is to indicate more states outside of resource provisioning. Possible values include: "Deleting", "Succeeded", "Failed", "Paused", "Suspended", "Provisioning", "Updating", "Suspending", "Pausing", @@ -187,7 +451,8 @@ class DedicatedCapacity(Resource): provisioningState is to indicate states for resource provisioning. Possible values include: "Deleting", "Succeeded", "Failed", "Paused", "Suspended", "Provisioning", "Updating", "Suspending", "Pausing", "Resuming", "Preparing", "Scaling". - :vartype provisioning_state: str or ~azure.mgmt.powerbidedicated.models.ProvisioningState + :vartype provisioning_state: str or + ~azure.mgmt.powerbidedicated.models.CapacityProvisioningState """ _validation = { @@ -205,9 +470,11 @@ class DedicatedCapacity(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'ResourceSku'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'sku': {'key': 'sku', 'type': 'CapacitySku'}, 'administration': {'key': 'properties.administration', 'type': 'DedicatedCapacityAdministrators'}, + 'mode': {'key': 'properties.mode', 'type': 'str'}, 'state': {'key': 'properties.state', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } @@ -216,13 +483,17 @@ def __init__( self, *, location: str, - sku: "ResourceSku", + sku: "CapacitySku", tags: Optional[Dict[str, str]] = None, + system_data: Optional["SystemData"] = None, administration: Optional["DedicatedCapacityAdministrators"] = None, + mode: Optional[Union[str, "Mode"]] = None, **kwargs ): - super(DedicatedCapacity, self).__init__(location=location, sku=sku, tags=tags, **kwargs) + super(DedicatedCapacity, self).__init__(location=location, tags=tags, system_data=system_data, **kwargs) + self.sku = sku self.administration = administration + self.mode = mode self.state = None self.provisioning_state = None @@ -253,20 +524,25 @@ class DedicatedCapacityMutableProperties(msrest.serialization.Model): :param administration: A collection of Dedicated capacity administrators. :type administration: ~azure.mgmt.powerbidedicated.models.DedicatedCapacityAdministrators + :param mode: The capacity mode. Possible values include: "Gen1", "Gen2". + :type mode: str or ~azure.mgmt.powerbidedicated.models.Mode """ _attribute_map = { 'administration': {'key': 'administration', 'type': 'DedicatedCapacityAdministrators'}, + 'mode': {'key': 'mode', 'type': 'str'}, } def __init__( self, *, administration: Optional["DedicatedCapacityAdministrators"] = None, + mode: Optional[Union[str, "Mode"]] = None, **kwargs ): super(DedicatedCapacityMutableProperties, self).__init__(**kwargs) self.administration = administration + self.mode = mode class DedicatedCapacityProperties(DedicatedCapacityMutableProperties): @@ -276,6 +552,8 @@ class DedicatedCapacityProperties(DedicatedCapacityMutableProperties): :param administration: A collection of Dedicated capacity administrators. :type administration: ~azure.mgmt.powerbidedicated.models.DedicatedCapacityAdministrators + :param mode: The capacity mode. Possible values include: "Gen1", "Gen2". + :type mode: str or ~azure.mgmt.powerbidedicated.models.Mode :ivar state: The current state of PowerBI Dedicated resource. The state is to indicate more states outside of resource provisioning. Possible values include: "Deleting", "Succeeded", "Failed", "Paused", "Suspended", "Provisioning", "Updating", "Suspending", "Pausing", @@ -285,7 +563,8 @@ class DedicatedCapacityProperties(DedicatedCapacityMutableProperties): provisioningState is to indicate states for resource provisioning. Possible values include: "Deleting", "Succeeded", "Failed", "Paused", "Suspended", "Provisioning", "Updating", "Suspending", "Pausing", "Resuming", "Preparing", "Scaling". - :vartype provisioning_state: str or ~azure.mgmt.powerbidedicated.models.ProvisioningState + :vartype provisioning_state: str or + ~azure.mgmt.powerbidedicated.models.CapacityProvisioningState """ _validation = { @@ -295,6 +574,7 @@ class DedicatedCapacityProperties(DedicatedCapacityMutableProperties): _attribute_map = { 'administration': {'key': 'administration', 'type': 'DedicatedCapacityAdministrators'}, + 'mode': {'key': 'mode', 'type': 'str'}, 'state': {'key': 'state', 'type': 'str'}, 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, } @@ -303,9 +583,10 @@ def __init__( self, *, administration: Optional["DedicatedCapacityAdministrators"] = None, + mode: Optional[Union[str, "Mode"]] = None, **kwargs ): - super(DedicatedCapacityProperties, self).__init__(administration=administration, **kwargs) + super(DedicatedCapacityProperties, self).__init__(administration=administration, mode=mode, **kwargs) self.state = None self.provisioning_state = None @@ -314,36 +595,62 @@ class DedicatedCapacityUpdateParameters(msrest.serialization.Model): """Provision request specification. :param sku: The SKU of the Dedicated capacity resource. - :type sku: ~azure.mgmt.powerbidedicated.models.ResourceSku + :type sku: ~azure.mgmt.powerbidedicated.models.CapacitySku :param tags: A set of tags. Key-value pairs of additional provisioning properties. :type tags: dict[str, str] :param administration: A collection of Dedicated capacity administrators. :type administration: ~azure.mgmt.powerbidedicated.models.DedicatedCapacityAdministrators + :param mode: The capacity mode. Possible values include: "Gen1", "Gen2". + :type mode: str or ~azure.mgmt.powerbidedicated.models.Mode """ _attribute_map = { - 'sku': {'key': 'sku', 'type': 'ResourceSku'}, + 'sku': {'key': 'sku', 'type': 'CapacitySku'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'administration': {'key': 'properties.administration', 'type': 'DedicatedCapacityAdministrators'}, + 'mode': {'key': 'properties.mode', 'type': 'str'}, } def __init__( self, *, - sku: Optional["ResourceSku"] = None, + sku: Optional["CapacitySku"] = None, tags: Optional[Dict[str, str]] = None, administration: Optional["DedicatedCapacityAdministrators"] = None, + mode: Optional[Union[str, "Mode"]] = None, **kwargs ): super(DedicatedCapacityUpdateParameters, self).__init__(**kwargs) self.sku = sku self.tags = tags self.administration = administration + self.mode = mode class ErrorResponse(msrest.serialization.Model): """Describes the format of Error response. + :param error: The error object. + :type error: ~azure.mgmt.powerbidedicated.models.ErrorResponseError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseError'}, + } + + def __init__( + self, + *, + error: Optional["ErrorResponseError"] = None, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseError(msrest.serialization.Model): + """The error object. + :param code: Error code. :type code: str :param message: Error message indicating why the operation failed. @@ -362,7 +669,7 @@ def __init__( message: Optional[str] = None, **kwargs ): - super(ErrorResponse, self).__init__(**kwargs) + super(ErrorResponseError, self).__init__(**kwargs) self.code = code self.message = message @@ -463,54 +770,21 @@ def __init__( self.next_link = None -class ResourceSku(msrest.serialization.Model): - """Represents the SKU name and Azure pricing tier for PowerBI Dedicated resource. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Name of the SKU level. - :type name: str - :param tier: The name of the Azure pricing tier to which the SKU applies. Possible values - include: "PBIE_Azure". - :type tier: str or ~azure.mgmt.powerbidedicated.models.SkuTier - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - tier: Optional[Union[str, "SkuTier"]] = None, - **kwargs - ): - super(ResourceSku, self).__init__(**kwargs) - self.name = name - self.tier = tier - - class SkuDetailsForExistingResource(msrest.serialization.Model): """An object that represents SKU details for existing resources. :param sku: The SKU in SKU details for existing resources. - :type sku: ~azure.mgmt.powerbidedicated.models.ResourceSku + :type sku: ~azure.mgmt.powerbidedicated.models.CapacitySku """ _attribute_map = { - 'sku': {'key': 'sku', 'type': 'ResourceSku'}, + 'sku': {'key': 'sku', 'type': 'CapacitySku'}, } def __init__( self, *, - sku: Optional["ResourceSku"] = None, + sku: Optional["CapacitySku"] = None, **kwargs ): super(SkuDetailsForExistingResource, self).__init__(**kwargs) @@ -542,18 +816,66 @@ class SkuEnumerationForNewResourceResult(msrest.serialization.Model): """An object that represents enumerating SKUs for new resources. :param value: The collection of available SKUs for new resources. - :type value: list[~azure.mgmt.powerbidedicated.models.ResourceSku] + :type value: list[~azure.mgmt.powerbidedicated.models.CapacitySku] """ _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceSku]'}, + 'value': {'key': 'value', 'type': '[CapacitySku]'}, } def __init__( self, *, - value: Optional[List["ResourceSku"]] = None, + value: Optional[List["CapacitySku"]] = None, **kwargs ): super(SkuEnumerationForNewResourceResult, self).__init__(**kwargs) self.value = value + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: An identifier for the identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.powerbidedicated.models.IdentityType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: An identifier for the identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure.mgmt.powerbidedicated.models.IdentityType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "IdentityType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "IdentityType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/_power_bi_dedicated_enums.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/_power_bi_dedicated_enums.py index 00e1be5a6006..577b86f2d997 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/_power_bi_dedicated_enums.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/models/_power_bi_dedicated_enums.py @@ -26,7 +26,7 @@ def __getattr__(cls, name): raise AttributeError(name) -class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class CapacityProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The current deployment state of PowerBI Dedicated resource. The provisioningState is to indicate states for resource provisioning. """ @@ -44,11 +44,29 @@ class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): PREPARING = "Preparing" SCALING = "Scaling" -class SkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class CapacitySkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The name of the Azure pricing tier to which the SKU applies. """ PBIE_AZURE = "PBIE_Azure" + PREMIUM = "Premium" + AUTO_PREMIUM_HOST = "AutoPremiumHost" + +class IdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created/modified the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class Mode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The capacity mode. + """ + + GEN1 = "Gen1" + GEN2 = "Gen2" class State(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The current state of PowerBI Dedicated resource. The state is to indicate more states outside @@ -67,3 +85,16 @@ class State(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): RESUMING = "Resuming" PREPARING = "Preparing" SCALING = "Scaling" + +class VCoreProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current deployment state of an auto scale v-core resource. The provisioningState is to + indicate states for resource provisioning. + """ + + SUCCEEDED = "Succeeded" + +class VCoreSkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The name of the Azure pricing tier to which the SKU applies. + """ + + AUTO_SCALE = "AutoScale" diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/__init__.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/__init__.py index c7e89554f78f..4178fdb5dcc7 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/__init__.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/__init__.py @@ -8,8 +8,10 @@ from ._capacities_operations import CapacitiesOperations from ._operations import Operations +from ._auto_scale_vcores_operations import AutoScaleVCoresOperations __all__ = [ 'CapacitiesOperations', 'Operations', + 'AutoScaleVCoresOperations', ] diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/_auto_scale_vcores_operations.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/_auto_scale_vcores_operations.py new file mode 100644 index 000000000000..38ae7039470e --- /dev/null +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/_auto_scale_vcores_operations.py @@ -0,0 +1,454 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AutoScaleVCoresOperations(object): + """AutoScaleVCoresOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.powerbidedicated.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + vcore_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AutoScaleVCore" + """Gets details about the specified auto scale v-core. + + :param resource_group_name: The name of the Azure Resource group of which a given + PowerBIDedicated capacity is part. This name must be at least 1 character in length, and no + more than 90. + :type resource_group_name: str + :param vcore_name: The name of the auto scale v-core. It must be a minimum of 3 characters, and + a maximum of 63. + :type vcore_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AutoScaleVCore, or the result of cls(response) + :rtype: ~azure.mgmt.powerbidedicated.models.AutoScaleVCore + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoScaleVCore"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'vcoreName': self._serialize.url("vcore_name", vcore_name, 'str', max_length=63, min_length=3, pattern=r'^[-a-zA-Z0-9_]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AutoScaleVCore', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/autoScaleVCores/{vcoreName}'} # type: ignore + + def create( + self, + resource_group_name, # type: str + vcore_name, # type: str + v_core_parameters, # type: "_models.AutoScaleVCore" + **kwargs # type: Any + ): + # type: (...) -> "_models.AutoScaleVCore" + """Provisions the specified auto scale v-core based on the configuration specified in the request. + + :param resource_group_name: The name of the Azure Resource group of which a given + PowerBIDedicated capacity is part. This name must be at least 1 character in length, and no + more than 90. + :type resource_group_name: str + :param vcore_name: The name of the auto scale v-core. It must be a minimum of 3 characters, and + a maximum of 63. + :type vcore_name: str + :param v_core_parameters: Contains the information used to provision the auto scale v-core. + :type v_core_parameters: ~azure.mgmt.powerbidedicated.models.AutoScaleVCore + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AutoScaleVCore, or the result of cls(response) + :rtype: ~azure.mgmt.powerbidedicated.models.AutoScaleVCore + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoScaleVCore"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'vcoreName': self._serialize.url("vcore_name", vcore_name, 'str', max_length=63, min_length=3, pattern=r'^[-a-zA-Z0-9_]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(v_core_parameters, 'AutoScaleVCore') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AutoScaleVCore', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/autoScaleVCores/{vcoreName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + vcore_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the specified auto scale v-core. + + :param resource_group_name: The name of the Azure Resource group of which a given + PowerBIDedicated capacity is part. This name must be at least 1 character in length, and no + more than 90. + :type resource_group_name: str + :param vcore_name: The name of the auto scale v-core. It must be a minimum of 3 characters, and + a maximum of 63. + :type vcore_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'vcoreName': self._serialize.url("vcore_name", vcore_name, 'str', max_length=63, min_length=3, pattern=r'^[-a-zA-Z0-9_]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/autoScaleVCores/{vcoreName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + vcore_name, # type: str + v_core_update_parameters, # type: "_models.AutoScaleVCoreUpdateParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.AutoScaleVCore" + """Updates the current state of the specified auto scale v-core. + + :param resource_group_name: The name of the Azure Resource group of which a given + PowerBIDedicated capacity is part. This name must be at least 1 character in length, and no + more than 90. + :type resource_group_name: str + :param vcore_name: The name of the auto scale v-core. It must be a minimum of 3 characters, and + a maximum of 63. + :type vcore_name: str + :param v_core_update_parameters: Request object that contains the updated information for the + auto scale v-core. + :type v_core_update_parameters: ~azure.mgmt.powerbidedicated.models.AutoScaleVCoreUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AutoScaleVCore, or the result of cls(response) + :rtype: ~azure.mgmt.powerbidedicated.models.AutoScaleVCore + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoScaleVCore"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'vcoreName': self._serialize.url("vcore_name", vcore_name, 'str', max_length=63, min_length=3, pattern=r'^[-a-zA-Z0-9_]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(v_core_update_parameters, 'AutoScaleVCoreUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AutoScaleVCore', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/autoScaleVCores/{vcoreName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AutoScaleVCoreListResult"] + """Gets all the auto scale v-cores for the given resource group. + + :param resource_group_name: The name of the Azure Resource group of which a given + PowerBIDedicated capacity is part. This name must be at least 1 character in length, and no + more than 90. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AutoScaleVCoreListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.powerbidedicated.models.AutoScaleVCoreListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoScaleVCoreListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AutoScaleVCoreListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/autoScaleVCores'} # type: ignore + + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AutoScaleVCoreListResult"] + """Lists all the auto scale v-cores for the given subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AutoScaleVCoreListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.powerbidedicated.models.AutoScaleVCoreListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoScaleVCoreListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AutoScaleVCoreListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.PowerBIDedicated/autoScaleVCores'} # type: ignore diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/_capacities_operations.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/_capacities_operations.py index d2b19acc3ce1..f2948c55082c 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/_capacities_operations.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/_capacities_operations.py @@ -73,7 +73,7 @@ def get_details( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -99,7 +99,8 @@ def get_details( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DedicatedCapacity', pipeline_response) @@ -122,7 +123,7 @@ def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -153,7 +154,8 @@ def _create_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize('DedicatedCapacity', pipeline_response) @@ -255,7 +257,8 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" + api_version = "2021-01-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -272,6 +275,7 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) @@ -279,7 +283,8 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -367,7 +372,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -398,7 +403,8 @@ def _update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize('DedicatedCapacity', pipeline_response) @@ -500,7 +506,8 @@ def _suspend_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" + api_version = "2021-01-01" + accept = "application/json" # Construct URL url = self._suspend_initial.metadata['url'] # type: ignore @@ -517,6 +524,7 @@ def _suspend_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) @@ -524,7 +532,8 @@ def _suspend_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -611,7 +620,8 @@ def _resume_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" + api_version = "2021-01-01" + accept = "application/json" # Construct URL url = self._resume_initial.metadata['url'] # type: ignore @@ -628,6 +638,7 @@ def _resume_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) @@ -635,7 +646,8 @@ def _resume_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -732,7 +744,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -773,8 +785,9 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -800,7 +813,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -840,8 +853,9 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -867,7 +881,7 @@ def list_skus( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -891,7 +905,8 @@ def list_skus( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SkuEnumerationForNewResourceResult', pipeline_response) @@ -927,7 +942,7 @@ def list_skus_for_capacity( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -953,7 +968,8 @@ def list_skus_for_capacity( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SkuEnumerationForExistingResourceResult', pipeline_response) @@ -986,7 +1002,7 @@ def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" + api_version = "2021-01-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1016,7 +1032,8 @@ def check_name_availability( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CheckCapacityNameAvailabilityResult', pipeline_response) diff --git a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/_operations.py b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/_operations.py index 491d70b10117..71ca9b47ad83 100644 --- a/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/_operations.py +++ b/sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/operations/_operations.py @@ -62,7 +62,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None):