From 8b9622d01bcd15307ac6114247cbe802e543c4b4 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Fri, 25 May 2018 15:39:25 -0700 Subject: [PATCH 1/3] Regenerated from d2bb2feadd0deb1c7212706aa65cab2f56adccc7 --- .../mgmt/powerbiembedded/models/__init__.py | 47 ++-- .../mgmt/powerbiembedded/models/azure_sku.py | 6 +- .../powerbiembedded/models/azure_sku_py3.py | 41 ++++ .../models/check_name_request.py | 7 +- .../models/check_name_request_py3.py | 33 +++ .../models/check_name_response.py | 12 +- .../models/check_name_response_py3.py | 39 ++++ .../create_workspace_collection_request.py | 12 +- ...create_workspace_collection_request_py3.py | 45 ++++ .../mgmt/powerbiembedded/models/display.py | 13 +- .../powerbiembedded/models/display_py3.py | 57 +++++ .../mgmt/powerbiembedded/models/error.py | 14 +- .../powerbiembedded/models/error_detail.py | 9 +- .../models/error_detail_py3.py | 36 +++ .../mgmt/powerbiembedded/models/error_py3.py | 53 +++++ .../migrate_workspace_collection_request.py | 9 +- ...igrate_workspace_collection_request_py3.py | 33 +++ .../mgmt/powerbiembedded/models/operation.py | 10 +- .../powerbiembedded/models/operation_list.py | 8 +- .../models/operation_list_py3.py | 28 +++ .../powerbiembedded/models/operation_py3.py | 34 +++ ...wer_bi_embedded_management_client_enums.py | 4 +- .../update_workspace_collection_request.py | 10 +- ...update_workspace_collection_request_py3.py | 41 ++++ .../mgmt/powerbiembedded/models/workspace.py | 11 +- .../models/workspace_collection.py | 20 +- .../models/workspace_collection_access_key.py | 8 +- .../workspace_collection_access_key_py3.py | 28 +++ .../workspace_collection_access_keys.py | 7 +- .../workspace_collection_access_keys_py3.py | 32 +++ .../models/workspace_collection_paged.py | 2 +- .../models/workspace_collection_py3.py | 61 +++++ .../powerbiembedded/models/workspace_paged.py | 2 +- .../powerbiembedded/models/workspace_py3.py | 40 ++++ .../workspace_collections_operations.py | 210 ++++++++++-------- .../operations/workspaces_operations.py | 16 +- .../power_bi_embedded_management_client.py | 25 +-- .../azure/mgmt/powerbiembedded/version.py | 2 +- 38 files changed, 854 insertions(+), 211 deletions(-) create mode 100644 azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/azure_sku_py3.py create mode 100644 azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/check_name_request_py3.py create mode 100644 azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/check_name_response_py3.py create mode 100644 azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/create_workspace_collection_request_py3.py create mode 100644 azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/display_py3.py create mode 100644 azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/error_detail_py3.py create mode 100644 azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/error_py3.py create mode 100644 azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/migrate_workspace_collection_request_py3.py create mode 100644 azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/operation_list_py3.py create mode 100644 azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/operation_py3.py create mode 100644 azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/update_workspace_collection_request_py3.py create mode 100644 azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection_access_key_py3.py create mode 100644 azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection_access_keys_py3.py create mode 100644 azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection_py3.py create mode 100644 azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_py3.py diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/__init__.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/__init__.py index abe2fe2f45e1..61403f88b18a 100644 --- a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/__init__.py +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/__init__.py @@ -9,21 +9,38 @@ # regenerated. # -------------------------------------------------------------------------- -from .error_detail import ErrorDetail -from .error import Error, ErrorException -from .azure_sku import AzureSku -from .workspace_collection import WorkspaceCollection -from .workspace import Workspace -from .display import Display -from .operation import Operation -from .operation_list import OperationList -from .workspace_collection_access_keys import WorkspaceCollectionAccessKeys -from .workspace_collection_access_key import WorkspaceCollectionAccessKey -from .create_workspace_collection_request import CreateWorkspaceCollectionRequest -from .update_workspace_collection_request import UpdateWorkspaceCollectionRequest -from .check_name_request import CheckNameRequest -from .check_name_response import CheckNameResponse -from .migrate_workspace_collection_request import MigrateWorkspaceCollectionRequest +try: + from .error_detail_py3 import ErrorDetail + from .error_py3 import Error, ErrorException + from .azure_sku_py3 import AzureSku + from .workspace_collection_py3 import WorkspaceCollection + from .workspace_py3 import Workspace + from .display_py3 import Display + from .operation_py3 import Operation + from .operation_list_py3 import OperationList + from .workspace_collection_access_keys_py3 import WorkspaceCollectionAccessKeys + from .workspace_collection_access_key_py3 import WorkspaceCollectionAccessKey + from .create_workspace_collection_request_py3 import CreateWorkspaceCollectionRequest + from .update_workspace_collection_request_py3 import UpdateWorkspaceCollectionRequest + from .check_name_request_py3 import CheckNameRequest + from .check_name_response_py3 import CheckNameResponse + from .migrate_workspace_collection_request_py3 import MigrateWorkspaceCollectionRequest +except (SyntaxError, ImportError): + from .error_detail import ErrorDetail + from .error import Error, ErrorException + from .azure_sku import AzureSku + from .workspace_collection import WorkspaceCollection + from .workspace import Workspace + from .display import Display + from .operation import Operation + from .operation_list import OperationList + from .workspace_collection_access_keys import WorkspaceCollectionAccessKeys + from .workspace_collection_access_key import WorkspaceCollectionAccessKey + from .create_workspace_collection_request import CreateWorkspaceCollectionRequest + from .update_workspace_collection_request import UpdateWorkspaceCollectionRequest + from .check_name_request import CheckNameRequest + from .check_name_response import CheckNameResponse + from .migrate_workspace_collection_request import MigrateWorkspaceCollectionRequest from .workspace_collection_paged import WorkspaceCollectionPaged from .workspace_paged import WorkspacePaged from .power_bi_embedded_management_client_enums import ( diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/azure_sku.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/azure_sku.py index 3f9b4a3b9849..e0f5265a33d0 100644 --- a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/azure_sku.py +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/azure_sku.py @@ -18,9 +18,11 @@ class AzureSku(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: SKU name. Default value: "S1" . + All required parameters must be populated in order to send to Azure. + + :ivar name: Required. SKU name. Default value: "S1" . :vartype name: str - :ivar tier: SKU tier. Default value: "Standard" . + :ivar tier: Required. SKU tier. Default value: "Standard" . :vartype tier: str """ diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/azure_sku_py3.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/azure_sku_py3.py new file mode 100644 index 000000000000..e0f5265a33d0 --- /dev/null +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/azure_sku_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class AzureSku(Model): + """AzureSku. + + 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 name: Required. SKU name. Default value: "S1" . + :vartype name: str + :ivar tier: Required. SKU tier. Default value: "Standard" . + :vartype tier: str + """ + + _validation = { + 'name': {'required': True, 'constant': True}, + 'tier': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + name = "S1" + + tier = "Standard" diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/check_name_request.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/check_name_request.py index c88dbb1ff922..8ab54415eaa0 100644 --- a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/check_name_request.py +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/check_name_request.py @@ -27,6 +27,7 @@ class CheckNameRequest(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, name=None, type="Microsoft.PowerBI/workspaceCollections"): - self.name = name - self.type = type + def __init__(self, **kwargs): + super(CheckNameRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', "Microsoft.PowerBI/workspaceCollections") diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/check_name_request_py3.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/check_name_request_py3.py new file mode 100644 index 000000000000..c9548564eef0 --- /dev/null +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/check_name_request_py3.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class CheckNameRequest(Model): + """CheckNameRequest. + + :param name: Workspace collection name + :type name: str + :param type: Resource type. Default value: + "Microsoft.PowerBI/workspaceCollections" . + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, type: str="Microsoft.PowerBI/workspaceCollections", **kwargs) -> None: + super(CheckNameRequest, self).__init__(**kwargs) + self.name = name + self.type = type diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/check_name_response.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/check_name_response.py index 9e11f5074f87..b55a632168ec 100644 --- a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/check_name_response.py +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/check_name_response.py @@ -20,8 +20,7 @@ class CheckNameResponse(Model): :type name_available: bool :param reason: Reason why the workspace collection name cannot be used. Possible values include: 'Unavailable', 'Invalid' - :type reason: str or :class:`CheckNameReason - ` + :type reason: str or ~azure.mgmt.powerbiembedded.models.CheckNameReason :param message: Message indicating an unavailable name due to a conflict, or a description of the naming rules that are violated. :type message: str @@ -33,7 +32,8 @@ class CheckNameResponse(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, name_available=None, reason=None, message=None): - self.name_available = name_available - self.reason = reason - self.message = message + def __init__(self, **kwargs): + super(CheckNameResponse, self).__init__(**kwargs) + self.name_available = kwargs.get('name_available', None) + self.reason = kwargs.get('reason', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/check_name_response_py3.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/check_name_response_py3.py new file mode 100644 index 000000000000..2f8f6f305b54 --- /dev/null +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/check_name_response_py3.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class CheckNameResponse(Model): + """CheckNameResponse. + + :param name_available: Specifies a Boolean value that indicates whether + the specified Power BI Workspace Collection name is available to use. + :type name_available: bool + :param reason: Reason why the workspace collection name cannot be used. + Possible values include: 'Unavailable', 'Invalid' + :type reason: str or ~azure.mgmt.powerbiembedded.models.CheckNameReason + :param message: Message indicating an unavailable name due to a conflict, + or a description of the naming rules that are violated. + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, name_available: bool=None, reason=None, message: str=None, **kwargs) -> None: + super(CheckNameResponse, self).__init__(**kwargs) + self.name_available = name_available + self.reason = reason + self.message = message diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/create_workspace_collection_request.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/create_workspace_collection_request.py index 8bd3b301d798..b00b51426f78 100644 --- a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/create_workspace_collection_request.py +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/create_workspace_collection_request.py @@ -22,10 +22,9 @@ class CreateWorkspaceCollectionRequest(Model): :param location: Azure location :type location: str :param tags: - :type tags: dict + :type tags: dict[str, str] :ivar sku: - :vartype sku: :class:`AzureSku - ` + :vartype sku: ~azure.mgmt.powerbiembedded.models.AzureSku """ _validation = { @@ -40,6 +39,7 @@ class CreateWorkspaceCollectionRequest(Model): sku = AzureSku() - def __init__(self, location=None, tags=None): - self.location = location - self.tags = tags + def __init__(self, **kwargs): + super(CreateWorkspaceCollectionRequest, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/create_workspace_collection_request_py3.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/create_workspace_collection_request_py3.py new file mode 100644 index 000000000000..27df1d2da704 --- /dev/null +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/create_workspace_collection_request_py3.py @@ -0,0 +1,45 @@ +# 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 .azure_sku import AzureSku +from msrest.serialization import Model + + +class CreateWorkspaceCollectionRequest(Model): + """CreateWorkspaceCollectionRequest. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param location: Azure location + :type location: str + :param tags: + :type tags: dict[str, str] + :ivar sku: + :vartype sku: ~azure.mgmt.powerbiembedded.models.AzureSku + """ + + _validation = { + 'sku': {'constant': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'AzureSku'}, + } + + sku = AzureSku() + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(CreateWorkspaceCollectionRequest, self).__init__(**kwargs) + self.location = location + self.tags = tags diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/display.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/display.py index f6e417e0eb35..44a6602c7325 100644 --- a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/display.py +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/display.py @@ -48,9 +48,10 @@ class Display(Model): 'origin': {'key': 'origin', 'type': 'str'}, } - def __init__(self, provider=None, resource=None, operation=None, description=None, origin=None): - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description - self.origin = origin + def __init__(self, **kwargs): + super(Display, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + self.origin = kwargs.get('origin', None) diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/display_py3.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/display_py3.py new file mode 100644 index 000000000000..092aa1908db2 --- /dev/null +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/display_py3.py @@ -0,0 +1,57 @@ +# 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 msrest.serialization import Model + + +class Display(Model): + """Display. + + :param provider: The localized friendly form of the resource provider + name. This form is also expected to include the publisher/company + responsible. Use Title Casing. Begin with “Microsoft” for 1st party + services. + :type provider: str + :param resource: The localized friendly form of the resource type related + to this action/operation. This form should match the public documentation + for the resource provider. Use Title Casing. For examples, refer to the + “name” section. + :type resource: str + :param operation: The localized friendly name for the operation as shown + to the user. This name should be concise (to fit in drop downs), but clear + (self-documenting). Use Title Casing and include the entity/resource to + which it applies. + :type operation: str + :param description: The localized friendly description for the operation + as shown to the user. This description should be thorough, yet concise. It + will be used in tool-tips and detailed views. + :type description: str + :param origin: The intended executor of the operation; governs the display + of the operation in the RBAC UX and the audit logs UX. Default value is + 'user,system' + :type origin: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, origin: str=None, **kwargs) -> None: + super(Display, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + self.origin = origin diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/error.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/error.py index 3bb88089e9bb..3aa05f8f9f48 100644 --- a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/error.py +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/error.py @@ -23,8 +23,7 @@ class Error(Model): :param target: :type target: str :param details: - :type details: list of :class:`ErrorDetail - ` + :type details: list[~azure.mgmt.powerbiembedded.models.ErrorDetail] """ _attribute_map = { @@ -34,11 +33,12 @@ class Error(Model): 'details': {'key': 'details', 'type': '[ErrorDetail]'}, } - def __init__(self, code=None, message=None, target=None, details=None): - self.code = code - self.message = message - self.target = target - self.details = details + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) class ErrorException(HttpOperationError): diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/error_detail.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/error_detail.py index 7f1bf288f1e4..d36c8bd1da8b 100644 --- a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/error_detail.py +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/error_detail.py @@ -29,7 +29,8 @@ class ErrorDetail(Model): 'target': {'key': 'target', 'type': 'str'}, } - def __init__(self, code=None, message=None, target=None): - self.code = code - self.message = message - self.target = target + def __init__(self, **kwargs): + super(ErrorDetail, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/error_detail_py3.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/error_detail_py3.py new file mode 100644 index 000000000000..5093fd1b8341 --- /dev/null +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/error_detail_py3.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class ErrorDetail(Model): + """ErrorDetail. + + :param code: + :type code: str + :param message: + :type message: str + :param target: + :type target: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, **kwargs) -> None: + super(ErrorDetail, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/error_py3.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/error_py3.py new file mode 100644 index 000000000000..553ca60690f7 --- /dev/null +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/error_py3.py @@ -0,0 +1,53 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class Error(Model): + """Error. + + :param code: + :type code: str + :param message: + :type message: str + :param target: + :type target: str + :param details: + :type details: list[~azure.mgmt.powerbiembedded.models.ErrorDetail] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class ErrorException(HttpOperationError): + """Server responsed with exception of type: 'Error'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorException, self).__init__(deserialize, response, 'Error', *args) diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/migrate_workspace_collection_request.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/migrate_workspace_collection_request.py index 1a296b1a2e62..d5fa09ca0c81 100644 --- a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/migrate_workspace_collection_request.py +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/migrate_workspace_collection_request.py @@ -19,7 +19,7 @@ class MigrateWorkspaceCollectionRequest(Model): workspace collections will be migrated to. :type target_resource_group: str :param resources: - :type resources: list of str + :type resources: list[str] """ _attribute_map = { @@ -27,6 +27,7 @@ class MigrateWorkspaceCollectionRequest(Model): 'resources': {'key': 'resources', 'type': '[str]'}, } - def __init__(self, target_resource_group=None, resources=None): - self.target_resource_group = target_resource_group - self.resources = resources + def __init__(self, **kwargs): + super(MigrateWorkspaceCollectionRequest, self).__init__(**kwargs) + self.target_resource_group = kwargs.get('target_resource_group', None) + self.resources = kwargs.get('resources', None) diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/migrate_workspace_collection_request_py3.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/migrate_workspace_collection_request_py3.py new file mode 100644 index 000000000000..40067c355857 --- /dev/null +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/migrate_workspace_collection_request_py3.py @@ -0,0 +1,33 @@ +# 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 msrest.serialization import Model + + +class MigrateWorkspaceCollectionRequest(Model): + """MigrateWorkspaceCollectionRequest. + + :param target_resource_group: Name of the resource group the Power BI + workspace collections will be migrated to. + :type target_resource_group: str + :param resources: + :type resources: list[str] + """ + + _attribute_map = { + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[str]'}, + } + + def __init__(self, *, target_resource_group: str=None, resources=None, **kwargs) -> None: + super(MigrateWorkspaceCollectionRequest, self).__init__(**kwargs) + self.target_resource_group = target_resource_group + self.resources = resources diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/operation.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/operation.py index 1d54e2223903..a30f5f7c0822 100644 --- a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/operation.py +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/operation.py @@ -20,8 +20,7 @@ class Operation(Model): event service. :type name: str :param display: - :type display: :class:`Display - ` + :type display: ~azure.mgmt.powerbiembedded.models.Display """ _attribute_map = { @@ -29,6 +28,7 @@ class Operation(Model): 'display': {'key': 'display', 'type': 'Display'}, } - def __init__(self, name=None, display=None): - self.name = name - self.display = display + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/operation_list.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/operation_list.py index ef547c20f74f..0d87571b3285 100644 --- a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/operation_list.py +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/operation_list.py @@ -16,13 +16,13 @@ class OperationList(Model): """OperationList. :param value: - :type value: list of :class:`Operation - ` + :type value: list[~azure.mgmt.powerbiembedded.models.Operation] """ _attribute_map = { 'value': {'key': 'value', 'type': '[Operation]'}, } - def __init__(self, value=None): - self.value = value + def __init__(self, **kwargs): + super(OperationList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/operation_list_py3.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/operation_list_py3.py new file mode 100644 index 000000000000..489f837b7bb1 --- /dev/null +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/operation_list_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class OperationList(Model): + """OperationList. + + :param value: + :type value: list[~azure.mgmt.powerbiembedded.models.Operation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(OperationList, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/operation_py3.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/operation_py3.py new file mode 100644 index 000000000000..530191798420 --- /dev/null +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/operation_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class Operation(Model): + """Operation. + + :param name: The name of the operation being performed on this particular + object. This name should match the action name that appears in RBAC / the + event service. + :type name: str + :param display: + :type display: ~azure.mgmt.powerbiembedded.models.Display + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'Display'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/power_bi_embedded_management_client_enums.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/power_bi_embedded_management_client_enums.py index c3c3c06f3864..58b7abcc207c 100644 --- a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/power_bi_embedded_management_client_enums.py +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/power_bi_embedded_management_client_enums.py @@ -12,13 +12,13 @@ from enum import Enum -class AccessKeyName(Enum): +class AccessKeyName(str, Enum): key1 = "key1" key2 = "key2" -class CheckNameReason(Enum): +class CheckNameReason(str, Enum): unavailable = "Unavailable" invalid = "Invalid" diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/update_workspace_collection_request.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/update_workspace_collection_request.py index d740fe74ff07..8c758bcecd24 100644 --- a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/update_workspace_collection_request.py +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/update_workspace_collection_request.py @@ -20,10 +20,9 @@ class UpdateWorkspaceCollectionRequest(Model): sending a request. :param tags: - :type tags: dict + :type tags: dict[str, str] :ivar sku: - :vartype sku: :class:`AzureSku - ` + :vartype sku: ~azure.mgmt.powerbiembedded.models.AzureSku """ _validation = { @@ -37,5 +36,6 @@ class UpdateWorkspaceCollectionRequest(Model): sku = AzureSku() - def __init__(self, tags=None): - self.tags = tags + def __init__(self, **kwargs): + super(UpdateWorkspaceCollectionRequest, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/update_workspace_collection_request_py3.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/update_workspace_collection_request_py3.py new file mode 100644 index 000000000000..646df196d304 --- /dev/null +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/update_workspace_collection_request_py3.py @@ -0,0 +1,41 @@ +# 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 .azure_sku import AzureSku +from msrest.serialization import Model + + +class UpdateWorkspaceCollectionRequest(Model): + """UpdateWorkspaceCollectionRequest. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param tags: + :type tags: dict[str, str] + :ivar sku: + :vartype sku: ~azure.mgmt.powerbiembedded.models.AzureSku + """ + + _validation = { + 'sku': {'constant': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'AzureSku'}, + } + + sku = AzureSku() + + def __init__(self, *, tags=None, **kwargs) -> None: + super(UpdateWorkspaceCollectionRequest, self).__init__(**kwargs) + self.tags = tags diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace.py index 05a8974182e3..e4c90b670ac7 100644 --- a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace.py +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace.py @@ -32,8 +32,9 @@ class Workspace(Model): 'properties': {'key': 'properties', 'type': 'object'}, } - def __init__(self, id=None, name=None, type=None, properties=None): - self.id = id - self.name = name - self.type = type - self.properties = properties + def __init__(self, **kwargs): + super(Workspace, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection.py index b39c66ea29cf..701a1b72f985 100644 --- a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection.py +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection.py @@ -28,10 +28,9 @@ class WorkspaceCollection(Model): :param location: Azure location :type location: str :param tags: - :type tags: dict + :type tags: dict[str, str] :ivar sku: - :vartype sku: :class:`AzureSku - ` + :vartype sku: ~azure.mgmt.powerbiembedded.models.AzureSku :param properties: Properties :type properties: object """ @@ -52,10 +51,11 @@ class WorkspaceCollection(Model): sku = AzureSku() - def __init__(self, id=None, name=None, type=None, location=None, tags=None, properties=None): - self.id = id - self.name = name - self.type = type - self.location = location - self.tags = tags - self.properties = properties + def __init__(self, **kwargs): + super(WorkspaceCollection, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection_access_key.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection_access_key.py index 36f9ae368fb0..96c3e56c5d92 100644 --- a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection_access_key.py +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection_access_key.py @@ -16,13 +16,13 @@ class WorkspaceCollectionAccessKey(Model): """WorkspaceCollectionAccessKey. :param key_name: Key name. Possible values include: 'key1', 'key2' - :type key_name: str or :class:`AccessKeyName - ` + :type key_name: str or ~azure.mgmt.powerbiembedded.models.AccessKeyName """ _attribute_map = { 'key_name': {'key': 'keyName', 'type': 'AccessKeyName'}, } - def __init__(self, key_name=None): - self.key_name = key_name + def __init__(self, **kwargs): + super(WorkspaceCollectionAccessKey, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection_access_key_py3.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection_access_key_py3.py new file mode 100644 index 000000000000..a0a43243b2e2 --- /dev/null +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection_access_key_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class WorkspaceCollectionAccessKey(Model): + """WorkspaceCollectionAccessKey. + + :param key_name: Key name. Possible values include: 'key1', 'key2' + :type key_name: str or ~azure.mgmt.powerbiembedded.models.AccessKeyName + """ + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'AccessKeyName'}, + } + + def __init__(self, *, key_name=None, **kwargs) -> None: + super(WorkspaceCollectionAccessKey, self).__init__(**kwargs) + self.key_name = key_name diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection_access_keys.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection_access_keys.py index 0001dcbe26ad..bfca2c68d6c1 100644 --- a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection_access_keys.py +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection_access_keys.py @@ -26,6 +26,7 @@ class WorkspaceCollectionAccessKeys(Model): 'key2': {'key': 'key2', 'type': 'str'}, } - def __init__(self, key1=None, key2=None): - self.key1 = key1 - self.key2 = key2 + def __init__(self, **kwargs): + super(WorkspaceCollectionAccessKeys, self).__init__(**kwargs) + self.key1 = kwargs.get('key1', None) + self.key2 = kwargs.get('key2', None) diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection_access_keys_py3.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection_access_keys_py3.py new file mode 100644 index 000000000000..74e13a098b89 --- /dev/null +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection_access_keys_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class WorkspaceCollectionAccessKeys(Model): + """WorkspaceCollectionAccessKeys. + + :param key1: Access key 1 + :type key1: str + :param key2: Access key 2 + :type key2: str + """ + + _attribute_map = { + 'key1': {'key': 'key1', 'type': 'str'}, + 'key2': {'key': 'key2', 'type': 'str'}, + } + + def __init__(self, *, key1: str=None, key2: str=None, **kwargs) -> None: + super(WorkspaceCollectionAccessKeys, self).__init__(**kwargs) + self.key1 = key1 + self.key2 = key2 diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection_paged.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection_paged.py index c3086b9892bd..46660de33edf 100644 --- a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection_paged.py +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection_paged.py @@ -14,7 +14,7 @@ class WorkspaceCollectionPaged(Paged): """ - A paging container for iterating over a list of WorkspaceCollection object + A paging container for iterating over a list of :class:`WorkspaceCollection ` object """ _attribute_map = { diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection_py3.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection_py3.py new file mode 100644 index 000000000000..8310ce99f495 --- /dev/null +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_collection_py3.py @@ -0,0 +1,61 @@ +# 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 .azure_sku import AzureSku +from msrest.serialization import Model + + +class WorkspaceCollection(Model): + """WorkspaceCollection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource id + :type id: str + :param name: Workspace collection name + :type name: str + :param type: Resource type + :type type: str + :param location: Azure location + :type location: str + :param tags: + :type tags: dict[str, str] + :ivar sku: + :vartype sku: ~azure.mgmt.powerbiembedded.models.AzureSku + :param properties: Properties + :type properties: object + """ + + _validation = { + 'sku': {'constant': 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}'}, + 'sku': {'key': 'sku', 'type': 'AzureSku'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + sku = AzureSku() + + def __init__(self, *, id: str=None, name: str=None, type: str=None, location: str=None, tags=None, properties=None, **kwargs) -> None: + super(WorkspaceCollection, self).__init__(**kwargs) + self.id = id + self.name = name + self.type = type + self.location = location + self.tags = tags + self.properties = properties diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_paged.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_paged.py index 67c335af8026..8d630ab6bac7 100644 --- a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_paged.py +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_paged.py @@ -14,7 +14,7 @@ class WorkspacePaged(Paged): """ - A paging container for iterating over a list of Workspace object + A paging container for iterating over a list of :class:`Workspace ` object """ _attribute_map = { diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_py3.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_py3.py new file mode 100644 index 000000000000..43b52413c967 --- /dev/null +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/workspace_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class Workspace(Model): + """Workspace. + + :param id: Workspace id + :type id: str + :param name: Workspace name + :type name: str + :param type: Resource type + :type type: str + :param properties: Property bag + :type properties: object + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, *, id: str=None, name: str=None, type: str=None, properties=None, **kwargs) -> None: + super(Workspace, self).__init__(**kwargs) + self.id = id + self.name = name + self.type = type + self.properties = properties diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/operations/workspace_collections_operations.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/operations/workspace_collections_operations.py index 7ff51096e931..94f7399cf90b 100644 --- a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/operations/workspace_collections_operations.py +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/operations/workspace_collections_operations.py @@ -9,9 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_operation import AzureOperationPoller import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -22,10 +23,12 @@ class WorkspaceCollectionsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-01-29". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,15 +52,14 @@ def get_by_name( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`WorkspaceCollection - ` - :rtype: :class:`ClientRawResponse` - if raw=true + :return: WorkspaceCollection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.powerbiembedded.models.WorkspaceCollection or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}' + url = self.get_by_name.metadata['url'] 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'), @@ -81,7 +83,7 @@ def get_by_name( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -96,6 +98,7 @@ def get_by_name( return client_raw_response return deserialized + get_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}'} def create( self, resource_group_name, workspace_collection_name, location=None, tags=None, custom_headers=None, raw=False, **operation_config): @@ -112,23 +115,22 @@ def create( :param location: Azure location :type location: str :param tags: - :type tags: dict + :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`WorkspaceCollection - ` - :rtype: :class:`ClientRawResponse` - if raw=true + :return: WorkspaceCollection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.powerbiembedded.models.WorkspaceCollection or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorException` """ body = models.CreateWorkspaceCollectionRequest(location=location, tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}' + url = self.create.metadata['url'] 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'), @@ -156,7 +158,7 @@ def create( # Construct and send request request = self._client.put(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -171,6 +173,7 @@ def create( return client_raw_response return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}'} def update( self, resource_group_name, workspace_collection_name, tags=None, custom_headers=None, raw=False, **operation_config): @@ -183,23 +186,22 @@ def update( Collection name :type workspace_collection_name: str :param tags: - :type tags: dict + :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`WorkspaceCollection - ` - :rtype: :class:`ClientRawResponse` - if raw=true + :return: WorkspaceCollection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.powerbiembedded.models.WorkspaceCollection or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorException` """ body = models.UpdateWorkspaceCollectionRequest(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}' + url = self.update.metadata['url'] 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'), @@ -227,7 +229,7 @@ def update( # Construct and send request request = self._client.patch(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -242,29 +244,13 @@ def update( return client_raw_response return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}'} - def delete( - self, resource_group_name, workspace_collection_name, custom_headers=None, raw=False, **operation_config): - """Delete a Power BI Workspace Collection. - :param resource_group_name: Azure resource group - :type resource_group_name: str - :param workspace_collection_name: Power BI Embedded Workspace - Collection name - :type workspace_collection_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :rtype: - :class:`AzureOperationPoller` - instance that returns None - :rtype: :class:`ClientRawResponse` - if raw=true - :raises: - :class:`ErrorException` - """ + def _delete_initial( + self, resource_group_name, workspace_collection_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}' + url = self.delete.metadata['url'] 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'), @@ -287,38 +273,58 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - def long_running_send(): - - request = self._client.delete(url, query_parameters) - return self._client.send(request, header_parameters, **operation_config) + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) - def get_long_running_status(status_link, headers=None): + if response.status_code not in [202]: + raise models.ErrorException(self._deserialize, response) - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - return self._client.send( - request, header_parameters, **operation_config) + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response - def get_long_running_output(response): + def delete( + self, resource_group_name, workspace_collection_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a Power BI Workspace Collection. - if response.status_code not in [202]: - raise models.ErrorException(self._deserialize, response) + :param resource_group_name: Azure resource group + :type resource_group_name: str + :param workspace_collection_name: Power BI Embedded Workspace + Collection name + :type workspace_collection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + workspace_collection_name=workspace_collection_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + def get_long_running_output(response): if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - if raw: - response = long_running_send() - return get_long_running_output(response) - - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}'} def check_name_availability( self, location, name=None, type="Microsoft.PowerBI/workspaceCollections", custom_headers=None, raw=False, **operation_config): @@ -336,17 +342,16 @@ def check_name_availability( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`CheckNameResponse - ` - :rtype: :class:`ClientRawResponse` - if raw=true + :return: CheckNameResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.powerbiembedded.models.CheckNameResponse or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorException` """ body = models.CheckNameRequest(name=name, type=type) # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.PowerBI/locations/{location}/checkNameAvailability' + url = self.check_name_availability.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'location': self._serialize.url("location", location, 'str') @@ -373,7 +378,7 @@ def check_name_availability( # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -388,6 +393,7 @@ def check_name_availability( return client_raw_response return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.PowerBI/locations/{location}/checkNameAvailability'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -401,8 +407,9 @@ def list_by_resource_group( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`WorkspaceCollectionPaged - ` + :return: An iterator like instance of WorkspaceCollection + :rtype: + ~azure.mgmt.powerbiembedded.models.WorkspaceCollectionPaged[~azure.mgmt.powerbiembedded.models.WorkspaceCollection] :raises: :class:`ErrorException` """ @@ -410,7 +417,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections' + url = self.list_by_resource_group.metadata['url'] 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') @@ -438,7 +445,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -454,6 +461,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections'} def list_by_subscription( self, custom_headers=None, raw=False, **operation_config): @@ -465,8 +473,9 @@ def list_by_subscription( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`WorkspaceCollectionPaged - ` + :return: An iterator like instance of WorkspaceCollection + :rtype: + ~azure.mgmt.powerbiembedded.models.WorkspaceCollectionPaged[~azure.mgmt.powerbiembedded.models.WorkspaceCollection] :raises: :class:`ErrorException` """ @@ -474,7 +483,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.PowerBI/workspaceCollections' + url = self.list_by_subscription.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -501,7 +510,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -517,6 +526,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.PowerBI/workspaceCollections'} def get_access_keys( self, resource_group_name, workspace_collection_name, custom_headers=None, raw=False, **operation_config): @@ -533,15 +543,16 @@ def get_access_keys( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`WorkspaceCollectionAccessKeys - ` - :rtype: :class:`ClientRawResponse` - if raw=true + :return: WorkspaceCollectionAccessKeys or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.powerbiembedded.models.WorkspaceCollectionAccessKeys or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}/listKeys' + url = self.get_access_keys.metadata['url'] 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'), @@ -565,7 +576,7 @@ def get_access_keys( # Construct and send request request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -580,6 +591,7 @@ def get_access_keys( return client_raw_response return deserialized + get_access_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}/listKeys'} def regenerate_key( self, resource_group_name, workspace_collection_name, key_name=None, custom_headers=None, raw=False, **operation_config): @@ -592,24 +604,25 @@ def regenerate_key( Collection name :type workspace_collection_name: str :param key_name: Key name. Possible values include: 'key1', 'key2' - :type key_name: str or :class:`AccessKeyName - ` + :type key_name: str or + ~azure.mgmt.powerbiembedded.models.AccessKeyName :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`WorkspaceCollectionAccessKeys - ` - :rtype: :class:`ClientRawResponse` - if raw=true + :return: WorkspaceCollectionAccessKeys or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.powerbiembedded.models.WorkspaceCollectionAccessKeys or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorException` """ body = models.WorkspaceCollectionAccessKey(key_name=key_name) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}/regenerateKey' + url = self.regenerate_key.metadata['url'] 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'), @@ -637,7 +650,7 @@ def regenerate_key( # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -652,6 +665,7 @@ def regenerate_key( return client_raw_response return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}/regenerateKey'} def migrate( self, resource_group_name, target_resource_group=None, resources=None, custom_headers=None, raw=False, **operation_config): @@ -664,22 +678,21 @@ def migrate( workspace collections will be migrated to. :type target_resource_group: str :param resources: - :type resources: list of str + :type resources: list[str] :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: None - :rtype: :class:`ClientRawResponse` - if raw=true + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorException` """ body = models.MigrateWorkspaceCollectionRequest(target_resource_group=target_resource_group, resources=resources) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources' + url = self.migrate.metadata['url'] 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') @@ -706,7 +719,7 @@ def migrate( # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -714,3 +727,4 @@ def migrate( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + migrate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources'} diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/operations/workspaces_operations.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/operations/workspaces_operations.py index 50ef9772113c..cecd26b763fc 100644 --- a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/operations/workspaces_operations.py +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/operations/workspaces_operations.py @@ -9,8 +9,8 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.pipeline import ClientRawResponse import uuid +from msrest.pipeline import ClientRawResponse from .. import models @@ -21,10 +21,12 @@ class WorkspacesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2016-01-29". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,8 +51,9 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`WorkspacePaged - ` + :return: An iterator like instance of Workspace + :rtype: + ~azure.mgmt.powerbiembedded.models.WorkspacePaged[~azure.mgmt.powerbiembedded.models.Workspace] :raises: :class:`ErrorException` """ @@ -58,7 +61,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}/workspaces' + url = self.list.metadata['url'] 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'), @@ -87,7 +90,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -103,3 +106,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}/workspaces'} diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/power_bi_embedded_management_client.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/power_bi_embedded_management_client.py index d1a45c049db9..0b1674ca9a54 100644 --- a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/power_bi_embedded_management_client.py +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/power_bi_embedded_management_client.py @@ -9,12 +9,13 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION from msrest.pipeline import ClientRawResponse -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling import uuid from .operations.workspace_collections_operations import WorkspaceCollectionsOperations from .operations.workspaces_operations import WorkspacesOperations @@ -43,21 +44,19 @@ def __init__( raise ValueError("Parameter 'credentials' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - if not isinstance(subscription_id, str): - raise TypeError("Parameter 'subscription_id' must be str.") if not base_url: base_url = 'https://management.azure.com' super(PowerBIEmbeddedManagementClientConfiguration, self).__init__(base_url) - self.add_user_agent('powerbiembeddedmanagementclient/{}'.format(VERSION)) + self.add_user_agent('azure-mgmt-powerbiembedded/{}'.format(VERSION)) self.add_user_agent('Azure-SDK-For-Python') self.credentials = credentials self.subscription_id = subscription_id -class PowerBIEmbeddedManagementClient(object): +class PowerBIEmbeddedManagementClient(SDKClient): """Client to manage your Power BI Embedded workspace collections and retrieve workspaces. :ivar config: Configuration for client. @@ -82,7 +81,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = PowerBIEmbeddedManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(PowerBIEmbeddedManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '2016-01-29' @@ -104,15 +103,14 @@ def get_available_operations( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`OperationList - ` - :rtype: :class:`ClientRawResponse` - if raw=true + :return: OperationList or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.powerbiembedded.models.OperationList or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorException` """ # Construct URL - url = '/providers/Microsoft.PowerBI/operations' + url = self.get_available_operations.metadata['url'] # Construct parameters query_parameters = {} @@ -130,7 +128,7 @@ def get_available_operations( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -145,3 +143,4 @@ def get_available_operations( return client_raw_response return deserialized + get_available_operations.metadata = {'url': '/providers/Microsoft.PowerBI/operations'} diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/version.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/version.py index a39916c162ce..1fd52803ea78 100644 --- a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/version.py +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0" +VERSION = "2016-01-29" From a19a96919e1d0db7df225e2fe01be2a89901fd9d Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Fri, 25 May 2018 15:40:53 -0700 Subject: [PATCH 2/3] PBI auto packaging --- azure-mgmt-powerbiembedded/README.rst | 6 +++--- azure-mgmt-powerbiembedded/sdk_packaging.toml | 5 +++++ azure-mgmt-powerbiembedded/setup.py | 11 +++++------ 3 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 azure-mgmt-powerbiembedded/sdk_packaging.toml diff --git a/azure-mgmt-powerbiembedded/README.rst b/azure-mgmt-powerbiembedded/README.rst index 88987f630c1f..f75a904d0183 100644 --- a/azure-mgmt-powerbiembedded/README.rst +++ b/azure-mgmt-powerbiembedded/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Power BI Embedded Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.3, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. @@ -37,8 +37,8 @@ Usage ===== For code examples, see `Power BI Embedded Management -`__ -on readthedocs.org. +`__ +on docs.microsoft.com. Provide Feedback diff --git a/azure-mgmt-powerbiembedded/sdk_packaging.toml b/azure-mgmt-powerbiembedded/sdk_packaging.toml new file mode 100644 index 000000000000..173e964bc7c6 --- /dev/null +++ b/azure-mgmt-powerbiembedded/sdk_packaging.toml @@ -0,0 +1,5 @@ +[packaging] +package_name = "azure-mgmt-powerbiembedded" +package_pprint_name = "Power BI Embedded Management" +package_doc_id = "power-bi" +is_stable = true diff --git a/azure-mgmt-powerbiembedded/setup.py b/azure-mgmt-powerbiembedded/setup.py index 52631e008464..90d75208fd7e 100644 --- a/azure-mgmt-powerbiembedded/setup.py +++ b/azure-mgmt-powerbiembedded/setup.py @@ -61,25 +61,24 @@ long_description=readme + '\n\n' + history, license='MIT License', author='Microsoft Corporation', - author_email='ptvshelp@microsoft.com', + author_email='azpysdkhelp@microsoft.com', url='https://github.com/Azure/azure-sdk-for-python', classifiers=[ - 'Development Status :: 4 - Beta', + 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'License :: OSI Approved :: MIT License', ], zip_safe=False, - packages=find_packages(), + packages=find_packages(exclude=["tests"]), install_requires=[ - 'msrestazure~=0.4.8', - 'azure-common~=1.1.6', + 'msrestazure>=0.4.27,<2.0.0', + 'azure-common~=1.1', ], cmdclass=cmdclass ) From 2d676488247a6659dc8526aceb67af921461a37c Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Fri, 25 May 2018 15:42:45 -0700 Subject: [PATCH 3/3] azure-mgmt-powerbiembedded 2.0.0 --- azure-mgmt-powerbiembedded/HISTORY.rst | 36 +++++++++++++++++++ .../azure/mgmt/powerbiembedded/version.py | 2 +- azure-mgmt-powerbiembedded/build.json | 1 - 3 files changed, 37 insertions(+), 2 deletions(-) delete mode 100644 azure-mgmt-powerbiembedded/build.json diff --git a/azure-mgmt-powerbiembedded/HISTORY.rst b/azure-mgmt-powerbiembedded/HISTORY.rst index 4d9941a0e602..b4cecd587d02 100644 --- a/azure-mgmt-powerbiembedded/HISTORY.rst +++ b/azure-mgmt-powerbiembedded/HISTORY.rst @@ -3,6 +3,42 @@ Release History =============== +2.0.0 (2018-05-25) +++++++++++++++++++ + +**Features** + +- Client class can be used as a context manager to keep the underlying HTTP session open for performance + +**General Breaking changes** + +This version uses a next-generation code generator that *might* introduce breaking changes. + +- Model signatures now use only keyword-argument syntax. All positional arguments must be re-written as keyword-arguments. + To keep auto-completion in most cases, models are now generated for Python 2 and Python 3. Python 3 uses the "*" syntax for keyword-only arguments. +- Enum types now use the "str" mixin (class AzureEnum(str, Enum)) to improve the behavior when unrecognized enum values are encountered. + While this is not a breaking change, the distinctions are important, and are documented here: + https://docs.python.org/3/library/enum.html#others + At a glance: + + - "is" should not be used at all. + - "format" will return the string value, where "%s" string formatting will return `NameOfEnum.stringvalue`. Format syntax should be prefered. + +- New Long Running Operation: + + - Return type changes from `msrestazure.azure_operation.AzureOperationPoller` to `msrest.polling.LROPoller`. External API is the same. + - Return type is now **always** a `msrest.polling.LROPoller`, regardless of the optional parameters used. + - The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`, + without polling, now this returns an LROPoller. After polling, the final resource will be returned as a `ClientRawResponse`. + - New `polling` parameter. The default behavior is `Polling=True` which will poll using ARM algorithm. When `Polling=False`, + the response of the initial call will be returned without polling. + - `polling` parameter accepts instances of subclasses of `msrest.polling.PollingMethod`. + - `add_done_callback` will no longer raise if called after polling is finished, but will instead execute the callback right away. + +**Bugfixes** + +- Compatibility of the sdist with wheel 0.31.0 + 1.0.0 (2017-06-23) ++++++++++++++++++ diff --git a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/version.py b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/version.py index 1fd52803ea78..53c4c7ea05e8 100644 --- a/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/version.py +++ b/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "2016-01-29" +VERSION = "2.0.0" diff --git a/azure-mgmt-powerbiembedded/build.json b/azure-mgmt-powerbiembedded/build.json deleted file mode 100644 index 204b507d3c37..000000000000 --- a/azure-mgmt-powerbiembedded/build.json +++ /dev/null @@ -1 +0,0 @@ -{"autorest": "1.1.0", "date": "2017-06-23T17:52:38Z", "version": ""} \ No newline at end of file