From 3d89df88244f26e1c6c8c01a7b9840cf7b572df2 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Tue, 30 Jun 2020 03:23:49 +0000 Subject: [PATCH] Generated from 9eece7213c25d18ad24db77f4f148837c7d069ab Add api-version 2020-03-13 of search for go SDK --- sdk/search/azure-mgmt-search/README.md | 30 +- .../azure/mgmt/search/__init__.py | 7 +- .../azure/mgmt/search/_configuration.py | 50 + ...client.py => _search_management_client.py} | 65 +- .../azure/mgmt/search/models/__init__.py | 112 ++- .../azure/mgmt/search/models/_models.py | 933 ++++++++++++++++++ .../azure/mgmt/search/models/_models_py3.py | 933 ++++++++++++++++++ .../azure/mgmt/search/models/_paged_models.py | 92 ++ ....py => _search_management_client_enums.py} | 23 + .../mgmt/search/models/admin_key_result.py | 41 - .../search/models/admin_key_result_py3.py | 41 - .../models/check_name_availability_input.py | 48 - .../check_name_availability_input_py3.py | 48 - .../models/check_name_availability_output.py | 51 - .../check_name_availability_output_py3.py | 51 - .../azure/mgmt/search/models/identity.py | 48 - .../azure/mgmt/search/models/identity_py3.py | 48 - .../azure/mgmt/search/models/operation.py | 41 - .../mgmt/search/models/operation_display.py | 51 - .../search/models/operation_display_py3.py | 51 - .../mgmt/search/models/operation_paged.py | 27 - .../azure/mgmt/search/models/operation_py3.py | 41 - .../azure/mgmt/search/models/query_key.py | 41 - .../mgmt/search/models/query_key_paged.py | 27 - .../azure/mgmt/search/models/query_key_py3.py | 41 - .../azure/mgmt/search/models/resource.py | 61 -- .../azure/mgmt/search/models/resource_py3.py | 61 -- .../search_management_request_options.py | 30 - .../search_management_request_options_py3.py | 30 - .../mgmt/search/models/search_service.py | 124 --- .../search/models/search_service_paged.py | 27 - .../mgmt/search/models/search_service_py3.py | 124 --- .../azure/mgmt/search/models/sku.py | 39 - .../azure/mgmt/search/models/sku_py3.py | 39 - .../azure/mgmt/search/operations/__init__.py | 14 +- ...perations.py => _admin_keys_operations.py} | 18 +- .../{operations.py => _operations.py} | 20 +- ...private_endpoint_connections_operations.py | 374 +++++++ .../_private_link_resources_operations.py | 126 +++ ...perations.py => _query_keys_operations.py} | 38 +- ..._operations.py => _services_operations.py} | 61 +- ...hared_private_link_resources_operations.py | 368 +++++++ sdk/search/azure-mgmt-search/setup.py | 6 +- 43 files changed, 3105 insertions(+), 1396 deletions(-) create mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/_configuration.py rename sdk/search/azure-mgmt-search/azure/mgmt/search/{search_management_client.py => _search_management_client.py} (59%) create mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/_models.py create mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/_models_py3.py create mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/_paged_models.py rename sdk/search/azure-mgmt-search/azure/mgmt/search/models/{search_management_client_enums.py => _search_management_client_enums.py} (76%) delete mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/admin_key_result.py delete mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/admin_key_result_py3.py delete mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_input.py delete mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_input_py3.py delete mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_output.py delete mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_output_py3.py delete mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/identity.py delete mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/identity_py3.py delete mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/operation.py delete mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/operation_display.py delete mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/operation_display_py3.py delete mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/operation_paged.py delete mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/operation_py3.py delete mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/query_key.py delete mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/query_key_paged.py delete mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/query_key_py3.py delete mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/resource.py delete mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/resource_py3.py delete mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/search_management_request_options.py delete mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/search_management_request_options_py3.py delete mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/search_service.py delete mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/search_service_paged.py delete mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/search_service_py3.py delete mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/sku.py delete mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/models/sku_py3.py rename sdk/search/azure-mgmt-search/azure/mgmt/search/operations/{admin_keys_operations.py => _admin_keys_operations.py} (94%) rename sdk/search/azure-mgmt-search/azure/mgmt/search/operations/{operations.py => _operations.py} (87%) create mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/operations/_private_link_resources_operations.py rename sdk/search/azure-mgmt-search/azure/mgmt/search/operations/{query_keys_operations.py => _query_keys_operations.py} (92%) rename sdk/search/azure-mgmt-search/azure/mgmt/search/operations/{services_operations.py => _services_operations.py} (94%) create mode 100644 sdk/search/azure-mgmt-search/azure/mgmt/search/operations/_shared_private_link_resources_operations.py diff --git a/sdk/search/azure-mgmt-search/README.md b/sdk/search/azure-mgmt-search/README.md index 02415f8b873c..e99e53f45b12 100644 --- a/sdk/search/azure-mgmt-search/README.md +++ b/sdk/search/azure-mgmt-search/README.md @@ -1,29 +1,21 @@ -## Microsoft Azure SDK for Python +# Microsoft Azure SDK for Python This is the Microsoft Azure Search Management Client Library. +This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. +For a more complete view of Azure libraries, see the [Github repo](https://github.com/Azure/azure-sdk-for-python/) -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.4, 3.5, 3.6 and 3.7. +# Usage -For the older Azure Service Management (ASM) libraries, see -[azure-servicemanagement-legacy](https://pypi.python.org/pypi/azure-servicemanagement-legacy) -library. - -For a more complete set of Azure libraries, see the -[azure](https://pypi.python.org/pypi/azure) bundle package. - -## Usage - -For code examples, see [Search -Management](https://docs.microsoft.com/python/api/overview/azure/search) +For code examples, see [Search Management](https://docs.microsoft.com/python/api/overview/azure/search) on docs.microsoft.com. -## Provide Feedback -If you encounter any bugs or have suggestions, please file an issue in -the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) +# Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project. -![image](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-search%2FREADME.png) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-search%2FREADME.png) diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/__init__.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/__init__.py index 3c614360eda6..1663dcf1d993 100644 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/__init__.py +++ b/sdk/search/azure-mgmt-search/azure/mgmt/search/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .search_management_client import SearchManagementClient -from .version import VERSION +from ._configuration import SearchManagementClientConfiguration +from ._search_management_client import SearchManagementClient +__all__ = ['SearchManagementClient', 'SearchManagementClientConfiguration'] -__all__ = ['SearchManagementClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/_configuration.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/_configuration.py new file mode 100644 index 000000000000..20d91c5fae29 --- /dev/null +++ b/sdk/search/azure-mgmt-search/azure/mgmt/search/_configuration.py @@ -0,0 +1,50 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class SearchManagementClientConfiguration(AzureConfiguration): + """Configuration for SearchManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The unique identifier for a Microsoft Azure + subscription. You can obtain this value from the Azure Resource Manager + API or the portal. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(SearchManagementClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-search/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/search_management_client.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/_search_management_client.py similarity index 59% rename from sdk/search/azure-mgmt-search/azure/mgmt/search/search_management_client.py rename to sdk/search/azure-mgmt-search/azure/mgmt/search/_search_management_client.py index 9c86581dc538..64b4665602b1 100644 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/search_management_client.py +++ b/sdk/search/azure-mgmt-search/azure/mgmt/search/_search_management_client.py @@ -11,51 +11,20 @@ from msrest.service_client import SDKClient from msrest import Serializer, Deserializer -from msrestazure import AzureConfiguration -from .version import VERSION -from .operations.operations import Operations -from .operations.admin_keys_operations import AdminKeysOperations -from .operations.query_keys_operations import QueryKeysOperations -from .operations.services_operations import ServicesOperations -from . import models - - -class SearchManagementClientConfiguration(AzureConfiguration): - """Configuration for SearchManagementClient - Note that all parameters used to create this instance are saved as instance - attributes. - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: The unique identifier for a Microsoft Azure - subscription. You can obtain this value from the Azure Resource Manager - API or the portal. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' - - super(SearchManagementClientConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-mgmt-search/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id +from ._configuration import SearchManagementClientConfiguration +from .operations import Operations +from .operations import AdminKeysOperations +from .operations import QueryKeysOperations +from .operations import ServicesOperations +from .operations import PrivateLinkResourcesOperations +from .operations import PrivateEndpointConnectionsOperations +from .operations import SharedPrivateLinkResourcesOperations +from . import models class SearchManagementClient(SDKClient): - """Client that can be used to manage Azure Search services and API keys. + """Client that can be used to manage Azure Cognitive Search services and API keys. :ivar config: Configuration for client. :vartype config: SearchManagementClientConfiguration @@ -68,6 +37,12 @@ class SearchManagementClient(SDKClient): :vartype query_keys: azure.mgmt.search.operations.QueryKeysOperations :ivar services: Services operations :vartype services: azure.mgmt.search.operations.ServicesOperations + :ivar private_link_resources: PrivateLinkResources operations + :vartype private_link_resources: azure.mgmt.search.operations.PrivateLinkResourcesOperations + :ivar private_endpoint_connections: PrivateEndpointConnections operations + :vartype private_endpoint_connections: azure.mgmt.search.operations.PrivateEndpointConnectionsOperations + :ivar shared_private_link_resources: SharedPrivateLinkResources operations + :vartype shared_private_link_resources: azure.mgmt.search.operations.SharedPrivateLinkResourcesOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -86,7 +61,7 @@ def __init__( super(SearchManagementClient, 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 = '2015-08-19' + self.api_version = '2020-03-13' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -98,3 +73,9 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.services = ServicesOperations( self._client, self.config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.shared_private_link_resources = SharedPrivateLinkResourcesOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/__init__.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/__init__.py index d09b7141363d..9e1105dd06bf 100644 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/__init__.py +++ b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/__init__.py @@ -10,36 +10,66 @@ # -------------------------------------------------------------------------- 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 .identity_py3 import Identity - from .resource_py3 import Resource - from .operation_display_py3 import OperationDisplay - from .operation_py3 import Operation - from .search_management_request_options_py3 import SearchManagementRequestOptions + from ._models_py3 import AdminKeyResult + from ._models_py3 import CheckNameAvailabilityInput + from ._models_py3 import CheckNameAvailabilityOutput + from ._models_py3 import Identity + from ._models_py3 import IpRule + from ._models_py3 import NetworkRuleSet + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateEndpointConnectionProperties + from ._models_py3 import PrivateEndpointConnectionPropertiesPrivateEndpoint + from ._models_py3 import PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkResourceProperties + from ._models_py3 import QueryKey + from ._models_py3 import Resource + from ._models_py3 import SearchManagementRequestOptions + from ._models_py3 import SearchService + from ._models_py3 import ShareablePrivateLinkResourceProperties + from ._models_py3 import ShareablePrivateLinkResourceType + from ._models_py3 import SharedPrivateLinkResource + from ._models_py3 import SharedPrivateLinkResourceProperties + from ._models_py3 import Sku 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 .identity import Identity - 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 ( + from ._models import AdminKeyResult + from ._models import CheckNameAvailabilityInput + from ._models import CheckNameAvailabilityOutput + from ._models import Identity + from ._models import IpRule + from ._models import NetworkRuleSet + from ._models import Operation + from ._models import OperationDisplay + from ._models import PrivateEndpointConnection + from ._models import PrivateEndpointConnectionProperties + from ._models import PrivateEndpointConnectionPropertiesPrivateEndpoint + from ._models import PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState + from ._models import PrivateLinkResource + from ._models import PrivateLinkResourceProperties + from ._models import QueryKey + from ._models import Resource + from ._models import SearchManagementRequestOptions + from ._models import SearchService + from ._models import ShareablePrivateLinkResourceProperties + from ._models import ShareablePrivateLinkResourceType + from ._models import SharedPrivateLinkResource + from ._models import SharedPrivateLinkResourceProperties + from ._models import Sku +from ._paged_models import OperationPaged +from ._paged_models import PrivateEndpointConnectionPaged +from ._paged_models import PrivateLinkResourcePaged +from ._paged_models import QueryKeyPaged +from ._paged_models import SearchServicePaged +from ._paged_models import SharedPrivateLinkResourcePaged +from ._search_management_client_enums import ( UnavailableNameReason, SkuName, + PrivateLinkServiceConnectionStatus, + SharedPrivateLinkResourceStatus, HostingMode, + PublicNetworkAccess, SearchServiceStatus, ProvisioningState, IdentityType, @@ -47,23 +77,41 @@ ) __all__ = [ + 'AdminKeyResult', 'CheckNameAvailabilityInput', 'CheckNameAvailabilityOutput', - 'AdminKeyResult', - 'QueryKey', - 'Sku', - 'SearchService', 'Identity', - 'Resource', - 'OperationDisplay', + 'IpRule', + 'NetworkRuleSet', 'Operation', + 'OperationDisplay', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionProperties', + 'PrivateEndpointConnectionPropertiesPrivateEndpoint', + 'PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState', + 'PrivateLinkResource', + 'PrivateLinkResourceProperties', + 'QueryKey', + 'Resource', 'SearchManagementRequestOptions', + 'SearchService', + 'ShareablePrivateLinkResourceProperties', + 'ShareablePrivateLinkResourceType', + 'SharedPrivateLinkResource', + 'SharedPrivateLinkResourceProperties', + 'Sku', 'OperationPaged', 'QueryKeyPaged', 'SearchServicePaged', + 'PrivateLinkResourcePaged', + 'PrivateEndpointConnectionPaged', + 'SharedPrivateLinkResourcePaged', 'UnavailableNameReason', 'SkuName', + 'PrivateLinkServiceConnectionStatus', + 'SharedPrivateLinkResourceStatus', 'HostingMode', + 'PublicNetworkAccess', 'SearchServiceStatus', 'ProvisioningState', 'IdentityType', diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/_models.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/_models.py new file mode 100644 index 000000000000..69cf8d2aa2d7 --- /dev/null +++ b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/_models.py @@ -0,0 +1,933 @@ +# 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 AdminKeyResult(Model): + """Response containing the primary and secondary admin API keys for a given + Azure Cognitive 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): + super(AdminKeyResult, self).__init__(**kwargs) + self.primary_key = None + self.secondary_key = None + + +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, **kwargs): + super(CheckNameAvailabilityInput, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +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): + super(CheckNameAvailabilityOutput, self).__init__(**kwargs) + self.is_name_available = None + self.reason = None + self.message = None + + +class CloudError(Model): + """Contains information about an API error. + + :param error: Describes a particular API error with an error code and a + message. + :type error: ~azure.mgmt.search.models.CloudErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + } + + def __init__(self, **kwargs): + super(CloudError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CloudErrorBody(Model): + """Describes a particular API error with an error code and a message. + + :param code: An error code that describes the error condition more + precisely than an HTTP status code. Can be used to programmatically handle + specific error cases. + :type code: str + :param message: A message that describes the error in detail and provides + debugging information. + :type message: str + :param target: The target of the particular error (for example, the name + of the property in error). + :type target: str + :param details: Contains nested errors that are related to this error. + :type details: list[~azure.mgmt.search.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__(self, **kwargs): + super(CloudErrorBody, 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 Identity(Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: Required. The identity type. Possible values include: 'None', + 'SystemAssigned' + :type type: str or ~azure.mgmt.search.models.IdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'IdentityType'}, + } + + def __init__(self, **kwargs): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + + +class IpRule(Model): + """The IP restriction rule of the Azure Cognitive Search service. + + :param value: Value corresponding to a single IPv4 address (eg., + 123.1.2.3) or an IP range in CIDR format (eg., 123.1.2.3/24) to be + allowed. + :type value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IpRule, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class NetworkRuleSet(Model): + """Network specific rules that determine how the Azure Cognitive Search + service may be reached. + + :param ip_rules: A list of IP restriction rules that defines the inbound + network(s) with allowing access to the search service endpoint. At the + meantime, all other public IP networks are blocked by the firewall. These + restriction rules are applied only when the 'publicNetworkAccess' of the + search service is 'enabled'; otherwise, traffic over public interface is + not allowed even with any public IP rules, and private endpoint + connections would be the exclusive access method. + :type ip_rules: list[~azure.mgmt.search.models.IpRule] + """ + + _attribute_map = { + 'ip_rules': {'key': 'ipRules', 'type': '[IpRule]'}, + } + + def __init__(self, **kwargs): + super(NetworkRuleSet, self).__init__(**kwargs) + self.ip_rules = kwargs.get('ip_rules', None) + + +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 + + +class OperationDisplay(Model): + """The object that describes the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: The friendly name of the resource provider. + :vartype provider: str + :ivar operation: The operation type: read, write, delete, listKeys/action, + etc. + :vartype operation: str + :ivar resource: The resource type on which the operation is performed. + :vartype resource: str + :ivar description: The friendly name of the operation. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'operation': {'readonly': True}, + 'resource': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.operation = None + self.resource = None + self.description = None + + +class PrivateEndpointConnection(Model): + """Describes an existing Private Endpoint connection to the Azure Cognitive + Search service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ID of the private endpoint connection. This can be used with + the Azure Resource Manager to link resources together. + :vartype id: str + :ivar name: The name of the private endpoint connection. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param properties: Describes the properties of an existing Private + Endpoint connection to the Azure Cognitive Search service. + :type properties: + ~azure.mgmt.search.models.PrivateEndpointConnectionProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PrivateEndpointConnectionProperties'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = kwargs.get('properties', None) + + +class PrivateEndpointConnectionProperties(Model): + """Describes the properties of an existing Private Endpoint connection to the + Azure Cognitive Search service. + + :param private_endpoint: The private endpoint resource from + Microsoft.Network provider. + :type private_endpoint: + ~azure.mgmt.search.models.PrivateEndpointConnectionPropertiesPrivateEndpoint + :param private_link_service_connection_state: Describes the current state + of an existing Private Link Service connection to the Azure Private + Endpoint. + :type private_link_service_connection_state: + ~azure.mgmt.search.models.PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState + """ + + _attribute_map = { + 'private_endpoint': {'key': 'privateEndpoint', 'type': 'PrivateEndpointConnectionPropertiesPrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'privateLinkServiceConnectionState', 'type': 'PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpointConnectionProperties, self).__init__(**kwargs) + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + + +class PrivateEndpointConnectionPropertiesPrivateEndpoint(Model): + """The private endpoint resource from Microsoft.Network provider. + + :param id: The resource id of the private endpoint resource from + Microsoft.Network provider. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpointConnectionPropertiesPrivateEndpoint, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState(Model): + """Describes the current state of an existing Private Link Service connection + to the Azure Private Endpoint. + + :param status: Status of the the private link service connection. Can be + Pending, Approved, Rejected, or Disconnected. Possible values include: + 'Pending', 'Approved', 'Rejected', 'Disconnected' + :type status: str or + ~azure.mgmt.search.models.PrivateLinkServiceConnectionStatus + :param description: The description for the private link service + connection state. + :type description: str + :param actions_required: A description of any extra actions that may be + required. Default value: "None" . + :type actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'PrivateLinkServiceConnectionStatus'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.actions_required = kwargs.get('actions_required', "None") + + +class PrivateLinkResource(Model): + """Describes a supported private link resource for the Azure Cognitive Search + service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ID of the private link resource. + :vartype id: str + :ivar name: The name of the private link resource. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar properties: Describes the properties of a supported private link + resource for the Azure Cognitive Search service. + :vartype properties: + ~azure.mgmt.search.models.PrivateLinkResourceProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PrivateLinkResourceProperties'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = None + + +class PrivateLinkResourceProperties(Model): + """Describes the properties of a supported private link resource for the Azure + Cognitive Search service. For a given API version, this represents the + 'supported' groupIds when creating a shared private link resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar group_id: The group ID of the private link resource. + :vartype group_id: str + :ivar required_members: The list of required members of the private link + resource. + :vartype required_members: list[str] + :ivar required_zone_names: The list of required DNS zone names of the + private link resource. + :vartype required_zone_names: list[str] + :ivar shareable_private_link_resource_types: The list of resources that + are onboarded to private link service, that are supported by Azure + Cognitive Search. + :vartype shareable_private_link_resource_types: + list[~azure.mgmt.search.models.ShareablePrivateLinkResourceType] + """ + + _validation = { + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + 'required_zone_names': {'readonly': True}, + 'shareable_private_link_resource_types': {'readonly': True}, + } + + _attribute_map = { + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'requiredZoneNames', 'type': '[str]'}, + 'shareable_private_link_resource_types': {'key': 'shareablePrivateLinkResourceTypes', 'type': '[ShareablePrivateLinkResourceType]'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkResourceProperties, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = None + self.shareable_private_link_resource_types = None + + +class QueryKey(Model): + """Describes an API key for a given Azure Cognitive Search service that has + permissions for query operations only. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the query API key; may be empty. + :vartype name: str + :ivar key: The value of the query API key. + :vartype key: str + """ + + _validation = { + 'name': {'readonly': True}, + 'key': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(QueryKey, self).__init__(**kwargs) + self.name = None + self.key = None + + +class Resource(Model): + """Base type for all Azure resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ID of the resource. This can be used with the Azure Resource + Manager to link resources together. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param location: The geographic location of the resource. This must be one + of the supported and registered Azure Geo Regions (for example, West US, + East US, Southeast Asia, and so forth). This property is required when + creating a new resource. + :type location: str + :param tags: Tags to help categorize the resource in the Azure portal. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.search.models.Identity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + + +class SearchManagementRequestOptions(Model): + """Additional parameters for a set of operations. + + :param client_request_id: A client-generated GUID value that identifies + this request. If specified, this will be included in response information + as a way to track the request. + :type client_request_id: str + """ + + _attribute_map = { + 'client_request_id': {'key': '', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SearchManagementRequestOptions, self).__init__(**kwargs) + self.client_request_id = kwargs.get('client_request_id', None) + + +class SearchService(Resource): + """Describes an Azure Cognitive Search service and its current state. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ID of the resource. This can be used with the Azure Resource + Manager to link resources together. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param location: The geographic location of the resource. This must be one + of the supported and registered Azure Geo Regions (for example, West US, + East US, Southeast Asia, and so forth). This property is required when + creating a new resource. + :type location: str + :param tags: Tags to help categorize the resource in the Azure portal. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.search.models.Identity + :param replica_count: The number of replicas in the Search service. If + specified, it must be a value between 1 and 12 inclusive for standard SKUs + or between 1 and 3 inclusive for basic SKU. Default value: 1 . + :type replica_count: int + :param partition_count: The number of partitions in the Search service; if + specified, it can be 1, 2, 3, 4, 6, or 12. Values greater than 1 are only + valid for standard SKUs. For 'standard3' services with hostingMode set to + 'highDensity', the allowed values are between 1 and 3. Default value: 1 . + :type partition_count: int + :param hosting_mode: Applicable only for the standard3 SKU. You can set + this property to enable up to 3 high density partitions that allow up to + 1000 indexes, which is much higher than the maximum indexes allowed for + any other SKU. For the standard3 SKU, the value is either 'default' or + 'highDensity'. For all other SKUs, this value must be 'default'. Possible + values include: 'default', 'highDensity'. Default value: "default" . + :type hosting_mode: str or ~azure.mgmt.search.models.HostingMode + :param public_network_access: This value can be set to 'enabled' to avoid + breaking changes on existing customer resources and templates. If set to + 'disabled', traffic over public interface is not allowed, and private + endpoint connections would be the exclusive access method. Possible values + include: 'enabled', 'disabled'. Default value: "enabled" . + :type public_network_access: str or + ~azure.mgmt.search.models.PublicNetworkAccess + :ivar status: The status of the Search service. Possible values include: + 'running': The Search service is running and no provisioning operations + are underway. 'provisioning': The Search service is being provisioned or + scaled up or down. 'deleting': The Search service is being deleted. + 'degraded': The Search service is degraded. This can occur when the + underlying search units are not healthy. The Search service is most likely + operational, but performance might be slow and some requests might be + dropped. 'disabled': The Search service is disabled. In this state, the + service will reject all API requests. 'error': The Search service is in an + error state. If your service is in the degraded, disabled, or error + states, it means the Azure Cognitive Search team is actively investigating + the underlying issue. Dedicated services in these states are still + chargeable based on the number of search units provisioned. Possible + values include: 'running', 'provisioning', 'deleting', 'degraded', + 'disabled', 'error' + :vartype status: str or ~azure.mgmt.search.models.SearchServiceStatus + :ivar status_details: The details of the Search service status. + :vartype status_details: str + :ivar provisioning_state: The state of the last provisioning operation + performed on the Search service. Provisioning is an intermediate state + that occurs while service capacity is being established. After capacity is + set up, provisioningState changes to either 'succeeded' or 'failed'. + Client applications can poll provisioning status (the recommended polling + interval is from 30 seconds to one minute) by using the Get Search Service + operation to see when an operation is completed. If you are using the free + service, this value tends to come back as 'succeeded' directly in the call + to Create Search service. This is because the free service uses capacity + that is already set up. Possible values include: 'succeeded', + 'provisioning', 'failed' + :vartype provisioning_state: str or + ~azure.mgmt.search.models.ProvisioningState + :param network_rule_set: Network specific rules that determine how the + Azure Cognitive Search service may be reached. + :type network_rule_set: ~azure.mgmt.search.models.NetworkRuleSet + :ivar private_endpoint_connections: The list of private endpoint + connections to the Azure Cognitive Search service. + :vartype private_endpoint_connections: + list[~azure.mgmt.search.models.PrivateEndpointConnection] + :ivar shared_private_link_resources: The list of shared private link + resources managed by the Azure Cognitive Search service. + :vartype shared_private_link_resources: + list[~azure.mgmt.search.models.SharedPrivateLinkResource] + :param sku: The SKU of the Search Service, which determines price tier and + capacity limits. This property is required when creating a new Search + Service. + :type sku: ~azure.mgmt.search.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'replica_count': {'maximum': 12, 'minimum': 1}, + 'partition_count': {'maximum': 12, 'minimum': 1}, + 'status': {'readonly': True}, + 'status_details': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'shared_private_link_resources': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'replica_count': {'key': 'properties.replicaCount', 'type': 'int'}, + 'partition_count': {'key': 'properties.partitionCount', 'type': 'int'}, + 'hosting_mode': {'key': 'properties.hostingMode', 'type': 'HostingMode'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'PublicNetworkAccess'}, + 'status': {'key': 'properties.status', 'type': 'SearchServiceStatus'}, + 'status_details': {'key': 'properties.statusDetails', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, **kwargs): + super(SearchService, self).__init__(**kwargs) + self.replica_count = kwargs.get('replica_count', 1) + self.partition_count = kwargs.get('partition_count', 1) + self.hosting_mode = kwargs.get('hosting_mode', "default") + self.public_network_access = kwargs.get('public_network_access', "enabled") + self.status = None + self.status_details = None + self.provisioning_state = None + self.network_rule_set = kwargs.get('network_rule_set', None) + self.private_endpoint_connections = None + self.shared_private_link_resources = None + self.sku = kwargs.get('sku', None) + + +class ShareablePrivateLinkResourceProperties(Model): + """Describes the properties of a resource type that has been onboarded to + private link service, supported by Azure Cognitive Search. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The resource provider type for the resource that has been + onboarded to private link service, supported by Azure Cognitive Search. + :vartype type: str + :ivar group_id: The resource provider group id for the resource that has + been onboarded to private link service, supported by Azure Cognitive + Search. + :vartype group_id: str + :ivar description: The description of the resource type that has been + onboarded to private link service, supported by Azure Cognitive Search. + :vartype description: str + """ + + _validation = { + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ShareablePrivateLinkResourceProperties, self).__init__(**kwargs) + self.type = None + self.group_id = None + self.description = None + + +class ShareablePrivateLinkResourceType(Model): + """Describes an resource type that has been onboarded to private link service, + supported by Azure Cognitive Search. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the resource type that has been onboarded to + private link service, supported by Azure Cognitive Search. + :vartype name: str + :ivar properties: Describes the properties of a resource type that has + been onboarded to private link service, supported by Azure Cognitive + Search. + :vartype properties: + ~azure.mgmt.search.models.ShareablePrivateLinkResourceProperties + """ + + _validation = { + 'name': {'readonly': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ShareablePrivateLinkResourceProperties'}, + } + + def __init__(self, **kwargs): + super(ShareablePrivateLinkResourceType, self).__init__(**kwargs) + self.name = None + self.properties = None + + +class SharedPrivateLinkResource(Model): + """Describes a Shared Private Link Resource managed by the Azure Cognitive + Search service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the shared private link resource. + :vartype name: str + :ivar id: The ID of the shared private link resource. + :vartype id: str + :ivar type: The resource type. + :vartype type: str + :param properties: Describes the properties of a Shared Private Link + Resource managed by the Azure Cognitive Search service. + :type properties: + ~azure.mgmt.search.models.SharedPrivateLinkResourceProperties + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'SharedPrivateLinkResourceProperties'}, + } + + def __init__(self, **kwargs): + super(SharedPrivateLinkResource, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.properties = kwargs.get('properties', None) + + +class SharedPrivateLinkResourceProperties(Model): + """Describes the properties of an existing Shared Private Link Resource + managed by the Azure Cognitive Search service. + + :param private_link_resource_id: The resource id of the resource the + shared private link resource is for. + :type private_link_resource_id: str + :param group_id: The group id from the provider of resource the shared + private link resource is for. + :type group_id: str + :param request_message: The request message for requesting approval of the + shared private link resource. + :type request_message: str + :param status: Status of the shared private link resource. Can be Pending, + Approved, Rejected, Disconnected, or Timeout. Possible values include: + 'Pending', 'Approved', 'Rejected', 'Disconnected', 'Timeout' + :type status: str or + ~azure.mgmt.search.models.SharedPrivateLinkResourceStatus + """ + + _attribute_map = { + 'private_link_resource_id': {'key': 'privateLinkResourceId', 'type': 'str'}, + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'request_message': {'key': 'requestMessage', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'SharedPrivateLinkResourceStatus'}, + } + + def __init__(self, **kwargs): + super(SharedPrivateLinkResourceProperties, self).__init__(**kwargs) + self.private_link_resource_id = kwargs.get('private_link_resource_id', None) + self.group_id = kwargs.get('group_id', None) + self.request_message = kwargs.get('request_message', None) + self.status = kwargs.get('status', None) + + +class Sku(Model): + """Defines the SKU of an Azure Cognitive Search Service, which determines + price tier and capacity limits. + + :param name: The SKU of the Search service. Valid values include: 'free': + Shared service. 'basic': Dedicated service with up to 3 replicas. + 'standard': Dedicated service with up to 12 partitions and 12 replicas. + 'standard2': Similar to standard, but with more capacity per search unit. + 'standard3': The largest Standard offering with up to 12 partitions and 12 + replicas (or up to 3 partitions with more indexes if you also set the + hostingMode property to 'highDensity'). 'storage_optimized_l1': Supports + 1TB per partition, up to 12 partitions. 'storage_optimized_l2': Supports + 2TB per partition, up to 12 partitions.'. Possible values include: 'free', + 'basic', 'standard', 'standard2', 'standard3', 'storage_optimized_l1', + 'storage_optimized_l2' + :type name: str or ~azure.mgmt.search.models.SkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/_models_py3.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/_models_py3.py new file mode 100644 index 000000000000..efade980e0dc --- /dev/null +++ b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/_models_py3.py @@ -0,0 +1,933 @@ +# 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 AdminKeyResult(Model): + """Response containing the primary and secondary admin API keys for a given + Azure Cognitive 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 + + +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 + + +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 + + +class CloudError(Model): + """Contains information about an API error. + + :param error: Describes a particular API error with an error code and a + message. + :type error: ~azure.mgmt.search.models.CloudErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(CloudError, self).__init__(**kwargs) + self.error = error + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CloudErrorBody(Model): + """Describes a particular API error with an error code and a message. + + :param code: An error code that describes the error condition more + precisely than an HTTP status code. Can be used to programmatically handle + specific error cases. + :type code: str + :param message: A message that describes the error in detail and provides + debugging information. + :type message: str + :param target: The target of the particular error (for example, the name + of the property in error). + :type target: str + :param details: Contains nested errors that are related to this error. + :type details: list[~azure.mgmt.search.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + super(CloudErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class Identity(Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: Required. The identity type. Possible values include: 'None', + 'SystemAssigned' + :type type: str or ~azure.mgmt.search.models.IdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'IdentityType'}, + } + + def __init__(self, *, type, **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + + +class IpRule(Model): + """The IP restriction rule of the Azure Cognitive Search service. + + :param value: Value corresponding to a single IPv4 address (eg., + 123.1.2.3) or an IP range in CIDR format (eg., 123.1.2.3/24) to be + allowed. + :type value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, **kwargs) -> None: + super(IpRule, self).__init__(**kwargs) + self.value = value + + +class NetworkRuleSet(Model): + """Network specific rules that determine how the Azure Cognitive Search + service may be reached. + + :param ip_rules: A list of IP restriction rules that defines the inbound + network(s) with allowing access to the search service endpoint. At the + meantime, all other public IP networks are blocked by the firewall. These + restriction rules are applied only when the 'publicNetworkAccess' of the + search service is 'enabled'; otherwise, traffic over public interface is + not allowed even with any public IP rules, and private endpoint + connections would be the exclusive access method. + :type ip_rules: list[~azure.mgmt.search.models.IpRule] + """ + + _attribute_map = { + 'ip_rules': {'key': 'ipRules', 'type': '[IpRule]'}, + } + + def __init__(self, *, ip_rules=None, **kwargs) -> None: + super(NetworkRuleSet, self).__init__(**kwargs) + self.ip_rules = ip_rules + + +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) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = None + + +class OperationDisplay(Model): + """The object that describes the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: The friendly name of the resource provider. + :vartype provider: str + :ivar operation: The operation type: read, write, delete, listKeys/action, + etc. + :vartype operation: str + :ivar resource: The resource type on which the operation is performed. + :vartype resource: str + :ivar description: The friendly name of the operation. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'operation': {'readonly': True}, + 'resource': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.operation = None + self.resource = None + self.description = None + + +class PrivateEndpointConnection(Model): + """Describes an existing Private Endpoint connection to the Azure Cognitive + Search service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ID of the private endpoint connection. This can be used with + the Azure Resource Manager to link resources together. + :vartype id: str + :ivar name: The name of the private endpoint connection. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param properties: Describes the properties of an existing Private + Endpoint connection to the Azure Cognitive Search service. + :type properties: + ~azure.mgmt.search.models.PrivateEndpointConnectionProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PrivateEndpointConnectionProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = properties + + +class PrivateEndpointConnectionProperties(Model): + """Describes the properties of an existing Private Endpoint connection to the + Azure Cognitive Search service. + + :param private_endpoint: The private endpoint resource from + Microsoft.Network provider. + :type private_endpoint: + ~azure.mgmt.search.models.PrivateEndpointConnectionPropertiesPrivateEndpoint + :param private_link_service_connection_state: Describes the current state + of an existing Private Link Service connection to the Azure Private + Endpoint. + :type private_link_service_connection_state: + ~azure.mgmt.search.models.PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState + """ + + _attribute_map = { + 'private_endpoint': {'key': 'privateEndpoint', 'type': 'PrivateEndpointConnectionPropertiesPrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'privateLinkServiceConnectionState', 'type': 'PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState'}, + } + + def __init__(self, *, private_endpoint=None, private_link_service_connection_state=None, **kwargs) -> None: + super(PrivateEndpointConnectionProperties, self).__init__(**kwargs) + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + + +class PrivateEndpointConnectionPropertiesPrivateEndpoint(Model): + """The private endpoint resource from Microsoft.Network provider. + + :param id: The resource id of the private endpoint resource from + Microsoft.Network provider. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(PrivateEndpointConnectionPropertiesPrivateEndpoint, self).__init__(**kwargs) + self.id = id + + +class PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState(Model): + """Describes the current state of an existing Private Link Service connection + to the Azure Private Endpoint. + + :param status: Status of the the private link service connection. Can be + Pending, Approved, Rejected, or Disconnected. Possible values include: + 'Pending', 'Approved', 'Rejected', 'Disconnected' + :type status: str or + ~azure.mgmt.search.models.PrivateLinkServiceConnectionStatus + :param description: The description for the private link service + connection state. + :type description: str + :param actions_required: A description of any extra actions that may be + required. Default value: "None" . + :type actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'PrivateLinkServiceConnectionStatus'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__(self, *, status=None, description: str=None, actions_required: str="None", **kwargs) -> None: + super(PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = actions_required + + +class PrivateLinkResource(Model): + """Describes a supported private link resource for the Azure Cognitive Search + service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ID of the private link resource. + :vartype id: str + :ivar name: The name of the private link resource. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar properties: Describes the properties of a supported private link + resource for the Azure Cognitive Search service. + :vartype properties: + ~azure.mgmt.search.models.PrivateLinkResourceProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PrivateLinkResourceProperties'}, + } + + def __init__(self, **kwargs) -> None: + super(PrivateLinkResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = None + + +class PrivateLinkResourceProperties(Model): + """Describes the properties of a supported private link resource for the Azure + Cognitive Search service. For a given API version, this represents the + 'supported' groupIds when creating a shared private link resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar group_id: The group ID of the private link resource. + :vartype group_id: str + :ivar required_members: The list of required members of the private link + resource. + :vartype required_members: list[str] + :ivar required_zone_names: The list of required DNS zone names of the + private link resource. + :vartype required_zone_names: list[str] + :ivar shareable_private_link_resource_types: The list of resources that + are onboarded to private link service, that are supported by Azure + Cognitive Search. + :vartype shareable_private_link_resource_types: + list[~azure.mgmt.search.models.ShareablePrivateLinkResourceType] + """ + + _validation = { + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + 'required_zone_names': {'readonly': True}, + 'shareable_private_link_resource_types': {'readonly': True}, + } + + _attribute_map = { + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'requiredZoneNames', 'type': '[str]'}, + 'shareable_private_link_resource_types': {'key': 'shareablePrivateLinkResourceTypes', 'type': '[ShareablePrivateLinkResourceType]'}, + } + + def __init__(self, **kwargs) -> None: + super(PrivateLinkResourceProperties, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = None + self.shareable_private_link_resource_types = None + + +class QueryKey(Model): + """Describes an API key for a given Azure Cognitive Search service that has + permissions for query operations only. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the query API key; may be empty. + :vartype name: str + :ivar key: The value of the query API key. + :vartype key: str + """ + + _validation = { + 'name': {'readonly': True}, + 'key': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(QueryKey, self).__init__(**kwargs) + self.name = None + self.key = None + + +class Resource(Model): + """Base type for all Azure resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ID of the resource. This can be used with the Azure Resource + Manager to link resources together. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param location: The geographic location of the resource. This must be one + of the supported and registered Azure Geo Regions (for example, West US, + East US, Southeast Asia, and so forth). This property is required when + creating a new resource. + :type location: str + :param tags: Tags to help categorize the resource in the Azure portal. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.search.models.Identity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + } + + def __init__(self, *, location: str=None, tags=None, identity=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + self.identity = identity + + +class SearchManagementRequestOptions(Model): + """Additional parameters for a set of operations. + + :param client_request_id: A client-generated GUID value that identifies + this request. If specified, this will be included in response information + as a way to track the request. + :type client_request_id: str + """ + + _attribute_map = { + 'client_request_id': {'key': '', 'type': 'str'}, + } + + def __init__(self, *, client_request_id: str=None, **kwargs) -> None: + super(SearchManagementRequestOptions, self).__init__(**kwargs) + self.client_request_id = client_request_id + + +class SearchService(Resource): + """Describes an Azure Cognitive Search service and its current state. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ID of the resource. This can be used with the Azure Resource + Manager to link resources together. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :param location: The geographic location of the resource. This must be one + of the supported and registered Azure Geo Regions (for example, West US, + East US, Southeast Asia, and so forth). This property is required when + creating a new resource. + :type location: str + :param tags: Tags to help categorize the resource in the Azure portal. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.search.models.Identity + :param replica_count: The number of replicas in the Search service. If + specified, it must be a value between 1 and 12 inclusive for standard SKUs + or between 1 and 3 inclusive for basic SKU. Default value: 1 . + :type replica_count: int + :param partition_count: The number of partitions in the Search service; if + specified, it can be 1, 2, 3, 4, 6, or 12. Values greater than 1 are only + valid for standard SKUs. For 'standard3' services with hostingMode set to + 'highDensity', the allowed values are between 1 and 3. Default value: 1 . + :type partition_count: int + :param hosting_mode: Applicable only for the standard3 SKU. You can set + this property to enable up to 3 high density partitions that allow up to + 1000 indexes, which is much higher than the maximum indexes allowed for + any other SKU. For the standard3 SKU, the value is either 'default' or + 'highDensity'. For all other SKUs, this value must be 'default'. Possible + values include: 'default', 'highDensity'. Default value: "default" . + :type hosting_mode: str or ~azure.mgmt.search.models.HostingMode + :param public_network_access: This value can be set to 'enabled' to avoid + breaking changes on existing customer resources and templates. If set to + 'disabled', traffic over public interface is not allowed, and private + endpoint connections would be the exclusive access method. Possible values + include: 'enabled', 'disabled'. Default value: "enabled" . + :type public_network_access: str or + ~azure.mgmt.search.models.PublicNetworkAccess + :ivar status: The status of the Search service. Possible values include: + 'running': The Search service is running and no provisioning operations + are underway. 'provisioning': The Search service is being provisioned or + scaled up or down. 'deleting': The Search service is being deleted. + 'degraded': The Search service is degraded. This can occur when the + underlying search units are not healthy. The Search service is most likely + operational, but performance might be slow and some requests might be + dropped. 'disabled': The Search service is disabled. In this state, the + service will reject all API requests. 'error': The Search service is in an + error state. If your service is in the degraded, disabled, or error + states, it means the Azure Cognitive Search team is actively investigating + the underlying issue. Dedicated services in these states are still + chargeable based on the number of search units provisioned. Possible + values include: 'running', 'provisioning', 'deleting', 'degraded', + 'disabled', 'error' + :vartype status: str or ~azure.mgmt.search.models.SearchServiceStatus + :ivar status_details: The details of the Search service status. + :vartype status_details: str + :ivar provisioning_state: The state of the last provisioning operation + performed on the Search service. Provisioning is an intermediate state + that occurs while service capacity is being established. After capacity is + set up, provisioningState changes to either 'succeeded' or 'failed'. + Client applications can poll provisioning status (the recommended polling + interval is from 30 seconds to one minute) by using the Get Search Service + operation to see when an operation is completed. If you are using the free + service, this value tends to come back as 'succeeded' directly in the call + to Create Search service. This is because the free service uses capacity + that is already set up. Possible values include: 'succeeded', + 'provisioning', 'failed' + :vartype provisioning_state: str or + ~azure.mgmt.search.models.ProvisioningState + :param network_rule_set: Network specific rules that determine how the + Azure Cognitive Search service may be reached. + :type network_rule_set: ~azure.mgmt.search.models.NetworkRuleSet + :ivar private_endpoint_connections: The list of private endpoint + connections to the Azure Cognitive Search service. + :vartype private_endpoint_connections: + list[~azure.mgmt.search.models.PrivateEndpointConnection] + :ivar shared_private_link_resources: The list of shared private link + resources managed by the Azure Cognitive Search service. + :vartype shared_private_link_resources: + list[~azure.mgmt.search.models.SharedPrivateLinkResource] + :param sku: The SKU of the Search Service, which determines price tier and + capacity limits. This property is required when creating a new Search + Service. + :type sku: ~azure.mgmt.search.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'replica_count': {'maximum': 12, 'minimum': 1}, + 'partition_count': {'maximum': 12, 'minimum': 1}, + 'status': {'readonly': True}, + 'status_details': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'shared_private_link_resources': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'replica_count': {'key': 'properties.replicaCount', 'type': 'int'}, + 'partition_count': {'key': 'properties.partitionCount', 'type': 'int'}, + 'hosting_mode': {'key': 'properties.hostingMode', 'type': 'HostingMode'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'PublicNetworkAccess'}, + 'status': {'key': 'properties.status', 'type': 'SearchServiceStatus'}, + 'status_details': {'key': 'properties.statusDetails', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, *, location: str=None, tags=None, identity=None, replica_count: int=1, partition_count: int=1, hosting_mode="default", public_network_access="enabled", network_rule_set=None, sku=None, **kwargs) -> None: + super(SearchService, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + self.replica_count = replica_count + self.partition_count = partition_count + self.hosting_mode = hosting_mode + self.public_network_access = public_network_access + self.status = None + self.status_details = None + self.provisioning_state = None + self.network_rule_set = network_rule_set + self.private_endpoint_connections = None + self.shared_private_link_resources = None + self.sku = sku + + +class ShareablePrivateLinkResourceProperties(Model): + """Describes the properties of a resource type that has been onboarded to + private link service, supported by Azure Cognitive Search. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The resource provider type for the resource that has been + onboarded to private link service, supported by Azure Cognitive Search. + :vartype type: str + :ivar group_id: The resource provider group id for the resource that has + been onboarded to private link service, supported by Azure Cognitive + Search. + :vartype group_id: str + :ivar description: The description of the resource type that has been + onboarded to private link service, supported by Azure Cognitive Search. + :vartype description: str + """ + + _validation = { + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ShareablePrivateLinkResourceProperties, self).__init__(**kwargs) + self.type = None + self.group_id = None + self.description = None + + +class ShareablePrivateLinkResourceType(Model): + """Describes an resource type that has been onboarded to private link service, + supported by Azure Cognitive Search. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the resource type that has been onboarded to + private link service, supported by Azure Cognitive Search. + :vartype name: str + :ivar properties: Describes the properties of a resource type that has + been onboarded to private link service, supported by Azure Cognitive + Search. + :vartype properties: + ~azure.mgmt.search.models.ShareablePrivateLinkResourceProperties + """ + + _validation = { + 'name': {'readonly': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ShareablePrivateLinkResourceProperties'}, + } + + def __init__(self, **kwargs) -> None: + super(ShareablePrivateLinkResourceType, self).__init__(**kwargs) + self.name = None + self.properties = None + + +class SharedPrivateLinkResource(Model): + """Describes a Shared Private Link Resource managed by the Azure Cognitive + Search service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the shared private link resource. + :vartype name: str + :ivar id: The ID of the shared private link resource. + :vartype id: str + :ivar type: The resource type. + :vartype type: str + :param properties: Describes the properties of a Shared Private Link + Resource managed by the Azure Cognitive Search service. + :type properties: + ~azure.mgmt.search.models.SharedPrivateLinkResourceProperties + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'SharedPrivateLinkResourceProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(SharedPrivateLinkResource, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.properties = properties + + +class SharedPrivateLinkResourceProperties(Model): + """Describes the properties of an existing Shared Private Link Resource + managed by the Azure Cognitive Search service. + + :param private_link_resource_id: The resource id of the resource the + shared private link resource is for. + :type private_link_resource_id: str + :param group_id: The group id from the provider of resource the shared + private link resource is for. + :type group_id: str + :param request_message: The request message for requesting approval of the + shared private link resource. + :type request_message: str + :param status: Status of the shared private link resource. Can be Pending, + Approved, Rejected, Disconnected, or Timeout. Possible values include: + 'Pending', 'Approved', 'Rejected', 'Disconnected', 'Timeout' + :type status: str or + ~azure.mgmt.search.models.SharedPrivateLinkResourceStatus + """ + + _attribute_map = { + 'private_link_resource_id': {'key': 'privateLinkResourceId', 'type': 'str'}, + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'request_message': {'key': 'requestMessage', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'SharedPrivateLinkResourceStatus'}, + } + + def __init__(self, *, private_link_resource_id: str=None, group_id: str=None, request_message: str=None, status=None, **kwargs) -> None: + super(SharedPrivateLinkResourceProperties, self).__init__(**kwargs) + self.private_link_resource_id = private_link_resource_id + self.group_id = group_id + self.request_message = request_message + self.status = status + + +class Sku(Model): + """Defines the SKU of an Azure Cognitive Search Service, which determines + price tier and capacity limits. + + :param name: The SKU of the Search service. Valid values include: 'free': + Shared service. 'basic': Dedicated service with up to 3 replicas. + 'standard': Dedicated service with up to 12 partitions and 12 replicas. + 'standard2': Similar to standard, but with more capacity per search unit. + 'standard3': The largest Standard offering with up to 12 partitions and 12 + replicas (or up to 3 partitions with more indexes if you also set the + hostingMode property to 'highDensity'). 'storage_optimized_l1': Supports + 1TB per partition, up to 12 partitions. 'storage_optimized_l2': Supports + 2TB per partition, up to 12 partitions.'. Possible values include: 'free', + 'basic', 'standard', 'standard2', 'standard3', 'storage_optimized_l1', + 'storage_optimized_l2' + :type name: str or ~azure.mgmt.search.models.SkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + } + + def __init__(self, *, name=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/_paged_models.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/_paged_models.py new file mode 100644 index 000000000000..09c08af3b5a2 --- /dev/null +++ b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/_paged_models.py @@ -0,0 +1,92 @@ +# 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.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) +class QueryKeyPaged(Paged): + """ + A paging container for iterating over a list of :class:`QueryKey ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[QueryKey]'} + } + + def __init__(self, *args, **kwargs): + + super(QueryKeyPaged, self).__init__(*args, **kwargs) +class SearchServicePaged(Paged): + """ + A paging container for iterating over a list of :class:`SearchService ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SearchService]'} + } + + def __init__(self, *args, **kwargs): + + super(SearchServicePaged, self).__init__(*args, **kwargs) +class PrivateLinkResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`PrivateLinkResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PrivateLinkResource]'} + } + + def __init__(self, *args, **kwargs): + + super(PrivateLinkResourcePaged, self).__init__(*args, **kwargs) +class PrivateEndpointConnectionPaged(Paged): + """ + A paging container for iterating over a list of :class:`PrivateEndpointConnection ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PrivateEndpointConnection]'} + } + + def __init__(self, *args, **kwargs): + + super(PrivateEndpointConnectionPaged, self).__init__(*args, **kwargs) +class SharedPrivateLinkResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`SharedPrivateLinkResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SharedPrivateLinkResource]'} + } + + def __init__(self, *args, **kwargs): + + super(SharedPrivateLinkResourcePaged, self).__init__(*args, **kwargs) diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/search_management_client_enums.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/_search_management_client_enums.py similarity index 76% rename from sdk/search/azure-mgmt-search/azure/mgmt/search/models/search_management_client_enums.py rename to sdk/search/azure-mgmt-search/azure/mgmt/search/models/_search_management_client_enums.py index cf76e9f19b0d..62b7a3ec4c52 100644 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/search_management_client_enums.py +++ b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/_search_management_client_enums.py @@ -29,12 +29,35 @@ class SkuName(str, Enum): storage_optimized_l2 = "storage_optimized_l2" +class PrivateLinkServiceConnectionStatus(str, Enum): + + pending = "Pending" + approved = "Approved" + rejected = "Rejected" + disconnected = "Disconnected" + + +class SharedPrivateLinkResourceStatus(str, Enum): + + pending = "Pending" + approved = "Approved" + rejected = "Rejected" + disconnected = "Disconnected" + timeout = "Timeout" + + class HostingMode(str, Enum): default = "default" high_density = "highDensity" +class PublicNetworkAccess(str, Enum): + + enabled = "enabled" + disabled = "disabled" + + class SearchServiceStatus(str, Enum): running = "running" diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/admin_key_result.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/admin_key_result.py deleted file mode 100644 index bfeabe50e70e..000000000000 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/admin_key_result.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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): - super(AdminKeyResult, self).__init__(**kwargs) - self.primary_key = None - self.secondary_key = None diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/admin_key_result_py3.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/admin_key_result_py3.py deleted file mode 100644 index 29217db297ce..000000000000 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/admin_key_result_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_input.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_input.py deleted file mode 100644 index 053e06fd8f43..000000000000 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_input.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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, **kwargs): - super(CheckNameAvailabilityInput, self).__init__(**kwargs) - self.name = kwargs.get('name', None) diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_input_py3.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_input_py3.py deleted file mode 100644 index 012969c50154..000000000000 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_input_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_output.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_output.py deleted file mode 100644 index 12b592e51574..000000000000 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_output.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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): - super(CheckNameAvailabilityOutput, self).__init__(**kwargs) - self.is_name_available = None - self.reason = None - self.message = None diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_output_py3.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_output_py3.py deleted file mode 100644 index bbffe7f214e1..000000000000 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_output_py3.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/identity.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/identity.py deleted file mode 100644 index 5d6912d964ce..000000000000 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/identity.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 Identity(Model): - """Identity for the resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :param type: Required. The identity type. Possible values include: 'None', - 'SystemAssigned' - :type type: str or ~azure.mgmt.search.models.IdentityType - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'IdentityType'}, - } - - def __init__(self, **kwargs): - super(Identity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/identity_py3.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/identity_py3.py deleted file mode 100644 index 61d3064568ae..000000000000 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/identity_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 Identity(Model): - """Identity for the resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :param type: Required. The identity type. Possible values include: 'None', - 'SystemAssigned' - :type type: str or ~azure.mgmt.search.models.IdentityType - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'IdentityType'}, - } - - def __init__(self, *, type, **kwargs) -> None: - super(Identity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = type diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/operation.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/operation.py deleted file mode 100644 index 7269ad98e425..000000000000 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/operation.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/operation_display.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/operation_display.py deleted file mode 100644 index 0c4d5975dc8d..000000000000 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/operation_display.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 OperationDisplay(Model): - """The object that describes the operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar provider: The friendly name of the resource provider. - :vartype provider: str - :ivar operation: The operation type: read, write, delete, listKeys/action, - etc. - :vartype operation: str - :ivar resource: The resource type on which the operation is performed. - :vartype resource: str - :ivar description: The friendly name of the operation. - :vartype description: str - """ - - _validation = { - 'provider': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(OperationDisplay, self).__init__(**kwargs) - self.provider = None - self.operation = None - self.resource = None - self.description = None diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/operation_display_py3.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/operation_display_py3.py deleted file mode 100644 index a1e6e6bfc353..000000000000 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/operation_display_py3.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 OperationDisplay(Model): - """The object that describes the operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar provider: The friendly name of the resource provider. - :vartype provider: str - :ivar operation: The operation type: read, write, delete, listKeys/action, - etc. - :vartype operation: str - :ivar resource: The resource type on which the operation is performed. - :vartype resource: str - :ivar description: The friendly name of the operation. - :vartype description: str - """ - - _validation = { - 'provider': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(OperationDisplay, self).__init__(**kwargs) - self.provider = None - self.operation = None - self.resource = None - self.description = None diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/operation_paged.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/operation_paged.py deleted file mode 100644 index 6aaeff67cdb2..000000000000 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/operation_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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.paging import Paged - - -class OperationPaged(Paged): - """ - A paging container for iterating over a list of :class:`Operation ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Operation]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/operation_py3.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/operation_py3.py deleted file mode 100644 index 1b4dbae10d28..000000000000 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/operation_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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) -> None: - super(Operation, self).__init__(**kwargs) - self.name = None - self.display = None diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/query_key.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/query_key.py deleted file mode 100644 index 4b4f282ed5eb..000000000000 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/query_key.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 QueryKey(Model): - """Describes an API key for a given Azure Search service that has permissions - for query operations only. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: The name of the query API key; may be empty. - :vartype name: str - :ivar key: The value of the query API key. - :vartype key: str - """ - - _validation = { - 'name': {'readonly': True}, - 'key': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(QueryKey, self).__init__(**kwargs) - self.name = None - self.key = None diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/query_key_paged.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/query_key_paged.py deleted file mode 100644 index f1fc2d9aade8..000000000000 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/query_key_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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.paging import Paged - - -class QueryKeyPaged(Paged): - """ - A paging container for iterating over a list of :class:`QueryKey ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[QueryKey]'} - } - - def __init__(self, *args, **kwargs): - - super(QueryKeyPaged, self).__init__(*args, **kwargs) diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/query_key_py3.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/query_key_py3.py deleted file mode 100644 index e02c33495eed..000000000000 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/query_key_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 QueryKey(Model): - """Describes an API key for a given Azure Search service that has permissions - for query operations only. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: The name of the query API key; may be empty. - :vartype name: str - :ivar key: The value of the query API key. - :vartype key: str - """ - - _validation = { - 'name': {'readonly': True}, - 'key': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(QueryKey, self).__init__(**kwargs) - self.name = None - self.key = None diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/resource.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/resource.py deleted file mode 100644 index 8dc5dd8833f9..000000000000 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/resource.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 Resource(Model): - """Base type for all Azure resources. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The ID of the resource. This can be used with the Azure Resource - Manager to link resources together. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The resource type. - :vartype type: str - :param location: The geographic location of the resource. This must be one - of the supported and registered Azure Geo Regions (for example, West US, - East US, Southeast Asia, and so forth). This property is required when - creating a new resource. - :type location: str - :param tags: Tags to help categorize the resource in the Azure portal. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.search.models.Identity - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - } - - def __init__(self, **kwargs): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.identity = kwargs.get('identity', None) diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/resource_py3.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/resource_py3.py deleted file mode 100644 index 752e7a2cbbb9..000000000000 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/resource_py3.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 Resource(Model): - """Base type for all Azure resources. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The ID of the resource. This can be used with the Azure Resource - Manager to link resources together. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The resource type. - :vartype type: str - :param location: The geographic location of the resource. This must be one - of the supported and registered Azure Geo Regions (for example, West US, - East US, Southeast Asia, and so forth). This property is required when - creating a new resource. - :type location: str - :param tags: Tags to help categorize the resource in the Azure portal. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.search.models.Identity - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - } - - def __init__(self, *, location: str=None, tags=None, identity=None, **kwargs) -> None: - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = location - self.tags = tags - self.identity = identity diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/search_management_request_options.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/search_management_request_options.py deleted file mode 100644 index 96e0dc7df52e..000000000000 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/search_management_request_options.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 SearchManagementRequestOptions(Model): - """Additional parameters for a set of operations. - - :param client_request_id: A client-generated GUID value that identifies - this request. If specified, this will be included in response information - as a way to track the request. - :type client_request_id: str - """ - - _attribute_map = { - 'client_request_id': {'key': '', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SearchManagementRequestOptions, self).__init__(**kwargs) - self.client_request_id = kwargs.get('client_request_id', None) diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/search_management_request_options_py3.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/search_management_request_options_py3.py deleted file mode 100644 index 3e36e9a15800..000000000000 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/search_management_request_options_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 SearchManagementRequestOptions(Model): - """Additional parameters for a set of operations. - - :param client_request_id: A client-generated GUID value that identifies - this request. If specified, this will be included in response information - as a way to track the request. - :type client_request_id: str - """ - - _attribute_map = { - 'client_request_id': {'key': '', 'type': 'str'}, - } - - def __init__(self, *, client_request_id: str=None, **kwargs) -> None: - super(SearchManagementRequestOptions, self).__init__(**kwargs) - self.client_request_id = client_request_id diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/search_service.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/search_service.py deleted file mode 100644 index 6bd3de6791de..000000000000 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/search_service.py +++ /dev/null @@ -1,124 +0,0 @@ -# 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 .resource import Resource - - -class SearchService(Resource): - """Describes an Azure Search service and its current state. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The ID of the resource. This can be used with the Azure Resource - Manager to link resources together. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The resource type. - :vartype type: str - :param location: The geographic location of the resource. This must be one - of the supported and registered Azure Geo Regions (for example, West US, - East US, Southeast Asia, and so forth). This property is required when - creating a new resource. - :type location: str - :param tags: Tags to help categorize the resource in the Azure portal. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.search.models.Identity - :param replica_count: The number of replicas in the Search service. If - specified, it must be a value between 1 and 12 inclusive for standard SKUs - or between 1 and 3 inclusive for basic SKU. Default value: 1 . - :type replica_count: int - :param partition_count: The number of partitions in the Search service; if - specified, it can be 1, 2, 3, 4, 6, or 12. Values greater than 1 are only - valid for standard SKUs. For 'standard3' services with hostingMode set to - 'highDensity', the allowed values are between 1 and 3. Default value: 1 . - :type partition_count: int - :param hosting_mode: Applicable only for the standard3 SKU. You can set - this property to enable up to 3 high density partitions that allow up to - 1000 indexes, which is much higher than the maximum indexes allowed for - any other SKU. For the standard3 SKU, the value is either 'default' or - 'highDensity'. For all other SKUs, this value must be 'default'. Possible - values include: 'default', 'highDensity'. Default value: "default" . - :type hosting_mode: str or ~azure.mgmt.search.models.HostingMode - :ivar status: The status of the Search service. Possible values include: - 'running': The Search service is running and no provisioning operations - are underway. 'provisioning': The Search service is being provisioned or - scaled up or down. 'deleting': The Search service is being deleted. - 'degraded': The Search service is degraded. This can occur when the - underlying search units are not healthy. The Search service is most likely - operational, but performance might be slow and some requests might be - dropped. 'disabled': The Search service is disabled. In this state, the - service will reject all API requests. 'error': The Search service is in an - error state. If your service is in the degraded, disabled, or error - states, it means the Azure Search team is actively investigating the - underlying issue. Dedicated services in these states are still chargeable - based on the number of search units provisioned. Possible values include: - 'running', 'provisioning', 'deleting', 'degraded', 'disabled', 'error' - :vartype status: str or ~azure.mgmt.search.models.SearchServiceStatus - :ivar status_details: The details of the Search service status. - :vartype status_details: str - :ivar provisioning_state: The state of the last provisioning operation - performed on the Search service. Provisioning is an intermediate state - that occurs while service capacity is being established. After capacity is - set up, provisioningState changes to either 'succeeded' or 'failed'. - Client applications can poll provisioning status (the recommended polling - interval is from 30 seconds to one minute) by using the Get Search Service - operation to see when an operation is completed. If you are using the free - service, this value tends to come back as 'succeeded' directly in the call - to Create Search service. This is because the free service uses capacity - that is already set up. Possible values include: 'succeeded', - 'provisioning', 'failed' - :vartype provisioning_state: str or - ~azure.mgmt.search.models.ProvisioningState - :param sku: The SKU of the Search Service, which determines price tier and - capacity limits. This property is required when creating a new Search - Service. - :type sku: ~azure.mgmt.search.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'replica_count': {'maximum': 12, 'minimum': 1}, - 'partition_count': {'maximum': 12, 'minimum': 1}, - 'status': {'readonly': True}, - 'status_details': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'replica_count': {'key': 'properties.replicaCount', 'type': 'int'}, - 'partition_count': {'key': 'properties.partitionCount', 'type': 'int'}, - 'hosting_mode': {'key': 'properties.hostingMode', 'type': 'HostingMode'}, - 'status': {'key': 'properties.status', 'type': 'SearchServiceStatus'}, - 'status_details': {'key': 'properties.statusDetails', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__(self, **kwargs): - super(SearchService, self).__init__(**kwargs) - self.replica_count = kwargs.get('replica_count', 1) - self.partition_count = kwargs.get('partition_count', 1) - self.hosting_mode = kwargs.get('hosting_mode', "default") - self.status = None - self.status_details = None - self.provisioning_state = None - self.sku = kwargs.get('sku', None) diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/search_service_paged.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/search_service_paged.py deleted file mode 100644 index dbb3236affea..000000000000 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/search_service_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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.paging import Paged - - -class SearchServicePaged(Paged): - """ - A paging container for iterating over a list of :class:`SearchService ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[SearchService]'} - } - - def __init__(self, *args, **kwargs): - - super(SearchServicePaged, self).__init__(*args, **kwargs) diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/search_service_py3.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/search_service_py3.py deleted file mode 100644 index 823afff5b9a5..000000000000 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/search_service_py3.py +++ /dev/null @@ -1,124 +0,0 @@ -# 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 .resource_py3 import Resource - - -class SearchService(Resource): - """Describes an Azure Search service and its current state. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The ID of the resource. This can be used with the Azure Resource - Manager to link resources together. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The resource type. - :vartype type: str - :param location: The geographic location of the resource. This must be one - of the supported and registered Azure Geo Regions (for example, West US, - East US, Southeast Asia, and so forth). This property is required when - creating a new resource. - :type location: str - :param tags: Tags to help categorize the resource in the Azure portal. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.search.models.Identity - :param replica_count: The number of replicas in the Search service. If - specified, it must be a value between 1 and 12 inclusive for standard SKUs - or between 1 and 3 inclusive for basic SKU. Default value: 1 . - :type replica_count: int - :param partition_count: The number of partitions in the Search service; if - specified, it can be 1, 2, 3, 4, 6, or 12. Values greater than 1 are only - valid for standard SKUs. For 'standard3' services with hostingMode set to - 'highDensity', the allowed values are between 1 and 3. Default value: 1 . - :type partition_count: int - :param hosting_mode: Applicable only for the standard3 SKU. You can set - this property to enable up to 3 high density partitions that allow up to - 1000 indexes, which is much higher than the maximum indexes allowed for - any other SKU. For the standard3 SKU, the value is either 'default' or - 'highDensity'. For all other SKUs, this value must be 'default'. Possible - values include: 'default', 'highDensity'. Default value: "default" . - :type hosting_mode: str or ~azure.mgmt.search.models.HostingMode - :ivar status: The status of the Search service. Possible values include: - 'running': The Search service is running and no provisioning operations - are underway. 'provisioning': The Search service is being provisioned or - scaled up or down. 'deleting': The Search service is being deleted. - 'degraded': The Search service is degraded. This can occur when the - underlying search units are not healthy. The Search service is most likely - operational, but performance might be slow and some requests might be - dropped. 'disabled': The Search service is disabled. In this state, the - service will reject all API requests. 'error': The Search service is in an - error state. If your service is in the degraded, disabled, or error - states, it means the Azure Search team is actively investigating the - underlying issue. Dedicated services in these states are still chargeable - based on the number of search units provisioned. Possible values include: - 'running', 'provisioning', 'deleting', 'degraded', 'disabled', 'error' - :vartype status: str or ~azure.mgmt.search.models.SearchServiceStatus - :ivar status_details: The details of the Search service status. - :vartype status_details: str - :ivar provisioning_state: The state of the last provisioning operation - performed on the Search service. Provisioning is an intermediate state - that occurs while service capacity is being established. After capacity is - set up, provisioningState changes to either 'succeeded' or 'failed'. - Client applications can poll provisioning status (the recommended polling - interval is from 30 seconds to one minute) by using the Get Search Service - operation to see when an operation is completed. If you are using the free - service, this value tends to come back as 'succeeded' directly in the call - to Create Search service. This is because the free service uses capacity - that is already set up. Possible values include: 'succeeded', - 'provisioning', 'failed' - :vartype provisioning_state: str or - ~azure.mgmt.search.models.ProvisioningState - :param sku: The SKU of the Search Service, which determines price tier and - capacity limits. This property is required when creating a new Search - Service. - :type sku: ~azure.mgmt.search.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'replica_count': {'maximum': 12, 'minimum': 1}, - 'partition_count': {'maximum': 12, 'minimum': 1}, - 'status': {'readonly': True}, - 'status_details': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'replica_count': {'key': 'properties.replicaCount', 'type': 'int'}, - 'partition_count': {'key': 'properties.partitionCount', 'type': 'int'}, - 'hosting_mode': {'key': 'properties.hostingMode', 'type': 'HostingMode'}, - 'status': {'key': 'properties.status', 'type': 'SearchServiceStatus'}, - 'status_details': {'key': 'properties.statusDetails', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__(self, *, location: str=None, tags=None, identity=None, replica_count: int=1, partition_count: int=1, hosting_mode="default", sku=None, **kwargs) -> None: - super(SearchService, self).__init__(location=location, tags=tags, identity=identity, **kwargs) - self.replica_count = replica_count - self.partition_count = partition_count - self.hosting_mode = hosting_mode - self.status = None - self.status_details = None - self.provisioning_state = None - self.sku = sku diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/sku.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/sku.py deleted file mode 100644 index 375894ee72ca..000000000000 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/sku.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 Sku(Model): - """Defines the SKU of an Azure Search Service, which determines price tier and - capacity limits. - - :param name: The SKU of the Search service. Valid values include: 'free': - Shared service. 'basic': Dedicated service with up to 3 replicas. - 'standard': Dedicated service with up to 12 partitions and 12 replicas. - 'standard2': Similar to standard, but with more capacity per search unit. - 'standard3': The largest Standard offering with up to 12 partitions and 12 - replicas (or up to 3 partitions with more indexes if you also set the - hostingMode property to 'highDensity'). 'storage_optimized_l1': Supports - 1TB per partition, up to 12 partitions. 'storage_optimized_l2': Supports - 2TB per partition, up to 12 partitions.'. Possible values include: 'free', - 'basic', 'standard', 'standard2', 'standard3', 'storage_optimized_l1', - 'storage_optimized_l2' - :type name: str or ~azure.mgmt.search.models.SkuName - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'SkuName'}, - } - - def __init__(self, **kwargs): - super(Sku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/sku_py3.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/sku_py3.py deleted file mode 100644 index aae43fc4e4b7..000000000000 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/sku_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 Sku(Model): - """Defines the SKU of an Azure Search Service, which determines price tier and - capacity limits. - - :param name: The SKU of the Search service. Valid values include: 'free': - Shared service. 'basic': Dedicated service with up to 3 replicas. - 'standard': Dedicated service with up to 12 partitions and 12 replicas. - 'standard2': Similar to standard, but with more capacity per search unit. - 'standard3': The largest Standard offering with up to 12 partitions and 12 - replicas (or up to 3 partitions with more indexes if you also set the - hostingMode property to 'highDensity'). 'storage_optimized_l1': Supports - 1TB per partition, up to 12 partitions. 'storage_optimized_l2': Supports - 2TB per partition, up to 12 partitions.'. Possible values include: 'free', - 'basic', 'standard', 'standard2', 'standard3', 'storage_optimized_l1', - 'storage_optimized_l2' - :type name: str or ~azure.mgmt.search.models.SkuName - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'SkuName'}, - } - - def __init__(self, *, name=None, **kwargs) -> None: - super(Sku, self).__init__(**kwargs) - self.name = name diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/__init__.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/__init__.py index 4b49a00e8eb1..be7923d1fb0f 100644 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/__init__.py +++ b/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/__init__.py @@ -9,14 +9,20 @@ # regenerated. # -------------------------------------------------------------------------- -from .operations import Operations -from .admin_keys_operations import AdminKeysOperations -from .query_keys_operations import QueryKeysOperations -from .services_operations import ServicesOperations +from ._operations import Operations +from ._admin_keys_operations import AdminKeysOperations +from ._query_keys_operations import QueryKeysOperations +from ._services_operations import ServicesOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._shared_private_link_resources_operations import SharedPrivateLinkResourcesOperations __all__ = [ 'Operations', 'AdminKeysOperations', 'QueryKeysOperations', 'ServicesOperations', + 'PrivateLinkResourcesOperations', + 'PrivateEndpointConnectionsOperations', + 'SharedPrivateLinkResourcesOperations', ] diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/admin_keys_operations.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/_admin_keys_operations.py similarity index 94% rename from sdk/search/azure-mgmt-search/azure/mgmt/search/operations/admin_keys_operations.py rename to sdk/search/azure-mgmt-search/azure/mgmt/search/operations/_admin_keys_operations.py index 7887d302f3d4..90ca2eecea05 100644 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/admin_keys_operations.py +++ b/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/_admin_keys_operations.py @@ -19,11 +19,13 @@ class AdminKeysOperations(object): """AdminKeysOperations operations. + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for each request. The current version is 2015-08-19. Constant value: "2015-08-19". + :ivar api_version: The API version to use for each request. The current version is 2019-10-01-Preview. Constant value: "2020-03-13". """ models = models @@ -33,21 +35,21 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-08-19" + self.api_version = "2020-03-13" self.config = config def get( self, resource_group_name, search_service_name, search_management_request_options=None, custom_headers=None, raw=False, **operation_config): """Gets the primary and secondary admin API keys for the specified Azure - Search service. + Cognitive Search service. :param resource_group_name: The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str - :param search_service_name: The name of the Azure Search service - associated with the specified resource group. + :param search_service_name: The name of the Azure Cognitive Search + service associated with the specified resource group. :type search_service_name: str :param search_management_request_options: Additional parameters for the operation @@ -102,7 +104,6 @@ def get( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('AdminKeyResult', response) @@ -122,8 +123,8 @@ def regenerate( current subscription. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str - :param search_service_name: The name of the Azure Search service - associated with the specified resource group. + :param search_service_name: The name of the Azure Cognitive Search + service associated with the specified resource group. :type search_service_name: str :param key_kind: Specifies which key to regenerate. Valid values include 'primary' and 'secondary'. Possible values include: 'primary', @@ -183,7 +184,6 @@ def regenerate( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('AdminKeyResult', response) diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/operations.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/_operations.py similarity index 87% rename from sdk/search/azure-mgmt-search/azure/mgmt/search/operations/operations.py rename to sdk/search/azure-mgmt-search/azure/mgmt/search/operations/_operations.py index c83587eafb24..a66ef2d2edcc 100644 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/operations.py +++ b/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/_operations.py @@ -19,11 +19,13 @@ class Operations(object): """Operations operations. + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for each request. The current version is 2015-08-19. Constant value: "2015-08-19". + :ivar api_version: The API version to use for each request. The current version is 2019-10-01-Preview. Constant value: "2020-03-13". """ models = models @@ -33,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-08-19" + self.api_version = "2020-03-13" self.config = config @@ -52,8 +54,7 @@ def list( ~azure.mgmt.search.models.OperationPaged[~azure.mgmt.search.models.Operation] :raises: :class:`CloudError` """ - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list.metadata['url'] @@ -78,6 +79,11 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -88,12 +94,10 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list.metadata = {'url': '/providers/Microsoft.Search/operations'} diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/_private_endpoint_connections_operations.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..7046ec58bd63 --- /dev/null +++ b/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,374 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for each request. The current version is 2019-10-01-Preview. Constant value: "2020-03-13". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-03-13" + + self.config = config + + def update( + self, resource_group_name, search_service_name, private_endpoint_connection_name, properties=None, search_management_request_options=None, custom_headers=None, raw=False, **operation_config): + """Updates a Private Endpoint connection to the Search service in the + given resource group. + + :param resource_group_name: The name of the resource group within the + current subscription. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param search_service_name: The name of the Azure Cognitive Search + service associated with the specified resource group. + :type search_service_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection to the Azure Cognitive Search service with the + specified resource group. + :type private_endpoint_connection_name: str + :param properties: Describes the properties of an existing Private + Endpoint connection to the Azure Cognitive Search service. + :type properties: + ~azure.mgmt.search.models.PrivateEndpointConnectionProperties + :param search_management_request_options: Additional parameters for + the operation + :type search_management_request_options: + ~azure.mgmt.search.models.SearchManagementRequestOptions + :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`. + :return: PrivateEndpointConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.search.models.PrivateEndpointConnection or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + client_request_id = None + if search_management_request_options is not None: + client_request_id = search_management_request_options.client_request_id + private_endpoint_connection = models.PrivateEndpointConnection(properties=properties) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'searchServiceName': self._serialize.url("search_service_name", search_service_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + if client_request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("client_request_id", client_request_id, 'str') + + # Construct body + body_content = self._serialize.body(private_endpoint_connection, 'PrivateEndpointConnection') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + def get( + self, resource_group_name, search_service_name, private_endpoint_connection_name, search_management_request_options=None, custom_headers=None, raw=False, **operation_config): + """Gets the details of the private endpoint connection to the Search + service in the given resource group. + + :param resource_group_name: The name of the resource group within the + current subscription. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param search_service_name: The name of the Azure Cognitive Search + service associated with the specified resource group. + :type search_service_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection to the Azure Cognitive Search service with the + specified resource group. + :type private_endpoint_connection_name: str + :param search_management_request_options: Additional parameters for + the operation + :type search_management_request_options: + ~azure.mgmt.search.models.SearchManagementRequestOptions + :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`. + :return: PrivateEndpointConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.search.models.PrivateEndpointConnection or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + client_request_id = None + if search_management_request_options is not None: + client_request_id = search_management_request_options.client_request_id + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'searchServiceName': self._serialize.url("search_service_name", search_service_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + if client_request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("client_request_id", client_request_id, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + def delete( + self, resource_group_name, search_service_name, private_endpoint_connection_name, search_management_request_options=None, custom_headers=None, raw=False, **operation_config): + """Disconnects the private endpoint connection and deletes it from the + Search service. + + :param resource_group_name: The name of the resource group within the + current subscription. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param search_service_name: The name of the Azure Cognitive Search + service associated with the specified resource group. + :type search_service_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection to the Azure Cognitive Search service with the + specified resource group. + :type private_endpoint_connection_name: str + :param search_management_request_options: Additional parameters for + the operation + :type search_management_request_options: + ~azure.mgmt.search.models.SearchManagementRequestOptions + :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`. + :return: PrivateEndpointConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.search.models.PrivateEndpointConnection or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + client_request_id = None + if search_management_request_options is not None: + client_request_id = search_management_request_options.client_request_id + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'searchServiceName': self._serialize.url("search_service_name", search_service_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + if client_request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("client_request_id", client_request_id, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + def list_by_service( + self, resource_group_name, search_service_name, search_management_request_options=None, custom_headers=None, raw=False, **operation_config): + """Gets a list of all private endpoint connections in the given service. + + :param resource_group_name: The name of the resource group within the + current subscription. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param search_service_name: The name of the Azure Cognitive Search + service associated with the specified resource group. + :type search_service_name: str + :param search_management_request_options: Additional parameters for + the operation + :type search_management_request_options: + ~azure.mgmt.search.models.SearchManagementRequestOptions + :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`. + :return: An iterator like instance of PrivateEndpointConnection + :rtype: + ~azure.mgmt.search.models.PrivateEndpointConnectionPaged[~azure.mgmt.search.models.PrivateEndpointConnection] + :raises: :class:`CloudError` + """ + client_request_id = None + if search_management_request_options is not None: + client_request_id = search_management_request_options.client_request_id + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_service.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'), + 'searchServiceName': self._serialize.url("search_service_name", search_service_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + if client_request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("client_request_id", client_request_id, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateEndpointConnectionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateEndpointConnections'} diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/_private_link_resources_operations.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..4aa33d3b5dc9 --- /dev/null +++ b/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/_private_link_resources_operations.py @@ -0,0 +1,126 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class PrivateLinkResourcesOperations(object): + """PrivateLinkResourcesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for each request. The current version is 2019-10-01-Preview. Constant value: "2020-03-13". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-03-13" + + self.config = config + + def list_supported( + self, resource_group_name, search_service_name, search_management_request_options=None, custom_headers=None, raw=False, **operation_config): + """Gets a list of all supported private link resource types for the given + service. + + :param resource_group_name: The name of the resource group within the + current subscription. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param search_service_name: The name of the Azure Cognitive Search + service associated with the specified resource group. + :type search_service_name: str + :param search_management_request_options: Additional parameters for + the operation + :type search_management_request_options: + ~azure.mgmt.search.models.SearchManagementRequestOptions + :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`. + :return: An iterator like instance of PrivateLinkResource + :rtype: + ~azure.mgmt.search.models.PrivateLinkResourcePaged[~azure.mgmt.search.models.PrivateLinkResource] + :raises: :class:`CloudError` + """ + client_request_id = None + if search_management_request_options is not None: + client_request_id = search_management_request_options.client_request_id + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_supported.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'), + 'searchServiceName': self._serialize.url("search_service_name", search_service_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + if client_request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("client_request_id", client_request_id, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateLinkResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_supported.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateLinkResources'} diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/query_keys_operations.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/_query_keys_operations.py similarity index 92% rename from sdk/search/azure-mgmt-search/azure/mgmt/search/operations/query_keys_operations.py rename to sdk/search/azure-mgmt-search/azure/mgmt/search/operations/_query_keys_operations.py index 8fb9e29e0309..806a076b0e0f 100644 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/query_keys_operations.py +++ b/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/_query_keys_operations.py @@ -19,11 +19,13 @@ class QueryKeysOperations(object): """QueryKeysOperations operations. + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for each request. The current version is 2015-08-19. Constant value: "2015-08-19". + :ivar api_version: The API version to use for each request. The current version is 2019-10-01-Preview. Constant value: "2020-03-13". """ models = models @@ -33,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-08-19" + self.api_version = "2020-03-13" self.config = config @@ -46,8 +48,8 @@ def create( current subscription. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str - :param search_service_name: The name of the Azure Search service - associated with the specified resource group. + :param search_service_name: The name of the Azure Cognitive Search + service associated with the specified resource group. :type search_service_name: str :param name: The name of the new query API key. :type name: str @@ -105,7 +107,6 @@ def create( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('QueryKey', response) @@ -118,14 +119,15 @@ def create( def list_by_search_service( self, resource_group_name, search_service_name, search_management_request_options=None, custom_headers=None, raw=False, **operation_config): - """Returns the list of query API keys for the given Azure Search service. + """Returns the list of query API keys for the given Azure Cognitive Search + service. :param resource_group_name: The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str - :param search_service_name: The name of the Azure Search service - associated with the specified resource group. + :param search_service_name: The name of the Azure Cognitive Search + service associated with the specified resource group. :type search_service_name: str :param search_management_request_options: Additional parameters for the operation @@ -145,8 +147,7 @@ def list_by_search_service( if search_management_request_options is not None: client_request_id = search_management_request_options.client_request_id - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list_by_search_service.metadata['url'] @@ -178,7 +179,12 @@ def internal_paging(next_link=None, raw=False): header_parameters['x-ms-client-request-id'] = self._serialize.header("client_request_id", client_request_id, 'str') # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.post(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -189,12 +195,10 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.QueryKeyPaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.QueryKeyPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.QueryKeyPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list_by_search_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/listQueryKeys'} @@ -209,8 +213,8 @@ def delete( current subscription. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str - :param search_service_name: The name of the Azure Search service - associated with the specified resource group. + :param search_service_name: The name of the Azure Cognitive Search + service associated with the specified resource group. :type search_service_name: str :param key: The query key to be deleted. Query keys are identified by value, not by name. diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/services_operations.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/_services_operations.py similarity index 94% rename from sdk/search/azure-mgmt-search/azure/mgmt/search/operations/services_operations.py rename to sdk/search/azure-mgmt-search/azure/mgmt/search/operations/_services_operations.py index c89b0d0e364d..b1379865a0cc 100644 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/services_operations.py +++ b/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/_services_operations.py @@ -21,11 +21,13 @@ class ServicesOperations(object): """ServicesOperations operations. + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for each request. The current version is 2015-08-19. Constant value: "2015-08-19". + :ivar api_version: The API version to use for each request. The current version is 2019-10-01-Preview. Constant value: "2020-03-13". """ models = models @@ -35,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-08-19" + self.api_version = "2020-03-13" self.config = config @@ -107,12 +109,12 @@ def create_or_update( current subscription. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str - :param search_service_name: The name of the Azure Search service to - create or update. 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. Search service names must be globally - unique since they are part of the service URI + :param search_service_name: The name of the Azure Cognitive Search + service to create or update. 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. Search service names must be + globally unique since they are part of the service URI (https://.search.windows.net). You cannot change the service name after the service is created. :type search_service_name: str @@ -172,8 +174,8 @@ def update( current subscription. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str - :param search_service_name: The name of the Azure Search service to - update. + :param search_service_name: The name of the Azure Cognitive Search + service to update. :type search_service_name: str :param service: The definition of the Search service to update. :type service: ~azure.mgmt.search.models.SearchService @@ -234,7 +236,6 @@ def update( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('SearchService', response) @@ -254,8 +255,8 @@ def get( current subscription. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str - :param search_service_name: The name of the Azure Search service - associated with the specified resource group. + :param search_service_name: The name of the Azure Cognitive Search + service associated with the specified resource group. :type search_service_name: str :param search_management_request_options: Additional parameters for the operation @@ -310,7 +311,6 @@ def get( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('SearchService', response) @@ -330,8 +330,8 @@ def delete( current subscription. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str - :param search_service_name: The name of the Azure Search service - associated with the specified resource group. + :param search_service_name: The name of the Azure Cognitive Search + service associated with the specified resource group. :type search_service_name: str :param search_management_request_options: Additional parameters for the operation @@ -414,8 +414,7 @@ def list_by_resource_group( if search_management_request_options is not None: client_request_id = search_management_request_options.client_request_id - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] @@ -447,6 +446,11 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -457,12 +461,10 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.SearchServicePaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.SearchServicePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.SearchServicePaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices'} @@ -489,8 +491,7 @@ def list_by_subscription( if search_management_request_options is not None: client_request_id = search_management_request_options.client_request_id - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] @@ -521,6 +522,11 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -531,12 +537,10 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.SearchServicePaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.SearchServicePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.SearchServicePaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Search/searchServices'} @@ -608,7 +612,6 @@ def check_name_availability( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('CheckNameAvailabilityOutput', response) diff --git a/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/_shared_private_link_resources_operations.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/_shared_private_link_resources_operations.py new file mode 100644 index 000000000000..80c9310747f9 --- /dev/null +++ b/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/_shared_private_link_resources_operations.py @@ -0,0 +1,368 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class SharedPrivateLinkResourcesOperations(object): + """SharedPrivateLinkResourcesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for each request. The current version is 2019-10-01-Preview. Constant value: "2020-03-13". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-03-13" + + self.config = config + + def create_or_update( + self, resource_group_name, search_service_name, shared_private_link_resource_name, properties=None, search_management_request_options=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates a shared private link resource managed by the Search + service in the given resource group. + + :param resource_group_name: The name of the resource group within the + current subscription. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param search_service_name: The name of the Azure Cognitive Search + service associated with the specified resource group. + :type search_service_name: str + :param shared_private_link_resource_name: The name of the shared + private link resource managed by the Azure Cognitive Search service + within the specified resource group. + :type shared_private_link_resource_name: str + :param properties: Describes the properties of a Shared Private Link + Resource managed by the Azure Cognitive Search service. + :type properties: + ~azure.mgmt.search.models.SharedPrivateLinkResourceProperties + :param search_management_request_options: Additional parameters for + the operation + :type search_management_request_options: + ~azure.mgmt.search.models.SearchManagementRequestOptions + :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`. + :return: SharedPrivateLinkResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.search.models.SharedPrivateLinkResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + client_request_id = None + if search_management_request_options is not None: + client_request_id = search_management_request_options.client_request_id + shared_private_link_resource = models.SharedPrivateLinkResource(properties=properties) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'searchServiceName': self._serialize.url("search_service_name", search_service_name, 'str'), + 'sharedPrivateLinkResourceName': self._serialize.url("shared_private_link_resource_name", shared_private_link_resource_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + if client_request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("client_request_id", client_request_id, 'str') + + # Construct body + body_content = self._serialize.body(shared_private_link_resource, 'SharedPrivateLinkResource') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SharedPrivateLinkResource', response) + if response.status_code == 201: + deserialized = self._deserialize('SharedPrivateLinkResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}'} + + def get( + self, resource_group_name, search_service_name, shared_private_link_resource_name, search_management_request_options=None, custom_headers=None, raw=False, **operation_config): + """Gets the details of the shared private link resource managed by the + Search service in the given resource group. + + :param resource_group_name: The name of the resource group within the + current subscription. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param search_service_name: The name of the Azure Cognitive Search + service associated with the specified resource group. + :type search_service_name: str + :param shared_private_link_resource_name: The name of the shared + private link resource managed by the Azure Cognitive Search service + within the specified resource group. + :type shared_private_link_resource_name: str + :param search_management_request_options: Additional parameters for + the operation + :type search_management_request_options: + ~azure.mgmt.search.models.SearchManagementRequestOptions + :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`. + :return: SharedPrivateLinkResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.search.models.SharedPrivateLinkResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + client_request_id = None + if search_management_request_options is not None: + client_request_id = search_management_request_options.client_request_id + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'searchServiceName': self._serialize.url("search_service_name", search_service_name, 'str'), + 'sharedPrivateLinkResourceName': self._serialize.url("shared_private_link_resource_name", shared_private_link_resource_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + if client_request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("client_request_id", client_request_id, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SharedPrivateLinkResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}'} + + def delete( + self, resource_group_name, search_service_name, shared_private_link_resource_name, search_management_request_options=None, custom_headers=None, raw=False, **operation_config): + """Deletes the shared private link resource from the Search service. + + :param resource_group_name: The name of the resource group within the + current subscription. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param search_service_name: The name of the Azure Cognitive Search + service associated with the specified resource group. + :type search_service_name: str + :param shared_private_link_resource_name: The name of the shared + private link resource managed by the Azure Cognitive Search service + within the specified resource group. + :type shared_private_link_resource_name: str + :param search_management_request_options: Additional parameters for + the operation + :type search_management_request_options: + ~azure.mgmt.search.models.SearchManagementRequestOptions + :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`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + client_request_id = None + if search_management_request_options is not None: + client_request_id = search_management_request_options.client_request_id + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'searchServiceName': self._serialize.url("search_service_name", search_service_name, 'str'), + 'sharedPrivateLinkResourceName': self._serialize.url("shared_private_link_resource_name", shared_private_link_resource_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + if client_request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("client_request_id", client_request_id, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}'} + + def list_by_service( + self, resource_group_name, search_service_name, search_management_request_options=None, custom_headers=None, raw=False, **operation_config): + """Gets a list of all shared private link resources managed by the given + service. + + :param resource_group_name: The name of the resource group within the + current subscription. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param search_service_name: The name of the Azure Cognitive Search + service associated with the specified resource group. + :type search_service_name: str + :param search_management_request_options: Additional parameters for + the operation + :type search_management_request_options: + ~azure.mgmt.search.models.SearchManagementRequestOptions + :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`. + :return: An iterator like instance of SharedPrivateLinkResource + :rtype: + ~azure.mgmt.search.models.SharedPrivateLinkResourcePaged[~azure.mgmt.search.models.SharedPrivateLinkResource] + :raises: :class:`CloudError` + """ + client_request_id = None + if search_management_request_options is not None: + client_request_id = search_management_request_options.client_request_id + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_service.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'), + 'searchServiceName': self._serialize.url("search_service_name", search_service_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + if client_request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("client_request_id", client_request_id, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.SharedPrivateLinkResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources'} diff --git a/sdk/search/azure-mgmt-search/setup.py b/sdk/search/azure-mgmt-search/setup.py index a2f5d0ca1a19..9d7054e7f31f 100644 --- a/sdk/search/azure-mgmt-search/setup.py +++ b/sdk/search/azure-mgmt-search/setup.py @@ -36,7 +36,9 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) @@ -64,10 +66,10 @@ 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'License :: OSI Approved :: MIT License', ], zip_safe=False,