Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PBI Autorest.Python 3.x #2632

Merged
merged 3 commits into from
May 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions azure-mgmt-powerbiembedded/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
++++++++++++++++++

Expand Down
6 changes: 3 additions & 3 deletions azure-mgmt-powerbiembedded/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library.
Expand Down Expand Up @@ -37,8 +37,8 @@ Usage
=====

For code examples, see `Power BI Embedded Management
<https://azure-sdk-for-python.readthedocs.org/en/latest/sample_azure-mgmt-powerbiembedded.html>`__
on readthedocs.org.
<https://docs.microsoft.com/python/api/overview/azure/power-bi>`__
on docs.microsoft.com.


Provide Feedback
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""

Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
<azure.mgmt.powerbiembedded.models.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
Expand All @@ -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)
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
<azure.mgmt.powerbiembedded.models.AzureSku>`
:vartype sku: ~azure.mgmt.powerbiembedded.models.AzureSku
"""

_validation = {
Expand All @@ -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)
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Loading