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

[AutoPR] restapi_auto_search/resource-manager #1958

Merged
merged 4 commits into from
May 21, 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
39 changes: 39 additions & 0 deletions azure-mgmt-search/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,45 @@
Release History
===============

2.0.0 (2018-05-21)
++++++++++++++++++

**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.

**Features**

- Add "operations" operation group
- Add services.update
- Client class can be used as a context manager to keep the underlying HTTP session open for performance

**Bugfixes**

- services.create_or_update is now correctly a Long Running Operation
- Compatibility of the sdist with wheel 0.31.0

1.0.0 (2016-06-23)
++++++++++++++++++

Expand Down
6 changes: 3 additions & 3 deletions azure-mgmt-search/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is the Microsoft Azure Search 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 `Search Management
<https://azure-sdk-for-python.readthedocs.org/en/latest/sample_azure-mgmt-search.html>`__
on readthedocs.org.
<https://docs.microsoft.com/python/api/overview/azure/search>`__
on docs.microsoft.com.


Provide Feedback
Expand Down
34 changes: 26 additions & 8 deletions azure-mgmt-search/azure/mgmt/search/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,29 @@
# regenerated.
# --------------------------------------------------------------------------

from .check_name_availability_input import CheckNameAvailabilityInput
from .check_name_availability_output import CheckNameAvailabilityOutput
from .admin_key_result import AdminKeyResult
from .query_key import QueryKey
from .sku import Sku
from .search_service import SearchService
from .resource import Resource
from .search_management_request_options import SearchManagementRequestOptions
try:
from .check_name_availability_input_py3 import CheckNameAvailabilityInput
from .check_name_availability_output_py3 import CheckNameAvailabilityOutput
from .admin_key_result_py3 import AdminKeyResult
from .query_key_py3 import QueryKey
from .sku_py3 import Sku
from .search_service_py3 import SearchService
from .resource_py3 import Resource
from .operation_display_py3 import OperationDisplay
from .operation_py3 import Operation
from .search_management_request_options_py3 import SearchManagementRequestOptions
except (SyntaxError, ImportError):
from .check_name_availability_input import CheckNameAvailabilityInput
from .check_name_availability_output import CheckNameAvailabilityOutput
from .admin_key_result import AdminKeyResult
from .query_key import QueryKey
from .sku import Sku
from .search_service import SearchService
from .resource import Resource
from .operation_display import OperationDisplay
from .operation import Operation
from .search_management_request_options import SearchManagementRequestOptions
from .operation_paged import OperationPaged
from .query_key_paged import QueryKeyPaged
from .search_service_paged import SearchServicePaged
from .search_management_client_enums import (
Expand All @@ -36,7 +51,10 @@
'Sku',
'SearchService',
'Resource',
'OperationDisplay',
'Operation',
'SearchManagementRequestOptions',
'OperationPaged',
'QueryKeyPaged',
'SearchServicePaged',
'UnavailableNameReason',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class AdminKeyResult(Model):
'secondary_key': {'key': 'secondaryKey', 'type': 'str'},
}

def __init__(self):
def __init__(self, **kwargs):
super(AdminKeyResult, self).__init__(**kwargs)
self.primary_key = None
self.secondary_key = None
41 changes: 41 additions & 0 deletions azure-mgmt-search/azure/mgmt/search/models/admin_key_result_py3.py
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 AdminKeyResult(Model):
"""Response containing the primary and secondary admin API keys for a given
Azure Search service.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar primary_key: The primary admin API key of the Search service.
:vartype primary_key: str
:ivar secondary_key: The secondary admin API key of the Search service.
:vartype secondary_key: str
"""

_validation = {
'primary_key': {'readonly': True},
'secondary_key': {'readonly': True},
}

_attribute_map = {
'primary_key': {'key': 'primaryKey', 'type': 'str'},
'secondary_key': {'key': 'secondaryKey', 'type': 'str'},
}

def __init__(self, **kwargs) -> None:
super(AdminKeyResult, self).__init__(**kwargs)
self.primary_key = None
self.secondary_key = None
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@ class CheckNameAvailabilityInput(Model):
Variables are only populated by the server, and will be ignored when
sending a request.

:param name: The Search service name to validate. Search service names
must only contain lowercase letters, digits or dashes, cannot use dash as
the first two or last one characters, cannot contain consecutive dashes,
and must be between 2 and 60 characters in length.
All required parameters must be populated in order to send to Azure.

:param name: Required. The Search service name to validate. Search service
names must only contain lowercase letters, digits or dashes, cannot use
dash as the first two or last one characters, cannot contain consecutive
dashes, and must be between 2 and 60 characters in length.
:type name: str
:ivar type: The type of the resource whose name is to be validated. This
value must always be 'searchServices'. Default value: "searchServices" .
:ivar type: Required. The type of the resource whose name is to be
validated. This value must always be 'searchServices'. Default value:
"searchServices" .
:vartype type: str
"""

Expand All @@ -40,5 +43,6 @@ class CheckNameAvailabilityInput(Model):

type = "searchServices"

def __init__(self, name):
self.name = name
def __init__(self, **kwargs):
super(CheckNameAvailabilityInput, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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 CheckNameAvailabilityInput(Model):
"""Input of check name availability API.

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.

:param name: Required. The Search service name to validate. Search service
names must only contain lowercase letters, digits or dashes, cannot use
dash as the first two or last one characters, cannot contain consecutive
dashes, and must be between 2 and 60 characters in length.
:type name: str
:ivar type: Required. The type of the resource whose name is to be
validated. This value must always be 'searchServices'. Default value:
"searchServices" .
:vartype type: str
"""

_validation = {
'name': {'required': True},
'type': {'required': True, 'constant': True},
}

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
}

type = "searchServices"

def __init__(self, *, name: str, **kwargs) -> None:
super(CheckNameAvailabilityInput, self).__init__(**kwargs)
self.name = name
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ class CheckNameAvailabilityOutput(Model):
(incorrect length, unsupported characters, etc.). 'AlreadyExists'
indicates that the name is already in use and is therefore unavailable.
Possible values include: 'Invalid', 'AlreadyExists'
:vartype reason: str or :class:`UnavailableNameReason
<azure.mgmt.search.models.UnavailableNameReason>`
:vartype reason: str or ~azure.mgmt.search.models.UnavailableNameReason
:ivar message: A message that explains why the name is invalid and
provides resource naming requirements. Available only if 'Invalid' is
returned in the 'reason' property.
Expand All @@ -45,7 +44,8 @@ class CheckNameAvailabilityOutput(Model):
'message': {'key': 'message', 'type': 'str'},
}

def __init__(self):
def __init__(self, **kwargs):
super(CheckNameAvailabilityOutput, self).__init__(**kwargs)
self.is_name_available = None
self.reason = None
self.message = None
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# 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 CheckNameAvailabilityOutput(Model):
"""Output of check name availability API.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar is_name_available: A value indicating whether the name is available.
:vartype is_name_available: bool
:ivar reason: The reason why the name is not available. 'Invalid'
indicates the name provided does not match the naming requirements
(incorrect length, unsupported characters, etc.). 'AlreadyExists'
indicates that the name is already in use and is therefore unavailable.
Possible values include: 'Invalid', 'AlreadyExists'
:vartype reason: str or ~azure.mgmt.search.models.UnavailableNameReason
:ivar message: A message that explains why the name is invalid and
provides resource naming requirements. Available only if 'Invalid' is
returned in the 'reason' property.
:vartype message: str
"""

_validation = {
'is_name_available': {'readonly': True},
'reason': {'readonly': True},
'message': {'readonly': True},
}

_attribute_map = {
'is_name_available': {'key': 'nameAvailable', 'type': 'bool'},
'reason': {'key': 'reason', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
}

def __init__(self, **kwargs) -> None:
super(CheckNameAvailabilityOutput, self).__init__(**kwargs)
self.is_name_available = None
self.reason = None
self.message = None
41 changes: 41 additions & 0 deletions azure-mgmt-search/azure/mgmt/search/models/operation.py
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 Operation(Model):
"""Describes a REST API operation.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar name: The name of the operation. This name is of the form
{provider}/{resource}/{operation}.
:vartype name: str
:ivar display: The object that describes the operation.
:vartype display: ~azure.mgmt.search.models.OperationDisplay
"""

_validation = {
'name': {'readonly': True},
'display': {'readonly': True},
}

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'display': {'key': 'display', 'type': 'OperationDisplay'},
}

def __init__(self, **kwargs):
super(Operation, self).__init__(**kwargs)
self.name = None
self.display = None
Loading