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 62% 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..b0647d48532e 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,47 +11,13 @@ 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 . import models class SearchManagementClient(SDKClient): 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..4aea18352b09 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,33 +10,33 @@ # -------------------------------------------------------------------------- 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 Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import QueryKey + from ._models_py3 import Resource + from ._models_py3 import SearchManagementRequestOptions + from ._models_py3 import SearchService + 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 Operation + from ._models import OperationDisplay + from ._models import QueryKey + from ._models import Resource + from ._models import SearchManagementRequestOptions + from ._models import SearchService + from ._models import Sku +from ._paged_models import OperationPaged +from ._paged_models import QueryKeyPaged +from ._paged_models import SearchServicePaged +from ._search_management_client_enums import ( UnavailableNameReason, SkuName, HostingMode, @@ -47,17 +47,17 @@ ) __all__ = [ + 'AdminKeyResult', 'CheckNameAvailabilityInput', 'CheckNameAvailabilityOutput', - 'AdminKeyResult', - 'QueryKey', - 'Sku', - 'SearchService', 'Identity', - 'Resource', - 'OperationDisplay', 'Operation', + 'OperationDisplay', + 'QueryKey', + 'Resource', 'SearchManagementRequestOptions', + 'SearchService', + 'Sku', 'OperationPaged', 'QueryKeyPaged', 'SearchServicePaged', 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..dcee6e65aa90 --- /dev/null +++ b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/_models.py @@ -0,0 +1,517 @@ +# 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 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 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 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 + + +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 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) + + +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/_models_py3.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/_models_py3.py new file mode 100644 index 000000000000..7d1e8c90c9ec --- /dev/null +++ b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/_models_py3.py @@ -0,0 +1,517 @@ +# 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 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 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 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 + + +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 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 + + +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/models/search_service_paged.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/_paged_models.py similarity index 53% rename from sdk/search/azure-mgmt-search/azure/mgmt/search/models/search_service_paged.py rename to sdk/search/azure-mgmt-search/azure/mgmt/search/models/_paged_models.py index dbb3236affea..d41c1002170c 100644 --- a/sdk/search/azure-mgmt-search/azure/mgmt/search/models/search_service_paged.py +++ b/sdk/search/azure-mgmt-search/azure/mgmt/search/models/_paged_models.py @@ -12,6 +12,32 @@ 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 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 100% 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 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_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..323396991abf 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,10 +9,10 @@ # 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 __all__ = [ 'Operations', 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 98% 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..883c2ca9f98e 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,6 +19,8 @@ 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. @@ -102,7 +104,6 @@ def get( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('AdminKeyResult', response) @@ -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 90% 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..2cd5b297b3b3 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,6 +19,8 @@ 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. @@ -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/query_keys_operations.py b/sdk/search/azure-mgmt-search/azure/mgmt/search/operations/_query_keys_operations.py similarity index 97% 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..458bc5636b96 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,6 +19,8 @@ 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. @@ -105,7 +107,6 @@ def create( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('QueryKey', response) @@ -145,8 +146,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'] @@ -179,6 +179,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]: @@ -189,12 +194,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'} 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 97% 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..b3d005df6921 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,6 +21,8 @@ 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. @@ -234,7 +236,6 @@ def update( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('SearchService', response) @@ -310,7 +311,6 @@ def get( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('SearchService', response) @@ -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)