diff --git a/ChangeLog.md b/ChangeLog.md index ca05773ed3e..142ee1419fc 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,14 @@ # Change Log +### 2020-xx-xx - 5.4.3 +Autorest core version: 3.0.6320 + +Modelerfour version: 4.15.421 + +**Bug Fixes** + +- Fix conflict for model deserialization when operation has input param with name `models` #819 + ### 2020-11-09 - 5.4.2 Autorest core version: 3.0.6320 diff --git a/autorest/codegen/models/enum_schema.py b/autorest/codegen/models/enum_schema.py index 63d34926603..055caf6f179 100644 --- a/autorest/codegen/models/enum_schema.py +++ b/autorest/codegen/models/enum_schema.py @@ -96,7 +96,7 @@ def operation_type_annotation(self) -> str: :return: The type annotation for this schema :rtype: str """ - return f'Union[{self.enum_type.type_annotation}, "models.{self.name}"]' + return f'Union[{self.enum_type.type_annotation}, "_models.{self.name}"]' def get_declaration(self, value: Any) -> str: return f'"{value}"' diff --git a/autorest/codegen/models/imports.py b/autorest/codegen/models/imports.py index f855e053018..edbec72b5cd 100644 --- a/autorest/codegen/models/imports.py +++ b/autorest/codegen/models/imports.py @@ -4,7 +4,7 @@ # license information. # -------------------------------------------------------------------------- from enum import Enum -from typing import Dict, Optional, Set +from typing import Dict, Optional, Set, Tuple, Union class ImportType(str, Enum): @@ -21,20 +21,27 @@ class TypingSection(str, Enum): class FileImport: def __init__( - self, imports: Dict[TypingSection, Dict[ImportType, Dict[str, Set[Optional[str]]]]] = None + self, + imports: Dict[ + TypingSection, + Dict[ImportType, Dict[str, Set[Optional[Union[str, Tuple[str, str]]]]]] + ] = None ) -> None: # Basic implementation # First level dict: TypingSection # Second level dict: ImportType # Third level dict: the package name. # Fourth level set: None if this import is a "import", the name to import if it's a "from" - self._imports: Dict[TypingSection, Dict[ImportType, Dict[str, Set[Optional[str]]]]] = imports or dict() + self._imports: Dict[ + TypingSection, + Dict[ImportType, Dict[str, Set[Optional[Union[str, Tuple[str, str]]]]]] + ] = imports or dict() def _add_import( self, from_section: str, import_type: ImportType, - name_import: Optional[str] = None, + name_import: Optional[Union[str, Tuple[str, str]]] = None, typing_section: TypingSection = TypingSection.REGULAR ) -> None: self._imports.setdefault( @@ -50,11 +57,14 @@ def add_from_import( from_section: str, name_import: str, import_type: ImportType, - typing_section: TypingSection = TypingSection.REGULAR + typing_section: TypingSection = TypingSection.REGULAR, + alias: Optional[str] = None, ) -> None: """Add an import to this import block. """ - self._add_import(from_section, import_type, name_import, typing_section) + self._add_import( + from_section, import_type, (name_import, alias) if alias else name_import, typing_section + ) def add_import( self, @@ -66,7 +76,10 @@ def add_import( self._add_import(name_import, import_type, None, typing_section) @property - def imports(self) -> Dict[TypingSection, Dict[ImportType, Dict[str, Set[Optional[str]]]]]: + def imports(self) -> Dict[ + TypingSection, + Dict[ImportType, Dict[str, Set[Optional[Union[str, Tuple[str, str]]]]]] + ]: return self._imports def merge(self, file_import: "FileImport") -> None: diff --git a/autorest/codegen/models/object_schema.py b/autorest/codegen/models/object_schema.py index ed93494b44a..200e8c13963 100644 --- a/autorest/codegen/models/object_schema.py +++ b/autorest/codegen/models/object_schema.py @@ -44,7 +44,7 @@ def type_annotation(self) -> str: @property def operation_type_annotation(self) -> str: - return f'"models.{self.name}"' + return f'"_models.{self.name}"' @property def docstring_type(self) -> str: diff --git a/autorest/codegen/models/operation.py b/autorest/codegen/models/operation.py index 0d08fa11899..548941f59cb 100644 --- a/autorest/codegen/models/operation.py +++ b/autorest/codegen/models/operation.py @@ -231,7 +231,7 @@ def default_exception(self) -> Optional[str]: return None excep_schema = default_excp[0].schema if isinstance(excep_schema, ObjectSchema): - return f"models.{excep_schema.name}" + return f"_models.{excep_schema.name}" # in this case, it's just an AnySchema return "\'object\'" diff --git a/autorest/codegen/models/operation_group.py b/autorest/codegen/models/operation_group.py index 22c71822f19..9658090321d 100644 --- a/autorest/codegen/models/operation_group.py +++ b/autorest/codegen/models/operation_group.py @@ -55,9 +55,9 @@ def imports(self, async_mode: bool, has_schemas: bool) -> FileImport: ) if has_schemas: if async_mode: - file_import.add_from_import("...", "models", ImportType.LOCAL) + file_import.add_from_import("...", "models", ImportType.LOCAL, alias="_models") else: - file_import.add_from_import("..", "models", ImportType.LOCAL) + file_import.add_from_import("..", "models", ImportType.LOCAL, alias="_models") return file_import @property diff --git a/autorest/codegen/models/parameter_list.py b/autorest/codegen/models/parameter_list.py index 45d99a64116..2be7584cf64 100644 --- a/autorest/codegen/models/parameter_list.py +++ b/autorest/codegen/models/parameter_list.py @@ -141,4 +141,4 @@ def build_flattened_object(self) -> str: ] ) object_schema = cast(ObjectSchema, self.body[0].schema) - return f"{self.body[0].serialized_name} = models.{object_schema.name}({parameter_string})" + return f"{self.body[0].serialized_name} = _models.{object_schema.name}({parameter_string})" diff --git a/autorest/codegen/serializers/import_serializer.py b/autorest/codegen/serializers/import_serializer.py index bf650331e53..b4c7f35d3f2 100644 --- a/autorest/codegen/serializers/import_serializer.py +++ b/autorest/codegen/serializers/import_serializer.py @@ -4,22 +4,26 @@ # license information. # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Dict, Set, Optional, List +from typing import Dict, Set, Optional, List, Tuple, Union from ..models.imports import ImportType, FileImport, TypingSection -def _serialize_package(package_name: str, module_list: Set[Optional[str]], delimiter: str) -> str: +def _serialize_package( + package_name: str, module_list: Set[Optional[Union[str, Tuple[str, str]]]], delimiter: str +) -> str: buffer = [] if None in module_list: buffer.append(f"import {package_name}") if module_list != {None}: buffer.append( "from {} import {}".format( - package_name, ", ".join(sorted([mod for mod in module_list if mod is not None])) + package_name, ", ".join(sorted([ + mod if isinstance(mod, str) else f"{mod[0]} as {mod[1]}" for mod in module_list if mod is not None + ])) ) ) return delimiter.join(buffer) -def _serialize_type(import_type_dict: Dict[str, Set[Optional[str]]], delimiter: str) -> str: +def _serialize_type(import_type_dict: Dict[str, Set[Optional[Union[str, Tuple[str, str]]]]], delimiter: str) -> str: """Serialize a given import type.""" import_list = [] for package_name in sorted(list(import_type_dict.keys())): @@ -27,7 +31,9 @@ def _serialize_type(import_type_dict: Dict[str, Set[Optional[str]]], delimiter: import_list.append(_serialize_package(package_name, module_list, delimiter)) return delimiter.join(import_list) -def _get_import_clauses(imports: Dict[ImportType, Dict[str, Set[Optional[str]]]], delimiter: str) -> List[str]: +def _get_import_clauses( + imports: Dict[ImportType, Dict[str, Set[Optional[Union[str, Tuple[str, str]]]]]], delimiter: str +) -> List[str]: import_clause = [] for import_type in ImportType: if import_type in imports: diff --git a/autorest/codegen/serializers/metadata_serializer.py b/autorest/codegen/serializers/metadata_serializer.py index 8bbb8a2e0cf..f5cce6ab672 100644 --- a/autorest/codegen/serializers/metadata_serializer.py +++ b/autorest/codegen/serializers/metadata_serializer.py @@ -5,7 +5,7 @@ # -------------------------------------------------------------------------- import copy import json -from typing import List, Optional, Set, Tuple, Dict +from typing import List, Optional, Set, Tuple, Dict, Union from jinja2 import Environment from ..models import ( CodeModel, @@ -26,7 +26,10 @@ def _correct_credential_parameter(global_parameters: ParameterList, async_mode: credential_param.schema = TokenCredentialSchema(async_mode=async_mode) def _json_serialize_imports( - imports: Dict[TypingSection, Dict[ImportType, Dict[str, Set[Optional[str]]]]] + imports: Dict[ + TypingSection, + Dict[ImportType, Dict[str, Set[Optional[Union[str, Tuple[str, str]]]]]] + ] ): if not imports: return None diff --git a/autorest/codegen/templates/operation_tools.jinja2 b/autorest/codegen/templates/operation_tools.jinja2 index 67107d159da..a058ede69b0 100644 --- a/autorest/codegen/templates/operation_tools.jinja2 +++ b/autorest/codegen/templates/operation_tools.jinja2 @@ -53,7 +53,7 @@ error_map = { {% endif %} {% for excep in operation.status_code_exceptions %} {% for status_code in excep.status_codes %} - {% set error_model = ", model=self._deserialize(models." + excep.serialization_type + ", response)" if excep.is_exception else "" %} + {% set error_model = ", model=self._deserialize(_models." + excep.serialization_type + ", response)" if excep.is_exception else "" %} {% set error_format = ", error_format=ARMErrorFormat" if code_model.options['azure_arm'] else "" %} {% if status_code == 401 %} 401: lambda response: ClientAuthenticationError(response=response{{ error_model }}{{ error_format }}), diff --git a/autorest/codegen/templates/operations_container.py.jinja2 b/autorest/codegen/templates/operations_container.py.jinja2 index d1c06449d4e..d19459e4887 100644 --- a/autorest/codegen/templates/operations_container.py.jinja2 +++ b/autorest/codegen/templates/operations_container.py.jinja2 @@ -25,7 +25,7 @@ class {{ operation_group.class_name }}{{ object_base_class }}: """ {% if code_model.schemas %} - models = models + models = _models {% endif %} def __init__(self, client, config, serializer, deserializer){{ return_none_type_annotation }}: diff --git a/test/azure/Expected/AcceptanceTests/AzureBodyDuration/bodyduration/aio/operations/_duration_operations.py b/test/azure/Expected/AcceptanceTests/AzureBodyDuration/bodyduration/aio/operations/_duration_operations.py index c34fbbb55d3..88e9bf120af 100644 --- a/test/azure/Expected/AcceptanceTests/AzureBodyDuration/bodyduration/aio/operations/_duration_operations.py +++ b/test/azure/Expected/AcceptanceTests/AzureBodyDuration/bodyduration/aio/operations/_duration_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DurationOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -76,7 +76,7 @@ async def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('duration', pipeline_response) @@ -130,7 +130,7 @@ async def put_positive_duration( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -173,7 +173,7 @@ async def get_positive_duration( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('duration', pipeline_response) @@ -219,7 +219,7 @@ async def get_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('duration', pipeline_response) diff --git a/test/azure/Expected/AcceptanceTests/AzureBodyDuration/bodyduration/operations/_duration_operations.py b/test/azure/Expected/AcceptanceTests/AzureBodyDuration/bodyduration/operations/_duration_operations.py index ba3a5bd93c2..1310f4279eb 100644 --- a/test/azure/Expected/AcceptanceTests/AzureBodyDuration/bodyduration/operations/_duration_operations.py +++ b/test/azure/Expected/AcceptanceTests/AzureBodyDuration/bodyduration/operations/_duration_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DurationOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -81,7 +81,7 @@ def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('duration', pipeline_response) @@ -136,7 +136,7 @@ def put_positive_duration( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -180,7 +180,7 @@ def get_positive_duration( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('duration', pipeline_response) @@ -227,7 +227,7 @@ def get_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('duration', pipeline_response) diff --git a/test/azure/Expected/AcceptanceTests/AzureParameterGrouping/azureparametergrouping/aio/operations/_parameter_grouping_operations.py b/test/azure/Expected/AcceptanceTests/AzureParameterGrouping/azureparametergrouping/aio/operations/_parameter_grouping_operations.py index 573b26a90ed..cadce8f4d8b 100644 --- a/test/azure/Expected/AcceptanceTests/AzureParameterGrouping/azureparametergrouping/aio/operations/_parameter_grouping_operations.py +++ b/test/azure/Expected/AcceptanceTests/AzureParameterGrouping/azureparametergrouping/aio/operations/_parameter_grouping_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ParameterGroupingOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def post_required( self, - parameter_grouping_post_required_parameters: "models.ParameterGroupingPostRequiredParameters", + parameter_grouping_post_required_parameters: "_models.ParameterGroupingPostRequiredParameters", **kwargs ) -> None: """Post a bunch of required parameters grouped. @@ -101,7 +101,7 @@ async def post_required( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -112,7 +112,7 @@ async def post_required( @distributed_trace_async async def post_optional( self, - parameter_grouping_post_optional_parameters: Optional["models.ParameterGroupingPostOptionalParameters"] = None, + parameter_grouping_post_optional_parameters: Optional["_models.ParameterGroupingPostOptionalParameters"] = None, **kwargs ) -> None: """Post a bunch of optional parameters grouped. @@ -157,7 +157,7 @@ async def post_optional( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -168,8 +168,8 @@ async def post_optional( @distributed_trace_async async def post_multi_param_groups( self, - first_parameter_group: Optional["models.FirstParameterGroup"] = None, - parameter_grouping_post_multi_param_groups_second_param_group: Optional["models.ParameterGroupingPostMultiParamGroupsSecondParamGroup"] = None, + first_parameter_group: Optional["_models.FirstParameterGroup"] = None, + parameter_grouping_post_multi_param_groups_second_param_group: Optional["_models.ParameterGroupingPostMultiParamGroupsSecondParamGroup"] = None, **kwargs ) -> None: """Post parameters from multiple different parameter groups. @@ -225,7 +225,7 @@ async def post_multi_param_groups( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -236,7 +236,7 @@ async def post_multi_param_groups( @distributed_trace_async async def post_shared_parameter_group_object( self, - first_parameter_group: Optional["models.FirstParameterGroup"] = None, + first_parameter_group: Optional["_models.FirstParameterGroup"] = None, **kwargs ) -> None: """Post parameters with a shared parameter group object. @@ -281,7 +281,7 @@ async def post_shared_parameter_group_object( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/azure/Expected/AcceptanceTests/AzureParameterGrouping/azureparametergrouping/operations/_parameter_grouping_operations.py b/test/azure/Expected/AcceptanceTests/AzureParameterGrouping/azureparametergrouping/operations/_parameter_grouping_operations.py index e11984c87b0..f594d8df62e 100644 --- a/test/azure/Expected/AcceptanceTests/AzureParameterGrouping/azureparametergrouping/operations/_parameter_grouping_operations.py +++ b/test/azure/Expected/AcceptanceTests/AzureParameterGrouping/azureparametergrouping/operations/_parameter_grouping_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ParameterGroupingOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -47,7 +47,7 @@ def __init__(self, client, config, serializer, deserializer): @distributed_trace def post_required( self, - parameter_grouping_post_required_parameters, # type: "models.ParameterGroupingPostRequiredParameters" + parameter_grouping_post_required_parameters, # type: "_models.ParameterGroupingPostRequiredParameters" **kwargs # type: Any ): # type: (...) -> None @@ -106,7 +106,7 @@ def post_required( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -117,7 +117,7 @@ def post_required( @distributed_trace def post_optional( self, - parameter_grouping_post_optional_parameters=None, # type: Optional["models.ParameterGroupingPostOptionalParameters"] + parameter_grouping_post_optional_parameters=None, # type: Optional["_models.ParameterGroupingPostOptionalParameters"] **kwargs # type: Any ): # type: (...) -> None @@ -163,7 +163,7 @@ def post_optional( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -174,8 +174,8 @@ def post_optional( @distributed_trace def post_multi_param_groups( self, - first_parameter_group=None, # type: Optional["models.FirstParameterGroup"] - parameter_grouping_post_multi_param_groups_second_param_group=None, # type: Optional["models.ParameterGroupingPostMultiParamGroupsSecondParamGroup"] + first_parameter_group=None, # type: Optional["_models.FirstParameterGroup"] + parameter_grouping_post_multi_param_groups_second_param_group=None, # type: Optional["_models.ParameterGroupingPostMultiParamGroupsSecondParamGroup"] **kwargs # type: Any ): # type: (...) -> None @@ -232,7 +232,7 @@ def post_multi_param_groups( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -243,7 +243,7 @@ def post_multi_param_groups( @distributed_trace def post_shared_parameter_group_object( self, - first_parameter_group=None, # type: Optional["models.FirstParameterGroup"] + first_parameter_group=None, # type: Optional["_models.FirstParameterGroup"] **kwargs # type: Any ): # type: (...) -> None @@ -289,7 +289,7 @@ def post_shared_parameter_group_object( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/azure/Expected/AcceptanceTests/AzureReport/azurereport/aio/operations/_auto_rest_report_service_for_azure_operations.py b/test/azure/Expected/AcceptanceTests/AzureReport/azurereport/aio/operations/_auto_rest_report_service_for_azure_operations.py index 73d79d3925c..4196dc3ff23 100644 --- a/test/azure/Expected/AcceptanceTests/AzureReport/azurereport/aio/operations/_auto_rest_report_service_for_azure_operations.py +++ b/test/azure/Expected/AcceptanceTests/AzureReport/azurereport/aio/operations/_auto_rest_report_service_for_azure_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -62,7 +62,7 @@ async def get_report( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{int}', pipeline_response) diff --git a/test/azure/Expected/AcceptanceTests/AzureReport/azurereport/operations/_auto_rest_report_service_for_azure_operations.py b/test/azure/Expected/AcceptanceTests/AzureReport/azurereport/operations/_auto_rest_report_service_for_azure_operations.py index 06125a03fa7..02d77629c89 100644 --- a/test/azure/Expected/AcceptanceTests/AzureReport/azurereport/operations/_auto_rest_report_service_for_azure_operations.py +++ b/test/azure/Expected/AcceptanceTests/AzureReport/azurereport/operations/_auto_rest_report_service_for_azure_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -67,7 +67,7 @@ def get_report( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{int}', pipeline_response) diff --git a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_api_version_default_operations.py b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_api_version_default_operations.py index bc27ff60a0d..c4654dd02bf 100644 --- a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_api_version_default_operations.py +++ b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_api_version_default_operations.py @@ -14,7 +14,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ApiVersionDefaultOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -78,7 +78,7 @@ async def get_method_global_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -123,7 +123,7 @@ async def get_method_global_not_provided_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -168,7 +168,7 @@ async def get_path_global_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -213,7 +213,7 @@ async def get_swagger_global_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_api_version_local_operations.py b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_api_version_local_operations.py index 35125b8549d..a8df0c531eb 100644 --- a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_api_version_local_operations.py +++ b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_api_version_local_operations.py @@ -14,7 +14,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ApiVersionLocalOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -78,7 +78,7 @@ async def get_method_local_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -127,7 +127,7 @@ async def get_method_local_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -172,7 +172,7 @@ async def get_path_local_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -217,7 +217,7 @@ async def get_swagger_local_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_header_operations.py b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_header_operations.py index 432bfad43c3..3f2ccd1d852 100644 --- a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_header_operations.py +++ b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_header_operations.py @@ -14,7 +14,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class HeaderOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def custom_named_request_id( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -94,7 +94,7 @@ async def custom_named_request_id( @distributed_trace_async async def custom_named_request_id_param_grouping( self, - header_custom_named_request_id_param_grouping_parameters: "models.HeaderCustomNamedRequestIdParamGroupingParameters", + header_custom_named_request_id_param_grouping_parameters: "_models.HeaderCustomNamedRequestIdParamGroupingParameters", **kwargs ) -> None: """Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request, @@ -135,7 +135,7 @@ async def custom_named_request_id_param_grouping( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -185,7 +185,7 @@ async def custom_named_request_id_head( if response.status_code not in [200, 404]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} diff --git a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_odata_operations.py b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_odata_operations.py index 8cb732e9836..9c474ba3ba5 100644 --- a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_odata_operations.py +++ b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_odata_operations.py @@ -14,7 +14,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class OdataOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -91,7 +91,7 @@ async def get_with_filter( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_skip_url_encoding_operations.py b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_skip_url_encoding_operations.py index edaa30eaea9..9cd493328fe 100644 --- a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_skip_url_encoding_operations.py +++ b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_skip_url_encoding_operations.py @@ -14,7 +14,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class SkipUrlEncodingOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -83,7 +83,7 @@ async def get_method_path_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -133,7 +133,7 @@ async def get_path_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -181,7 +181,7 @@ async def get_swagger_path_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -228,7 +228,7 @@ async def get_method_query_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -276,7 +276,7 @@ async def get_method_query_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -323,7 +323,7 @@ async def get_path_query_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -368,7 +368,7 @@ async def get_swagger_query_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_subscription_in_credentials_operations.py b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_subscription_in_credentials_operations.py index 920fe126bea..c830b2a666b 100644 --- a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_subscription_in_credentials_operations.py +++ b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_subscription_in_credentials_operations.py @@ -14,7 +14,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class SubscriptionInCredentialsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -81,7 +81,7 @@ async def post_method_global_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -129,7 +129,7 @@ async def post_method_global_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -179,7 +179,7 @@ async def post_method_global_not_provided_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -227,7 +227,7 @@ async def post_path_global_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -275,7 +275,7 @@ async def post_swagger_global_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_subscription_in_method_operations.py b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_subscription_in_method_operations.py index dc17266e194..746f49d72f5 100644 --- a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_subscription_in_method_operations.py +++ b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_subscription_in_method_operations.py @@ -14,7 +14,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class SubscriptionInMethodOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -85,7 +85,7 @@ async def post_method_local_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -137,7 +137,7 @@ async def post_method_local_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -188,7 +188,7 @@ async def post_path_local_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -240,7 +240,7 @@ async def post_swagger_local_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_xms_client_request_id_operations.py b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_xms_client_request_id_operations.py index 5dea13ffb2b..aa30a7c44e7 100644 --- a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_xms_client_request_id_operations.py +++ b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_xms_client_request_id_operations.py @@ -14,7 +14,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class XMsClientRequestIdOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -123,7 +123,7 @@ async def param_get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_api_version_default_operations.py b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_api_version_default_operations.py index 65dccf1ab33..8c72710dfa8 100644 --- a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_api_version_default_operations.py +++ b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_api_version_default_operations.py @@ -14,7 +14,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ApiVersionDefaultOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -83,7 +83,7 @@ def get_method_global_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -129,7 +129,7 @@ def get_method_global_not_provided_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -175,7 +175,7 @@ def get_path_global_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -221,7 +221,7 @@ def get_swagger_global_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_api_version_local_operations.py b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_api_version_local_operations.py index 8892018bc50..1623222c2c6 100644 --- a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_api_version_local_operations.py +++ b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_api_version_local_operations.py @@ -14,7 +14,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ApiVersionLocalOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -83,7 +83,7 @@ def get_method_local_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -133,7 +133,7 @@ def get_method_local_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -179,7 +179,7 @@ def get_path_local_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -225,7 +225,7 @@ def get_swagger_local_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_header_operations.py b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_header_operations.py index ac170212cd5..e87cda8543e 100644 --- a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_header_operations.py +++ b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_header_operations.py @@ -14,7 +14,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class HeaderOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def custom_named_request_id( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -99,7 +99,7 @@ def custom_named_request_id( @distributed_trace def custom_named_request_id_param_grouping( self, - header_custom_named_request_id_param_grouping_parameters, # type: "models.HeaderCustomNamedRequestIdParamGroupingParameters" + header_custom_named_request_id_param_grouping_parameters, # type: "_models.HeaderCustomNamedRequestIdParamGroupingParameters" **kwargs # type: Any ): # type: (...) -> None @@ -141,7 +141,7 @@ def custom_named_request_id_param_grouping( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -192,7 +192,7 @@ def custom_named_request_id_head( if response.status_code not in [200, 404]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} diff --git a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_odata_operations.py b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_odata_operations.py index 10547660693..76094b97a4e 100644 --- a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_odata_operations.py +++ b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_odata_operations.py @@ -14,7 +14,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class OdataOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -96,7 +96,7 @@ def get_with_filter( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_skip_url_encoding_operations.py b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_skip_url_encoding_operations.py index 50c8c762a4c..55a80ebf87b 100644 --- a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_skip_url_encoding_operations.py +++ b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_skip_url_encoding_operations.py @@ -14,7 +14,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class SkipUrlEncodingOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -88,7 +88,7 @@ def get_method_path_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -139,7 +139,7 @@ def get_path_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -188,7 +188,7 @@ def get_swagger_path_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -236,7 +236,7 @@ def get_method_query_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -285,7 +285,7 @@ def get_method_query_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -333,7 +333,7 @@ def get_path_query_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -379,7 +379,7 @@ def get_swagger_query_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_subscription_in_credentials_operations.py b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_subscription_in_credentials_operations.py index bdfca06e89c..df4fbe4a6a6 100644 --- a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_subscription_in_credentials_operations.py +++ b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_subscription_in_credentials_operations.py @@ -14,7 +14,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class SubscriptionInCredentialsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -86,7 +86,7 @@ def post_method_global_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -135,7 +135,7 @@ def post_method_global_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -186,7 +186,7 @@ def post_method_global_not_provided_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -235,7 +235,7 @@ def post_path_global_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -284,7 +284,7 @@ def post_swagger_global_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_subscription_in_method_operations.py b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_subscription_in_method_operations.py index b4dc4c3670a..30a9bc85b49 100644 --- a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_subscription_in_method_operations.py +++ b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_subscription_in_method_operations.py @@ -14,7 +14,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class SubscriptionInMethodOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -90,7 +90,7 @@ def post_method_local_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -143,7 +143,7 @@ def post_method_local_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -195,7 +195,7 @@ def post_path_local_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -248,7 +248,7 @@ def post_swagger_local_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_xms_client_request_id_operations.py b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_xms_client_request_id_operations.py index 602dcd2095a..da7061d321f 100644 --- a/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_xms_client_request_id_operations.py +++ b/test/azure/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_xms_client_request_id_operations.py @@ -14,7 +14,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class XMsClientRequestIdOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -129,7 +129,7 @@ def param_get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/azure/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/aio/operations/_paths_operations.py b/test/azure/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/aio/operations/_paths_operations.py index bd5c555cd2e..af03a881114 100644 --- a/test/azure/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/aio/operations/_paths_operations.py +++ b/test/azure/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/aio/operations/_paths_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class PathsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -83,7 +83,7 @@ async def get_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/azure/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/operations/_paths_operations.py b/test/azure/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/operations/_paths_operations.py index bf19d5d7cb8..0126f0f8310 100644 --- a/test/azure/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/operations/_paths_operations.py +++ b/test/azure/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/operations/_paths_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class PathsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -88,7 +88,7 @@ def get_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/azure/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/aio/operations/_paging_operations.py b/test/azure/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/aio/operations/_paging_operations.py index 58dea276f08..d05555216a4 100644 --- a/test/azure/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/aio/operations/_paging_operations.py +++ b/test/azure/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/aio/operations/_paging_operations.py @@ -16,7 +16,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PagingOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def get_pages_partial_url( self, account_name: str, **kwargs - ) -> AsyncIterable["models.ProductResult"]: + ) -> AsyncIterable["_models.ProductResult"]: """A paging operation that combines custom url, paging and partial URL and expect to concat after host. @@ -59,7 +59,7 @@ def get_pages_partial_url( :rtype: ~azure.core.async_paging.AsyncItemPaged[~custombaseurlpaging.models.ProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -123,7 +123,7 @@ def get_pages_partial_url_operation( self, account_name: str, **kwargs - ) -> AsyncIterable["models.ProductResult"]: + ) -> AsyncIterable["_models.ProductResult"]: """A paging operation that combines custom url, paging and partial URL with next operation. :param account_name: Account Name. @@ -133,7 +133,7 @@ def get_pages_partial_url_operation( :rtype: ~azure.core.async_paging.AsyncItemPaged[~custombaseurlpaging.models.ProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/azure/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/operations/_paging_operations.py b/test/azure/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/operations/_paging_operations.py index c9b116683d4..19a2434d393 100644 --- a/test/azure/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/operations/_paging_operations.py +++ b/test/azure/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/operations/_paging_operations.py @@ -15,7 +15,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class PagingOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get_pages_partial_url( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProductResult"] + # type: (...) -> Iterable["_models.ProductResult"] """A paging operation that combines custom url, paging and partial URL and expect to concat after host. @@ -63,7 +63,7 @@ def get_pages_partial_url( :rtype: ~azure.core.paging.ItemPaged[~custombaseurlpaging.models.ProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -128,7 +128,7 @@ def get_pages_partial_url_operation( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProductResult"] + # type: (...) -> Iterable["_models.ProductResult"] """A paging operation that combines custom url, paging and partial URL with next operation. :param account_name: Account Name. @@ -138,7 +138,7 @@ def get_pages_partial_url_operation( :rtype: ~azure.core.paging.ItemPaged[~custombaseurlpaging.models.ProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations/_lr_os_custom_header_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations/_lr_os_custom_header_operations.py index ccf003e4de4..604a8fa6ff1 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations/_lr_os_custom_header_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations/_lr_os_custom_header_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LROsCustomHeaderOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,10 +45,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def _put_async_retry_succeeded_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,9 +96,9 @@ async def _put_async_retry_succeeded_initial( @distributed_trace_async async def begin_put_async_retry_succeeded( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure- @@ -117,7 +117,7 @@ async def begin_put_async_retry_succeeded( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -161,10 +161,10 @@ def get_long_running_output(pipeline_response): async def _put201_creating_succeeded200_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -212,9 +212,9 @@ async def _put201_creating_succeeded200_initial( @distributed_trace_async async def begin_put201_creating_succeeded200( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll @@ -233,7 +233,7 @@ async def begin_put201_creating_succeeded200( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -272,7 +272,7 @@ def get_long_running_output(pipeline_response): async def _post202_retry200_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -320,7 +320,7 @@ async def _post202_retry200_initial( @distributed_trace_async async def begin_post202_retry200( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> AsyncLROPoller[None]: """x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for @@ -376,7 +376,7 @@ def get_long_running_output(pipeline_response): async def _post_async_retry_succeeded_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -425,7 +425,7 @@ async def _post_async_retry_succeeded_initial( @distributed_trace_async async def begin_post_async_retry_succeeded( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> AsyncLROPoller[None]: """x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations/_lro_retrys_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations/_lro_retrys_operations.py index 3ff501ef5c2..9e71104b755 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations/_lro_retrys_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations/_lro_retrys_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LRORetrysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,10 +45,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def _put201_creating_succeeded200_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,9 +96,9 @@ async def _put201_creating_succeeded200_initial( @distributed_trace_async async def begin_put201_creating_succeeded200( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -116,7 +116,7 @@ async def begin_put201_creating_succeeded200( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -155,10 +155,10 @@ def get_long_running_output(pipeline_response): async def _put_async_relative_retry_succeeded_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,9 +206,9 @@ async def _put_async_relative_retry_succeeded_initial( @distributed_trace_async async def begin_put_async_relative_retry_succeeded( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure- AsyncOperation header for operation status. @@ -226,7 +226,7 @@ async def begin_put_async_relative_retry_succeeded( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -271,8 +271,8 @@ def get_long_running_output(pipeline_response): async def _delete_provisioning202_accepted200_succeeded_initial( self, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -316,7 +316,7 @@ async def _delete_provisioning202_accepted200_succeeded_initial( async def begin_delete_provisioning202_accepted200_succeeded( self, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -332,7 +332,7 @@ async def begin_delete_provisioning202_accepted200_succeeded( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -555,7 +555,7 @@ def get_long_running_output(pipeline_response): async def _post202_retry200_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -603,7 +603,7 @@ async def _post202_retry200_initial( @distributed_trace_async async def begin_post202_retry200( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> AsyncLROPoller[None]: """Long running post request, service returns a 500, then a 202 to the initial request, with @@ -658,7 +658,7 @@ def get_long_running_output(pipeline_response): async def _post_async_relative_retry_succeeded_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -707,7 +707,7 @@ async def _post_async_relative_retry_succeeded_initial( @distributed_trace_async async def begin_post_async_relative_retry_succeeded( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> AsyncLROPoller[None]: """Long running post request, service returns a 500, then a 202 to the initial request, with an diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations/_lros_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations/_lros_operations.py index a247dde9e9f..01773fe4a2b 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations/_lros_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations/_lros_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LROsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,10 +45,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def _put200_succeeded_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> Optional["models.Product"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Product"]] + ) -> Optional["_models.Product"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -94,9 +94,9 @@ async def _put200_succeeded_initial( @distributed_trace_async async def begin_put200_succeeded( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. @@ -113,7 +113,7 @@ async def begin_put200_succeeded( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -152,10 +152,10 @@ def get_long_running_output(pipeline_response): async def _put201_succeeded_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -199,9 +199,9 @@ async def _put201_succeeded_initial( @distributed_trace_async async def begin_put201_succeeded( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. @@ -218,7 +218,7 @@ async def begin_put201_succeeded( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -258,8 +258,8 @@ def get_long_running_output(pipeline_response): async def _post202_list_initial( self, **kwargs - ) -> Optional[List["models.Product"]]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional[List["models.Product"]]] + ) -> Optional[List["_models.Product"]]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[List["_models.Product"]]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,7 +303,7 @@ async def _post202_list_initial( async def begin_post202_list( self, **kwargs - ) -> AsyncLROPoller[List["models.Product"]]: + ) -> AsyncLROPoller[List["_models.Product"]]: """Long running put request, service returns a 202 with empty body to first request, returns a 200 with body [{ 'id': '100', 'name': 'foo' }]. @@ -318,7 +318,7 @@ async def begin_post202_list( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Product"]] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -356,10 +356,10 @@ def get_long_running_output(pipeline_response): async def _put200_succeeded_no_state_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,9 +403,9 @@ async def _put200_succeeded_no_state_initial( @distributed_trace_async async def begin_put200_succeeded_no_state( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. @@ -422,7 +422,7 @@ async def begin_put200_succeeded_no_state( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -461,10 +461,10 @@ def get_long_running_output(pipeline_response): async def _put202_retry200_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -508,9 +508,9 @@ async def _put202_retry200_initial( @distributed_trace_async async def begin_put202_retry200( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. @@ -528,7 +528,7 @@ async def begin_put202_retry200( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -567,10 +567,10 @@ def get_long_running_output(pipeline_response): async def _put201_creating_succeeded200_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -618,9 +618,9 @@ async def _put201_creating_succeeded200_initial( @distributed_trace_async async def begin_put201_creating_succeeded200( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -638,7 +638,7 @@ async def begin_put201_creating_succeeded200( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -677,10 +677,10 @@ def get_long_running_output(pipeline_response): async def _put200_updating_succeeded204_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -724,9 +724,9 @@ async def _put200_updating_succeeded204_initial( @distributed_trace_async async def begin_put200_updating_succeeded204( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -744,7 +744,7 @@ async def begin_put200_updating_succeeded204( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -783,10 +783,10 @@ def get_long_running_output(pipeline_response): async def _put201_creating_failed200_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -834,9 +834,9 @@ async def _put201_creating_failed200_initial( @distributed_trace_async async def begin_put201_creating_failed200( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. @@ -854,7 +854,7 @@ async def begin_put201_creating_failed200( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -893,10 +893,10 @@ def get_long_running_output(pipeline_response): async def _put200_acceptedcanceled200_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -940,9 +940,9 @@ async def _put200_acceptedcanceled200_initial( @distributed_trace_async async def begin_put200_acceptedcanceled200( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. @@ -960,7 +960,7 @@ async def begin_put200_acceptedcanceled200( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -999,10 +999,10 @@ def get_long_running_output(pipeline_response): async def _put_no_header_in_retry_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1048,9 +1048,9 @@ async def _put_no_header_in_retry_initial( @distributed_trace_async async def begin_put_no_header_in_retry( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. @@ -1067,7 +1067,7 @@ async def begin_put_no_header_in_retry( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1109,10 +1109,10 @@ def get_long_running_output(pipeline_response): async def _put_async_retry_succeeded_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1160,9 +1160,9 @@ async def _put_async_retry_succeeded_initial( @distributed_trace_async async def begin_put_async_retry_succeeded( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1180,7 +1180,7 @@ async def begin_put_async_retry_succeeded( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1224,10 +1224,10 @@ def get_long_running_output(pipeline_response): async def _put_async_no_retry_succeeded_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1274,9 +1274,9 @@ async def _put_async_no_retry_succeeded_initial( @distributed_trace_async async def begin_put_async_no_retry_succeeded( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1294,7 +1294,7 @@ async def begin_put_async_no_retry_succeeded( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1337,10 +1337,10 @@ def get_long_running_output(pipeline_response): async def _put_async_retry_failed_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1388,9 +1388,9 @@ async def _put_async_retry_failed_initial( @distributed_trace_async async def begin_put_async_retry_failed( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1408,7 +1408,7 @@ async def begin_put_async_retry_failed( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1452,10 +1452,10 @@ def get_long_running_output(pipeline_response): async def _put_async_no_retrycanceled_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1502,9 +1502,9 @@ async def _put_async_no_retrycanceled_initial( @distributed_trace_async async def begin_put_async_no_retrycanceled( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1522,7 +1522,7 @@ async def begin_put_async_no_retrycanceled( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1565,10 +1565,10 @@ def get_long_running_output(pipeline_response): async def _put_async_no_header_in_retry_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1614,9 +1614,9 @@ async def _put_async_no_header_in_retry_initial( @distributed_trace_async async def begin_put_async_no_header_in_retry( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running put request, service returns a 202 to the initial request with Azure- AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. @@ -1634,7 +1634,7 @@ async def begin_put_async_no_header_in_retry( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1676,10 +1676,10 @@ def get_long_running_output(pipeline_response): async def _put_non_resource_initial( self, - sku: Optional["models.Sku"] = None, + sku: Optional["_models.Sku"] = None, **kwargs - ) -> "models.Sku": - cls = kwargs.pop('cls', None) # type: ClsType["models.Sku"] + ) -> "_models.Sku": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Sku"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1723,9 +1723,9 @@ async def _put_non_resource_initial( @distributed_trace_async async def begin_put_non_resource( self, - sku: Optional["models.Sku"] = None, + sku: Optional["_models.Sku"] = None, **kwargs - ) -> AsyncLROPoller["models.Sku"]: + ) -> AsyncLROPoller["_models.Sku"]: """Long running put request with non resource. :param sku: sku to put. @@ -1741,7 +1741,7 @@ async def begin_put_non_resource( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Sku"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Sku"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1780,10 +1780,10 @@ def get_long_running_output(pipeline_response): async def _put_async_non_resource_initial( self, - sku: Optional["models.Sku"] = None, + sku: Optional["_models.Sku"] = None, **kwargs - ) -> "models.Sku": - cls = kwargs.pop('cls', None) # type: ClsType["models.Sku"] + ) -> "_models.Sku": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Sku"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1827,9 +1827,9 @@ async def _put_async_non_resource_initial( @distributed_trace_async async def begin_put_async_non_resource( self, - sku: Optional["models.Sku"] = None, + sku: Optional["_models.Sku"] = None, **kwargs - ) -> AsyncLROPoller["models.Sku"]: + ) -> AsyncLROPoller["_models.Sku"]: """Long running put request with non resource. :param sku: Sku to put. @@ -1845,7 +1845,7 @@ async def begin_put_async_non_resource( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Sku"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Sku"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1886,14 +1886,14 @@ async def _put_sub_resource_initial( self, provisioning_state: Optional[str] = None, **kwargs - ) -> "models.SubProduct": - cls = kwargs.pop('cls', None) # type: ClsType["models.SubProduct"] + ) -> "_models.SubProduct": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubProduct"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - _product = models.SubProduct(provisioning_state=provisioning_state) + _product = _models.SubProduct(provisioning_state=provisioning_state) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1935,7 +1935,7 @@ async def begin_put_sub_resource( self, provisioning_state: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.SubProduct"]: + ) -> AsyncLROPoller["_models.SubProduct"]: """Long running put request with sub resource. :param provisioning_state: @@ -1951,7 +1951,7 @@ async def begin_put_sub_resource( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SubProduct"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubProduct"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1992,14 +1992,14 @@ async def _put_async_sub_resource_initial( self, provisioning_state: Optional[str] = None, **kwargs - ) -> "models.SubProduct": - cls = kwargs.pop('cls', None) # type: ClsType["models.SubProduct"] + ) -> "_models.SubProduct": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubProduct"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - _product = models.SubProduct(provisioning_state=provisioning_state) + _product = _models.SubProduct(provisioning_state=provisioning_state) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -2041,7 +2041,7 @@ async def begin_put_async_sub_resource( self, provisioning_state: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["models.SubProduct"]: + ) -> AsyncLROPoller["_models.SubProduct"]: """Long running put request with sub resource. :param provisioning_state: @@ -2057,7 +2057,7 @@ async def begin_put_async_sub_resource( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SubProduct"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubProduct"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2097,8 +2097,8 @@ def get_long_running_output(pipeline_response): async def _delete_provisioning202_accepted200_succeeded_initial( self, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2142,7 +2142,7 @@ async def _delete_provisioning202_accepted200_succeeded_initial( async def begin_delete_provisioning202_accepted200_succeeded( self, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -2158,7 +2158,7 @@ async def begin_delete_provisioning202_accepted200_succeeded( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2201,8 +2201,8 @@ def get_long_running_output(pipeline_response): async def _delete_provisioning202_deleting_failed200_initial( self, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2246,7 +2246,7 @@ async def _delete_provisioning202_deleting_failed200_initial( async def begin_delete_provisioning202_deleting_failed200( self, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. @@ -2262,7 +2262,7 @@ async def begin_delete_provisioning202_deleting_failed200( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2305,8 +2305,8 @@ def get_long_running_output(pipeline_response): async def _delete_provisioning202_deletingcanceled200_initial( self, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2350,7 +2350,7 @@ async def _delete_provisioning202_deletingcanceled200_initial( async def begin_delete_provisioning202_deletingcanceled200( self, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. @@ -2366,7 +2366,7 @@ async def begin_delete_provisioning202_deletingcanceled200( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2494,8 +2494,8 @@ def get_long_running_output(pipeline_response): async def _delete202_retry200_initial( self, **kwargs - ) -> Optional["models.Product"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Product"]] + ) -> Optional["_models.Product"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2539,7 +2539,7 @@ async def _delete202_retry200_initial( async def begin_delete202_retry200( self, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -2554,7 +2554,7 @@ async def begin_delete202_retry200( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2593,8 +2593,8 @@ def get_long_running_output(pipeline_response): async def _delete202_no_retry204_initial( self, **kwargs - ) -> Optional["models.Product"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Product"]] + ) -> Optional["_models.Product"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2638,7 +2638,7 @@ async def _delete202_no_retry204_initial( async def begin_delete202_no_retry204( self, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -2653,7 +2653,7 @@ async def begin_delete202_no_retry204( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -3236,8 +3236,8 @@ def get_long_running_output(pipeline_response): async def _post200_with_payload_initial( self, **kwargs - ) -> "models.Sku": - cls = kwargs.pop('cls', None) # type: ClsType["models.Sku"] + ) -> "_models.Sku": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Sku"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -3278,7 +3278,7 @@ async def _post200_with_payload_initial( async def begin_post200_with_payload( self, **kwargs - ) -> AsyncLROPoller["models.Sku"]: + ) -> AsyncLROPoller["_models.Sku"]: """Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. @@ -3293,7 +3293,7 @@ async def begin_post200_with_payload( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Sku"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Sku"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -3331,7 +3331,7 @@ def get_long_running_output(pipeline_response): async def _post202_retry200_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -3379,7 +3379,7 @@ async def _post202_retry200_initial( @distributed_trace_async async def begin_post202_retry200( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 to the initial request, with 'Location' and @@ -3434,10 +3434,10 @@ def get_long_running_output(pipeline_response): async def _post202_no_retry204_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -3484,9 +3484,9 @@ async def _post202_no_retry204_initial( @distributed_trace_async async def begin_post202_no_retry204( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. @@ -3503,7 +3503,7 @@ async def begin_post202_no_retry204( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -3547,8 +3547,8 @@ def get_long_running_output(pipeline_response): async def _post_double_headers_final_location_get_initial( self, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -3585,7 +3585,7 @@ async def _post_double_headers_final_location_get_initial( async def begin_post_double_headers_final_location_get( self, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should poll Location to get the final object. @@ -3601,7 +3601,7 @@ async def begin_post_double_headers_final_location_get( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -3640,8 +3640,8 @@ def get_long_running_output(pipeline_response): async def _post_double_headers_final_azure_header_get_initial( self, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -3678,7 +3678,7 @@ async def _post_double_headers_final_azure_header_get_initial( async def begin_post_double_headers_final_azure_header_get( self, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should NOT poll Location to get the final object. @@ -3694,7 +3694,7 @@ async def begin_post_double_headers_final_azure_header_get( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -3733,8 +3733,8 @@ def get_long_running_output(pipeline_response): async def _post_double_headers_final_azure_header_get_default_initial( self, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -3771,7 +3771,7 @@ async def _post_double_headers_final_azure_header_get_default_initial( async def begin_post_double_headers_final_azure_header_get_default( self, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should NOT poll Location to get the final object if you support initial Autorest behavior. @@ -3787,7 +3787,7 @@ async def begin_post_double_headers_final_azure_header_get_default( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -3825,10 +3825,10 @@ def get_long_running_output(pipeline_response): async def _post_async_retry_succeeded_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> Optional["models.Product"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Product"]] + ) -> Optional["_models.Product"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -3880,9 +3880,9 @@ async def _post_async_retry_succeeded_initial( @distributed_trace_async async def begin_post_async_retry_succeeded( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -3900,7 +3900,7 @@ async def begin_post_async_retry_succeeded( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -3939,10 +3939,10 @@ def get_long_running_output(pipeline_response): async def _post_async_no_retry_succeeded_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> Optional["models.Product"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Product"]] + ) -> Optional["_models.Product"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -3994,9 +3994,9 @@ async def _post_async_no_retry_succeeded_initial( @distributed_trace_async async def begin_post_async_no_retry_succeeded( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -4014,7 +4014,7 @@ async def begin_post_async_no_retry_succeeded( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -4053,7 +4053,7 @@ def get_long_running_output(pipeline_response): async def _post_async_retry_failed_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -4102,7 +4102,7 @@ async def _post_async_retry_failed_initial( @distributed_trace_async async def begin_post_async_retry_failed( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 to the initial request, with an entity that @@ -4158,7 +4158,7 @@ def get_long_running_output(pipeline_response): async def _post_async_retrycanceled_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -4207,7 +4207,7 @@ async def _post_async_retrycanceled_initial( @distributed_trace_async async def begin_post_async_retrycanceled( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 to the initial request, with an entity that diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations/_lrosads_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations/_lrosads_operations.py index 7364beed9ad..cf496a77757 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations/_lrosads_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations/_lrosads_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class LROSADsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,10 +45,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def _put_non_retry400_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,9 +96,9 @@ async def _put_non_retry400_initial( @distributed_trace_async async def begin_put_non_retry400( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running put request, service returns a 400 to the initial request. :param product: Product to put. @@ -114,7 +114,7 @@ async def begin_put_non_retry400( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,10 +153,10 @@ def get_long_running_output(pipeline_response): async def _put_non_retry201_creating400_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -204,9 +204,9 @@ async def _put_non_retry201_creating400_initial( @distributed_trace_async async def begin_put_non_retry201_creating400( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. @@ -223,7 +223,7 @@ async def begin_put_non_retry201_creating400( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -262,10 +262,10 @@ def get_long_running_output(pipeline_response): async def _put_non_retry201_creating400_invalid_json_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -313,9 +313,9 @@ async def _put_non_retry201_creating400_invalid_json_initial( @distributed_trace_async async def begin_put_non_retry201_creating400_invalid_json( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. @@ -332,7 +332,7 @@ async def begin_put_non_retry201_creating400_invalid_json( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -371,10 +371,10 @@ def get_long_running_output(pipeline_response): async def _put_async_relative_retry400_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -422,9 +422,9 @@ async def _put_async_relative_retry400_initial( @distributed_trace_async async def begin_put_async_relative_retry400( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -441,7 +441,7 @@ async def begin_put_async_relative_retry400( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -754,7 +754,7 @@ def get_long_running_output(pipeline_response): async def _post_non_retry400_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -802,7 +802,7 @@ async def _post_non_retry400_initial( @distributed_trace_async async def begin_post_non_retry400( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> AsyncLROPoller[None]: """Long running post request, service returns a 400 with no error body. @@ -856,7 +856,7 @@ def get_long_running_output(pipeline_response): async def _post202_non_retry400_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -904,7 +904,7 @@ async def _post202_non_retry400_initial( @distributed_trace_async async def begin_post202_non_retry400( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 with a location header. @@ -958,7 +958,7 @@ def get_long_running_output(pipeline_response): async def _post_async_relative_retry400_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1007,7 +1007,7 @@ async def _post_async_relative_retry400_initial( @distributed_trace_async async def begin_post_async_relative_retry400( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 to the initial request Poll the endpoint @@ -1062,10 +1062,10 @@ def get_long_running_output(pipeline_response): async def _put_error201_no_provisioning_state_payload_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1113,9 +1113,9 @@ async def _put_error201_no_provisioning_state_payload_initial( @distributed_trace_async async def begin_put_error201_no_provisioning_state_payload( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running put request, service returns a 201 to the initial request with no payload. :param product: Product to put. @@ -1131,7 +1131,7 @@ async def begin_put_error201_no_provisioning_state_payload( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1170,10 +1170,10 @@ def get_long_running_output(pipeline_response): async def _put_async_relative_retry_no_status_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1221,9 +1221,9 @@ async def _put_async_relative_retry_no_status_initial( @distributed_trace_async async def begin_put_async_relative_retry_no_status( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1241,7 +1241,7 @@ async def begin_put_async_relative_retry_no_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1285,10 +1285,10 @@ def get_long_running_output(pipeline_response): async def _put_async_relative_retry_no_status_payload_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1336,9 +1336,9 @@ async def _put_async_relative_retry_no_status_payload_initial( @distributed_trace_async async def begin_put_async_relative_retry_no_status_payload( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1356,7 +1356,7 @@ async def begin_put_async_relative_retry_no_status_payload( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1576,7 +1576,7 @@ def get_long_running_output(pipeline_response): async def _post202_no_location_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1624,7 +1624,7 @@ async def _post202_no_location_initial( @distributed_trace_async async def begin_post202_no_location( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 to the initial request, without a location @@ -1679,7 +1679,7 @@ def get_long_running_output(pipeline_response): async def _post_async_relative_retry_no_payload_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1728,7 +1728,7 @@ async def _post_async_relative_retry_no_payload_initial( @distributed_trace_async async def begin_post_async_relative_retry_no_payload( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 to the initial request, with an entity that @@ -1784,10 +1784,10 @@ def get_long_running_output(pipeline_response): async def _put200_invalid_json_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> Optional["models.Product"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Product"]] + ) -> Optional["_models.Product"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1833,9 +1833,9 @@ async def _put200_invalid_json_initial( @distributed_trace_async async def begin_put200_invalid_json( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. @@ -1852,7 +1852,7 @@ async def begin_put200_invalid_json( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1891,10 +1891,10 @@ def get_long_running_output(pipeline_response): async def _put_async_relative_retry_invalid_header_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1942,9 +1942,9 @@ async def _put_async_relative_retry_invalid_header_initial( @distributed_trace_async async def begin_put_async_relative_retry_invalid_header( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. @@ -1962,7 +1962,7 @@ async def begin_put_async_relative_retry_invalid_header( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2006,10 +2006,10 @@ def get_long_running_output(pipeline_response): async def _put_async_relative_retry_invalid_json_polling_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + ) -> "_models.Product": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2057,9 +2057,9 @@ async def _put_async_relative_retry_invalid_json_polling_initial( @distributed_trace_async async def begin_put_async_relative_retry_invalid_json_polling( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -2077,7 +2077,7 @@ async def begin_put_async_relative_retry_invalid_json_polling( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2393,7 +2393,7 @@ def get_long_running_output(pipeline_response): async def _post202_retry_invalid_header_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -2441,7 +2441,7 @@ async def _post202_retry_invalid_header_initial( @distributed_trace_async async def begin_post202_retry_invalid_header( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 to the initial request, with invalid @@ -2496,7 +2496,7 @@ def get_long_running_output(pipeline_response): async def _post_async_relative_retry_invalid_header_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -2545,7 +2545,7 @@ async def _post_async_relative_retry_invalid_header_initial( @distributed_trace_async async def begin_post_async_relative_retry_invalid_header( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 to the initial request, with an entity that @@ -2601,7 +2601,7 @@ def get_long_running_output(pipeline_response): async def _post_async_relative_retry_invalid_json_polling_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -2650,7 +2650,7 @@ async def _post_async_relative_retry_invalid_json_polling_initial( @distributed_trace_async async def begin_post_async_relative_retry_invalid_json_polling( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 to the initial request, with an entity that diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py index e86f011469a..27479049db6 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LROsCustomHeaderOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,11 +49,11 @@ def __init__(self, client, config, serializer, deserializer): def _put_async_retry_succeeded_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -101,10 +101,10 @@ def _put_async_retry_succeeded_initial( @distributed_trace def begin_put_async_retry_succeeded( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure- @@ -123,7 +123,7 @@ def begin_put_async_retry_succeeded( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -167,11 +167,11 @@ def get_long_running_output(pipeline_response): def _put201_creating_succeeded200_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,10 +219,10 @@ def _put201_creating_succeeded200_initial( @distributed_trace def begin_put201_creating_succeeded200( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll @@ -241,7 +241,7 @@ def begin_put201_creating_succeeded200( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -280,7 +280,7 @@ def get_long_running_output(pipeline_response): def _post202_retry200_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> None @@ -329,7 +329,7 @@ def _post202_retry200_initial( @distributed_trace def begin_post202_retry200( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -386,7 +386,7 @@ def get_long_running_output(pipeline_response): def _post_async_retry_succeeded_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> None @@ -436,7 +436,7 @@ def _post_async_retry_succeeded_initial( @distributed_trace def begin_post_async_retry_succeeded( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py index 13e5eb75577..66119d38f27 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LRORetrysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,11 +49,11 @@ def __init__(self, client, config, serializer, deserializer): def _put201_creating_succeeded200_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -101,10 +101,10 @@ def _put201_creating_succeeded200_initial( @distributed_trace def begin_put201_creating_succeeded200( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -122,7 +122,7 @@ def begin_put201_creating_succeeded200( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -161,11 +161,11 @@ def get_long_running_output(pipeline_response): def _put_async_relative_retry_succeeded_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -213,10 +213,10 @@ def _put_async_relative_retry_succeeded_initial( @distributed_trace def begin_put_async_relative_retry_succeeded( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure- AsyncOperation header for operation status. @@ -234,7 +234,7 @@ def begin_put_async_relative_retry_succeeded( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -280,8 +280,8 @@ def _delete_provisioning202_accepted200_succeeded_initial( self, **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -326,7 +326,7 @@ def begin_delete_provisioning202_accepted200_succeeded( self, **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -342,7 +342,7 @@ def begin_delete_provisioning202_accepted200_succeeded( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -569,7 +569,7 @@ def get_long_running_output(pipeline_response): def _post202_retry200_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> None @@ -618,7 +618,7 @@ def _post202_retry200_initial( @distributed_trace def begin_post202_retry200( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -674,7 +674,7 @@ def get_long_running_output(pipeline_response): def _post_async_relative_retry_succeeded_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> None @@ -724,7 +724,7 @@ def _post_async_relative_retry_succeeded_initial( @distributed_trace def begin_post_async_relative_retry_succeeded( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py index 318008a4d55..6e456421016 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LROsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,11 +49,11 @@ def __init__(self, client, config, serializer, deserializer): def _put200_succeeded_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> Optional["models.Product"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Product"]] + # type: (...) -> Optional["_models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -99,10 +99,10 @@ def _put200_succeeded_initial( @distributed_trace def begin_put200_succeeded( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. @@ -119,7 +119,7 @@ def begin_put200_succeeded( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,11 +158,11 @@ def get_long_running_output(pipeline_response): def _put201_succeeded_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,10 +206,10 @@ def _put201_succeeded_initial( @distributed_trace def begin_put201_succeeded( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. @@ -226,7 +226,7 @@ def begin_put201_succeeded( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -267,8 +267,8 @@ def _post202_list_initial( self, **kwargs # type: Any ): - # type: (...) -> Optional[List["models.Product"]] - cls = kwargs.pop('cls', None) # type: ClsType[Optional[List["models.Product"]]] + # type: (...) -> Optional[List["_models.Product"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[List["_models.Product"]]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -313,7 +313,7 @@ def begin_post202_list( self, **kwargs # type: Any ): - # type: (...) -> LROPoller[List["models.Product"]] + # type: (...) -> LROPoller[List["_models.Product"]] """Long running put request, service returns a 202 with empty body to first request, returns a 200 with body [{ 'id': '100', 'name': 'foo' }]. @@ -328,7 +328,7 @@ def begin_post202_list( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Product"]] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -366,11 +366,11 @@ def get_long_running_output(pipeline_response): def _put200_succeeded_no_state_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,10 +414,10 @@ def _put200_succeeded_no_state_initial( @distributed_trace def begin_put200_succeeded_no_state( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. @@ -434,7 +434,7 @@ def begin_put200_succeeded_no_state( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -473,11 +473,11 @@ def get_long_running_output(pipeline_response): def _put202_retry200_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -521,10 +521,10 @@ def _put202_retry200_initial( @distributed_trace def begin_put202_retry200( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. @@ -542,7 +542,7 @@ def begin_put202_retry200( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -581,11 +581,11 @@ def get_long_running_output(pipeline_response): def _put201_creating_succeeded200_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -633,10 +633,10 @@ def _put201_creating_succeeded200_initial( @distributed_trace def begin_put201_creating_succeeded200( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -654,7 +654,7 @@ def begin_put201_creating_succeeded200( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -693,11 +693,11 @@ def get_long_running_output(pipeline_response): def _put200_updating_succeeded204_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -741,10 +741,10 @@ def _put200_updating_succeeded204_initial( @distributed_trace def begin_put200_updating_succeeded204( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -762,7 +762,7 @@ def begin_put200_updating_succeeded204( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -801,11 +801,11 @@ def get_long_running_output(pipeline_response): def _put201_creating_failed200_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -853,10 +853,10 @@ def _put201_creating_failed200_initial( @distributed_trace def begin_put201_creating_failed200( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. @@ -874,7 +874,7 @@ def begin_put201_creating_failed200( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -913,11 +913,11 @@ def get_long_running_output(pipeline_response): def _put200_acceptedcanceled200_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -961,10 +961,10 @@ def _put200_acceptedcanceled200_initial( @distributed_trace def begin_put200_acceptedcanceled200( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. @@ -982,7 +982,7 @@ def begin_put200_acceptedcanceled200( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1021,11 +1021,11 @@ def get_long_running_output(pipeline_response): def _put_no_header_in_retry_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1071,10 +1071,10 @@ def _put_no_header_in_retry_initial( @distributed_trace def begin_put_no_header_in_retry( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. @@ -1091,7 +1091,7 @@ def begin_put_no_header_in_retry( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1133,11 +1133,11 @@ def get_long_running_output(pipeline_response): def _put_async_retry_succeeded_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1185,10 +1185,10 @@ def _put_async_retry_succeeded_initial( @distributed_trace def begin_put_async_retry_succeeded( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1206,7 +1206,7 @@ def begin_put_async_retry_succeeded( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1250,11 +1250,11 @@ def get_long_running_output(pipeline_response): def _put_async_no_retry_succeeded_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1301,10 +1301,10 @@ def _put_async_no_retry_succeeded_initial( @distributed_trace def begin_put_async_no_retry_succeeded( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1322,7 +1322,7 @@ def begin_put_async_no_retry_succeeded( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1365,11 +1365,11 @@ def get_long_running_output(pipeline_response): def _put_async_retry_failed_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1417,10 +1417,10 @@ def _put_async_retry_failed_initial( @distributed_trace def begin_put_async_retry_failed( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1438,7 +1438,7 @@ def begin_put_async_retry_failed( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1482,11 +1482,11 @@ def get_long_running_output(pipeline_response): def _put_async_no_retrycanceled_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1533,10 +1533,10 @@ def _put_async_no_retrycanceled_initial( @distributed_trace def begin_put_async_no_retrycanceled( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1554,7 +1554,7 @@ def begin_put_async_no_retrycanceled( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1597,11 +1597,11 @@ def get_long_running_output(pipeline_response): def _put_async_no_header_in_retry_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1647,10 +1647,10 @@ def _put_async_no_header_in_retry_initial( @distributed_trace def begin_put_async_no_header_in_retry( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running put request, service returns a 202 to the initial request with Azure- AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. @@ -1668,7 +1668,7 @@ def begin_put_async_no_header_in_retry( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1710,11 +1710,11 @@ def get_long_running_output(pipeline_response): def _put_non_resource_initial( self, - sku=None, # type: Optional["models.Sku"] + sku=None, # type: Optional["_models.Sku"] **kwargs # type: Any ): - # type: (...) -> "models.Sku" - cls = kwargs.pop('cls', None) # type: ClsType["models.Sku"] + # type: (...) -> "_models.Sku" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Sku"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1758,10 +1758,10 @@ def _put_non_resource_initial( @distributed_trace def begin_put_non_resource( self, - sku=None, # type: Optional["models.Sku"] + sku=None, # type: Optional["_models.Sku"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Sku"] + # type: (...) -> LROPoller["_models.Sku"] """Long running put request with non resource. :param sku: sku to put. @@ -1777,7 +1777,7 @@ def begin_put_non_resource( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Sku"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Sku"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1816,11 +1816,11 @@ def get_long_running_output(pipeline_response): def _put_async_non_resource_initial( self, - sku=None, # type: Optional["models.Sku"] + sku=None, # type: Optional["_models.Sku"] **kwargs # type: Any ): - # type: (...) -> "models.Sku" - cls = kwargs.pop('cls', None) # type: ClsType["models.Sku"] + # type: (...) -> "_models.Sku" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Sku"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1864,10 +1864,10 @@ def _put_async_non_resource_initial( @distributed_trace def begin_put_async_non_resource( self, - sku=None, # type: Optional["models.Sku"] + sku=None, # type: Optional["_models.Sku"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Sku"] + # type: (...) -> LROPoller["_models.Sku"] """Long running put request with non resource. :param sku: Sku to put. @@ -1883,7 +1883,7 @@ def begin_put_async_non_resource( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Sku"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Sku"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1925,14 +1925,14 @@ def _put_sub_resource_initial( provisioning_state=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.SubProduct" - cls = kwargs.pop('cls', None) # type: ClsType["models.SubProduct"] + # type: (...) -> "_models.SubProduct" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubProduct"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - _product = models.SubProduct(provisioning_state=provisioning_state) + _product = _models.SubProduct(provisioning_state=provisioning_state) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1975,7 +1975,7 @@ def begin_put_sub_resource( provisioning_state=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SubProduct"] + # type: (...) -> LROPoller["_models.SubProduct"] """Long running put request with sub resource. :param provisioning_state: @@ -1991,7 +1991,7 @@ def begin_put_sub_resource( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SubProduct"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubProduct"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2033,14 +2033,14 @@ def _put_async_sub_resource_initial( provisioning_state=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.SubProduct" - cls = kwargs.pop('cls', None) # type: ClsType["models.SubProduct"] + # type: (...) -> "_models.SubProduct" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubProduct"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - _product = models.SubProduct(provisioning_state=provisioning_state) + _product = _models.SubProduct(provisioning_state=provisioning_state) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -2083,7 +2083,7 @@ def begin_put_async_sub_resource( provisioning_state=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.SubProduct"] + # type: (...) -> LROPoller["_models.SubProduct"] """Long running put request with sub resource. :param provisioning_state: @@ -2099,7 +2099,7 @@ def begin_put_async_sub_resource( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.SubProduct"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubProduct"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2140,8 +2140,8 @@ def _delete_provisioning202_accepted200_succeeded_initial( self, **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2186,7 +2186,7 @@ def begin_delete_provisioning202_accepted200_succeeded( self, **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -2202,7 +2202,7 @@ def begin_delete_provisioning202_accepted200_succeeded( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2246,8 +2246,8 @@ def _delete_provisioning202_deleting_failed200_initial( self, **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2292,7 +2292,7 @@ def begin_delete_provisioning202_deleting_failed200( self, **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. @@ -2308,7 +2308,7 @@ def begin_delete_provisioning202_deleting_failed200( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2352,8 +2352,8 @@ def _delete_provisioning202_deletingcanceled200_initial( self, **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2398,7 +2398,7 @@ def begin_delete_provisioning202_deletingcanceled200( self, **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. @@ -2414,7 +2414,7 @@ def begin_delete_provisioning202_deletingcanceled200( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2545,8 +2545,8 @@ def _delete202_retry200_initial( self, **kwargs # type: Any ): - # type: (...) -> Optional["models.Product"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Product"]] + # type: (...) -> Optional["_models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2591,7 +2591,7 @@ def begin_delete202_retry200( self, **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -2606,7 +2606,7 @@ def begin_delete202_retry200( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2646,8 +2646,8 @@ def _delete202_no_retry204_initial( self, **kwargs # type: Any ): - # type: (...) -> Optional["models.Product"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Product"]] + # type: (...) -> Optional["_models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2692,7 +2692,7 @@ def begin_delete202_no_retry204( self, **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -2707,7 +2707,7 @@ def begin_delete202_no_retry204( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -3303,8 +3303,8 @@ def _post200_with_payload_initial( self, **kwargs # type: Any ): - # type: (...) -> "models.Sku" - cls = kwargs.pop('cls', None) # type: ClsType["models.Sku"] + # type: (...) -> "_models.Sku" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Sku"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -3346,7 +3346,7 @@ def begin_post200_with_payload( self, **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Sku"] + # type: (...) -> LROPoller["_models.Sku"] """Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. @@ -3361,7 +3361,7 @@ def begin_post200_with_payload( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Sku"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Sku"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -3399,7 +3399,7 @@ def get_long_running_output(pipeline_response): def _post202_retry200_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> None @@ -3448,7 +3448,7 @@ def _post202_retry200_initial( @distributed_trace def begin_post202_retry200( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -3504,11 +3504,11 @@ def get_long_running_output(pipeline_response): def _post202_no_retry204_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -3555,10 +3555,10 @@ def _post202_no_retry204_initial( @distributed_trace def begin_post202_no_retry204( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. @@ -3575,7 +3575,7 @@ def begin_post202_no_retry204( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -3620,8 +3620,8 @@ def _post_double_headers_final_location_get_initial( self, **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -3659,7 +3659,7 @@ def begin_post_double_headers_final_location_get( self, **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should poll Location to get the final object. @@ -3675,7 +3675,7 @@ def begin_post_double_headers_final_location_get( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -3715,8 +3715,8 @@ def _post_double_headers_final_azure_header_get_initial( self, **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -3754,7 +3754,7 @@ def begin_post_double_headers_final_azure_header_get( self, **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should NOT poll Location to get the final object. @@ -3770,7 +3770,7 @@ def begin_post_double_headers_final_azure_header_get( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -3810,8 +3810,8 @@ def _post_double_headers_final_azure_header_get_default_initial( self, **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -3849,7 +3849,7 @@ def begin_post_double_headers_final_azure_header_get_default( self, **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should NOT poll Location to get the final object if you support initial Autorest behavior. @@ -3865,7 +3865,7 @@ def begin_post_double_headers_final_azure_header_get_default( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -3903,11 +3903,11 @@ def get_long_running_output(pipeline_response): def _post_async_retry_succeeded_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> Optional["models.Product"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Product"]] + # type: (...) -> Optional["_models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -3959,10 +3959,10 @@ def _post_async_retry_succeeded_initial( @distributed_trace def begin_post_async_retry_succeeded( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -3980,7 +3980,7 @@ def begin_post_async_retry_succeeded( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -4019,11 +4019,11 @@ def get_long_running_output(pipeline_response): def _post_async_no_retry_succeeded_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> Optional["models.Product"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Product"]] + # type: (...) -> Optional["_models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -4075,10 +4075,10 @@ def _post_async_no_retry_succeeded_initial( @distributed_trace def begin_post_async_no_retry_succeeded( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -4096,7 +4096,7 @@ def begin_post_async_no_retry_succeeded( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -4135,7 +4135,7 @@ def get_long_running_output(pipeline_response): def _post_async_retry_failed_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> None @@ -4185,7 +4185,7 @@ def _post_async_retry_failed_initial( @distributed_trace def begin_post_async_retry_failed( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -4242,7 +4242,7 @@ def get_long_running_output(pipeline_response): def _post_async_retrycanceled_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> None @@ -4292,7 +4292,7 @@ def _post_async_retrycanceled_initial( @distributed_trace def begin_post_async_retrycanceled( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py index e7d9b874dca..cc919963735 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class LROSADsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,11 +49,11 @@ def __init__(self, client, config, serializer, deserializer): def _put_non_retry400_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -101,10 +101,10 @@ def _put_non_retry400_initial( @distributed_trace def begin_put_non_retry400( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running put request, service returns a 400 to the initial request. :param product: Product to put. @@ -120,7 +120,7 @@ def begin_put_non_retry400( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,11 +159,11 @@ def get_long_running_output(pipeline_response): def _put_non_retry201_creating400_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,10 +211,10 @@ def _put_non_retry201_creating400_initial( @distributed_trace def begin_put_non_retry201_creating400( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. @@ -231,7 +231,7 @@ def begin_put_non_retry201_creating400( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -270,11 +270,11 @@ def get_long_running_output(pipeline_response): def _put_non_retry201_creating400_invalid_json_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -322,10 +322,10 @@ def _put_non_retry201_creating400_invalid_json_initial( @distributed_trace def begin_put_non_retry201_creating400_invalid_json( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. @@ -342,7 +342,7 @@ def begin_put_non_retry201_creating400_invalid_json( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -381,11 +381,11 @@ def get_long_running_output(pipeline_response): def _put_async_relative_retry400_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -433,10 +433,10 @@ def _put_async_relative_retry400_initial( @distributed_trace def begin_put_async_relative_retry400( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -453,7 +453,7 @@ def begin_put_async_relative_retry400( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -772,7 +772,7 @@ def get_long_running_output(pipeline_response): def _post_non_retry400_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> None @@ -821,7 +821,7 @@ def _post_non_retry400_initial( @distributed_trace def begin_post_non_retry400( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -876,7 +876,7 @@ def get_long_running_output(pipeline_response): def _post202_non_retry400_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> None @@ -925,7 +925,7 @@ def _post202_non_retry400_initial( @distributed_trace def begin_post202_non_retry400( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -980,7 +980,7 @@ def get_long_running_output(pipeline_response): def _post_async_relative_retry400_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> None @@ -1030,7 +1030,7 @@ def _post_async_relative_retry400_initial( @distributed_trace def begin_post_async_relative_retry400( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1086,11 +1086,11 @@ def get_long_running_output(pipeline_response): def _put_error201_no_provisioning_state_payload_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1138,10 +1138,10 @@ def _put_error201_no_provisioning_state_payload_initial( @distributed_trace def begin_put_error201_no_provisioning_state_payload( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running put request, service returns a 201 to the initial request with no payload. :param product: Product to put. @@ -1157,7 +1157,7 @@ def begin_put_error201_no_provisioning_state_payload( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1196,11 +1196,11 @@ def get_long_running_output(pipeline_response): def _put_async_relative_retry_no_status_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1248,10 +1248,10 @@ def _put_async_relative_retry_no_status_initial( @distributed_trace def begin_put_async_relative_retry_no_status( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1269,7 +1269,7 @@ def begin_put_async_relative_retry_no_status( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1313,11 +1313,11 @@ def get_long_running_output(pipeline_response): def _put_async_relative_retry_no_status_payload_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1365,10 +1365,10 @@ def _put_async_relative_retry_no_status_payload_initial( @distributed_trace def begin_put_async_relative_retry_no_status_payload( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1386,7 +1386,7 @@ def begin_put_async_relative_retry_no_status_payload( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1610,7 +1610,7 @@ def get_long_running_output(pipeline_response): def _post202_no_location_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> None @@ -1659,7 +1659,7 @@ def _post202_no_location_initial( @distributed_trace def begin_post202_no_location( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1715,7 +1715,7 @@ def get_long_running_output(pipeline_response): def _post_async_relative_retry_no_payload_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> None @@ -1765,7 +1765,7 @@ def _post_async_relative_retry_no_payload_initial( @distributed_trace def begin_post_async_relative_retry_no_payload( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1822,11 +1822,11 @@ def get_long_running_output(pipeline_response): def _put200_invalid_json_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> Optional["models.Product"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Product"]] + # type: (...) -> Optional["_models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1872,10 +1872,10 @@ def _put200_invalid_json_initial( @distributed_trace def begin_put200_invalid_json( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. @@ -1892,7 +1892,7 @@ def begin_put200_invalid_json( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1931,11 +1931,11 @@ def get_long_running_output(pipeline_response): def _put_async_relative_retry_invalid_header_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1983,10 +1983,10 @@ def _put_async_relative_retry_invalid_header_initial( @distributed_trace def begin_put_async_relative_retry_invalid_header( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. @@ -2004,7 +2004,7 @@ def begin_put_async_relative_retry_invalid_header( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2048,11 +2048,11 @@ def get_long_running_output(pipeline_response): def _put_async_relative_retry_invalid_json_polling_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + # type: (...) -> "_models.Product" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2100,10 +2100,10 @@ def _put_async_relative_retry_invalid_json_polling_initial( @distributed_trace def begin_put_async_relative_retry_invalid_json_polling( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -2121,7 +2121,7 @@ def begin_put_async_relative_retry_invalid_json_polling( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2443,7 +2443,7 @@ def get_long_running_output(pipeline_response): def _post202_retry_invalid_header_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> None @@ -2492,7 +2492,7 @@ def _post202_retry_invalid_header_initial( @distributed_trace def begin_post202_retry_invalid_header( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -2548,7 +2548,7 @@ def get_long_running_output(pipeline_response): def _post_async_relative_retry_invalid_header_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> None @@ -2598,7 +2598,7 @@ def _post_async_relative_retry_invalid_header_initial( @distributed_trace def begin_post_async_relative_retry_invalid_header( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -2655,7 +2655,7 @@ def get_long_running_output(pipeline_response): def _post_async_relative_retry_invalid_json_polling_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> None @@ -2705,7 +2705,7 @@ def _post_async_relative_retry_invalid_json_polling_initial( @distributed_trace def begin_post_async_relative_retry_invalid_json_polling( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] diff --git a/test/azure/Expected/AcceptanceTests/LroWithParameterizedEndpoints/lrowithparameterizedendpoints/aio/operations/_lro_with_paramaterized_endpoints_operations.py b/test/azure/Expected/AcceptanceTests/LroWithParameterizedEndpoints/lrowithparameterizedendpoints/aio/operations/_lro_with_paramaterized_endpoints_operations.py index f167898698a..7d62d12bcad 100644 --- a/test/azure/Expected/AcceptanceTests/LroWithParameterizedEndpoints/lrowithparameterizedendpoints/aio/operations/_lro_with_paramaterized_endpoints_operations.py +++ b/test/azure/Expected/AcceptanceTests/LroWithParameterizedEndpoints/lrowithparameterizedendpoints/aio/operations/_lro_with_paramaterized_endpoints_operations.py @@ -15,7 +15,7 @@ from azure.core.polling.async_base_polling import AsyncLROBasePolling from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -55,7 +55,7 @@ async def _poll_with_parameterized_endpoints_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} diff --git a/test/azure/Expected/AcceptanceTests/LroWithParameterizedEndpoints/lrowithparameterizedendpoints/operations/_lro_with_paramaterized_endpoints_operations.py b/test/azure/Expected/AcceptanceTests/LroWithParameterizedEndpoints/lrowithparameterizedendpoints/operations/_lro_with_paramaterized_endpoints_operations.py index 4949647a0cb..e480cbb741f 100644 --- a/test/azure/Expected/AcceptanceTests/LroWithParameterizedEndpoints/lrowithparameterizedendpoints/operations/_lro_with_paramaterized_endpoints_operations.py +++ b/test/azure/Expected/AcceptanceTests/LroWithParameterizedEndpoints/lrowithparameterizedendpoints/operations/_lro_with_paramaterized_endpoints_operations.py @@ -15,7 +15,7 @@ from azure.core.polling.base_polling import LROBasePolling from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -60,7 +60,7 @@ def _poll_with_parameterized_endpoints_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} diff --git a/test/azure/Expected/AcceptanceTests/Paging/paging/aio/operations/_paging_operations.py b/test/azure/Expected/AcceptanceTests/Paging/paging/aio/operations/_paging_operations.py index 78b69372d00..8eee8e75ea7 100644 --- a/test/azure/Expected/AcceptanceTests/Paging/paging/aio/operations/_paging_operations.py +++ b/test/azure/Expected/AcceptanceTests/Paging/paging/aio/operations/_paging_operations.py @@ -18,7 +18,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -37,7 +37,7 @@ class PagingOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def get_no_item_name_pages( self, **kwargs - ) -> AsyncIterable["models.ProductResultValue"]: + ) -> AsyncIterable["_models.ProductResultValue"]: """A paging operation that must return result of the default 'value' node. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def get_no_item_name_pages( :rtype: ~azure.core.async_paging.AsyncItemPaged[~paging.models.ProductResultValue] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResultValue"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResultValue"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,7 +110,7 @@ async def get_next(next_link=None): def get_null_next_link_name_pages( self, **kwargs - ) -> AsyncIterable["models.ProductResult"]: + ) -> AsyncIterable["_models.ProductResult"]: """A paging operation that must ignore any kind of nextLink, and stop after page 1. :keyword callable cls: A custom type or function that will be passed the direct response @@ -118,7 +118,7 @@ def get_null_next_link_name_pages( :rtype: ~azure.core.async_paging.AsyncItemPaged[~paging.models.ProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -171,7 +171,7 @@ async def get_next(next_link=None): def get_single_pages( self, **kwargs - ) -> AsyncIterable["models.ProductResult"]: + ) -> AsyncIterable["_models.ProductResult"]: """A paging operation that finishes on the first call without a nextlink. :keyword callable cls: A custom type or function that will be passed the direct response @@ -179,7 +179,7 @@ def get_single_pages( :rtype: ~azure.core.async_paging.AsyncItemPaged[~paging.models.ProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -232,9 +232,9 @@ async def get_next(next_link=None): def get_multiple_pages( self, client_request_id: Optional[str] = None, - paging_get_multiple_pages_options: Optional["models.PagingGetMultiplePagesOptions"] = None, + paging_get_multiple_pages_options: Optional["_models.PagingGetMultiplePagesOptions"] = None, **kwargs - ) -> AsyncIterable["models.ProductResult"]: + ) -> AsyncIterable["_models.ProductResult"]: """A paging operation that includes a nextLink that has 10 pages. :param client_request_id: @@ -246,7 +246,7 @@ def get_multiple_pages( :rtype: ~azure.core.async_paging.AsyncItemPaged[~paging.models.ProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -312,7 +312,7 @@ def get_with_query_params( self, required_query_parameter: int, **kwargs - ) -> AsyncIterable["models.ProductResult"]: + ) -> AsyncIterable["_models.ProductResult"]: """A paging operation that includes a next operation. It has a different query parameter from it's next operation nextOperationWithQueryParams. Returns a ProductResult. @@ -324,7 +324,7 @@ def get_with_query_params( :rtype: ~azure.core.async_paging.AsyncItemPaged[~paging.models.ProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -383,9 +383,9 @@ async def get_next(next_link=None): def get_odata_multiple_pages( self, client_request_id: Optional[str] = None, - paging_get_odata_multiple_pages_options: Optional["models.PagingGetOdataMultiplePagesOptions"] = None, + paging_get_odata_multiple_pages_options: Optional["_models.PagingGetOdataMultiplePagesOptions"] = None, **kwargs - ) -> AsyncIterable["models.OdataProductResult"]: + ) -> AsyncIterable["_models.OdataProductResult"]: """A paging operation that includes a nextLink in odata format that has 10 pages. :param client_request_id: @@ -397,7 +397,7 @@ def get_odata_multiple_pages( :rtype: ~azure.core.async_paging.AsyncItemPaged[~paging.models.OdataProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OdataProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OdataProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -461,10 +461,10 @@ async def get_next(next_link=None): @distributed_trace def get_multiple_pages_with_offset( self, - paging_get_multiple_pages_with_offset_options: "models.PagingGetMultiplePagesWithOffsetOptions", + paging_get_multiple_pages_with_offset_options: "_models.PagingGetMultiplePagesWithOffsetOptions", client_request_id: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.ProductResult"]: + ) -> AsyncIterable["_models.ProductResult"]: """A paging operation that includes a nextLink that has 10 pages. :param paging_get_multiple_pages_with_offset_options: Parameter group. @@ -476,7 +476,7 @@ def get_multiple_pages_with_offset( :rtype: ~azure.core.async_paging.AsyncItemPaged[~paging.models.ProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -547,7 +547,7 @@ async def get_next(next_link=None): def get_multiple_pages_retry_first( self, **kwargs - ) -> AsyncIterable["models.ProductResult"]: + ) -> AsyncIterable["_models.ProductResult"]: """A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. @@ -556,7 +556,7 @@ def get_multiple_pages_retry_first( :rtype: ~azure.core.async_paging.AsyncItemPaged[~paging.models.ProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -609,7 +609,7 @@ async def get_next(next_link=None): def get_multiple_pages_retry_second( self, **kwargs - ) -> AsyncIterable["models.ProductResult"]: + ) -> AsyncIterable["_models.ProductResult"]: """A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. @@ -618,7 +618,7 @@ def get_multiple_pages_retry_second( :rtype: ~azure.core.async_paging.AsyncItemPaged[~paging.models.ProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -671,7 +671,7 @@ async def get_next(next_link=None): def get_single_pages_failure( self, **kwargs - ) -> AsyncIterable["models.ProductResult"]: + ) -> AsyncIterable["_models.ProductResult"]: """A paging operation that receives a 400 on the first call. :keyword callable cls: A custom type or function that will be passed the direct response @@ -679,7 +679,7 @@ def get_single_pages_failure( :rtype: ~azure.core.async_paging.AsyncItemPaged[~paging.models.ProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -732,7 +732,7 @@ async def get_next(next_link=None): def get_multiple_pages_failure( self, **kwargs - ) -> AsyncIterable["models.ProductResult"]: + ) -> AsyncIterable["_models.ProductResult"]: """A paging operation that receives a 400 on the second call. :keyword callable cls: A custom type or function that will be passed the direct response @@ -740,7 +740,7 @@ def get_multiple_pages_failure( :rtype: ~azure.core.async_paging.AsyncItemPaged[~paging.models.ProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -793,7 +793,7 @@ async def get_next(next_link=None): def get_multiple_pages_failure_uri( self, **kwargs - ) -> AsyncIterable["models.ProductResult"]: + ) -> AsyncIterable["_models.ProductResult"]: """A paging operation that receives an invalid nextLink. :keyword callable cls: A custom type or function that will be passed the direct response @@ -801,7 +801,7 @@ def get_multiple_pages_failure_uri( :rtype: ~azure.core.async_paging.AsyncItemPaged[~paging.models.ProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -856,7 +856,7 @@ def get_multiple_pages_fragment_next_link( api_version: str, tenant: str, **kwargs - ) -> AsyncIterable["models.OdataProductResult"]: + ) -> AsyncIterable["_models.OdataProductResult"]: """A paging operation that doesn't return a full URL, just a fragment. :param api_version: Sets the api version to use. @@ -868,7 +868,7 @@ def get_multiple_pages_fragment_next_link( :rtype: ~azure.core.async_paging.AsyncItemPaged[~paging.models.OdataProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OdataProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OdataProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -933,9 +933,9 @@ async def get_next(next_link=None): @distributed_trace def get_multiple_pages_fragment_with_grouping_next_link( self, - custom_parameter_group: "models.CustomParameterGroup", + custom_parameter_group: "_models.CustomParameterGroup", **kwargs - ) -> AsyncIterable["models.OdataProductResult"]: + ) -> AsyncIterable["_models.OdataProductResult"]: """A paging operation that doesn't return a full URL, just a fragment with parameters grouped. :param custom_parameter_group: Parameter group. @@ -945,7 +945,7 @@ def get_multiple_pages_fragment_with_grouping_next_link( :rtype: ~azure.core.async_paging.AsyncItemPaged[~paging.models.OdataProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OdataProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OdataProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1016,10 +1016,10 @@ async def get_next(next_link=None): async def _get_multiple_pages_lro_initial( self, client_request_id: Optional[str] = None, - paging_get_multiple_pages_lro_options: Optional["models.PagingGetMultiplePagesLroOptions"] = None, + paging_get_multiple_pages_lro_options: Optional["_models.PagingGetMultiplePagesLroOptions"] = None, **kwargs - ) -> "models.ProductResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + ) -> "_models.ProductResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1068,9 +1068,9 @@ async def _get_multiple_pages_lro_initial( async def begin_get_multiple_pages_lro( self, client_request_id: Optional[str] = None, - paging_get_multiple_pages_lro_options: Optional["models.PagingGetMultiplePagesLroOptions"] = None, + paging_get_multiple_pages_lro_options: Optional["_models.PagingGetMultiplePagesLroOptions"] = None, **kwargs - ) -> AsyncLROPoller[AsyncItemPaged["models.ProductResult"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.ProductResult"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: @@ -1087,7 +1087,7 @@ async def begin_get_multiple_pages_lro( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~paging.models.ProductResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1144,7 +1144,7 @@ async def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1188,7 +1188,7 @@ async def internal_get_next(next_link=None): def get_paging_model_with_item_name_with_xms_client_name( self, **kwargs - ) -> AsyncIterable["models.ProductResultValueWithXMSClientName"]: + ) -> AsyncIterable["_models.ProductResultValueWithXMSClientName"]: """A paging operation that returns a paging model whose item name is is overriden by x-ms-client- name 'indexes'. @@ -1197,7 +1197,7 @@ def get_paging_model_with_item_name_with_xms_client_name( :rtype: ~azure.core.async_paging.AsyncItemPaged[~paging.models.ProductResultValueWithXMSClientName] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResultValueWithXMSClientName"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResultValueWithXMSClientName"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/azure/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py b/test/azure/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py index bd305032e01..7b2c8dab169 100644 --- a/test/azure/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py +++ b/test/azure/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py @@ -17,7 +17,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -40,7 +40,7 @@ class PagingOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get_no_item_name_pages( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProductResultValue"] + # type: (...) -> Iterable["_models.ProductResultValue"] """A paging operation that must return result of the default 'value' node. :keyword callable cls: A custom type or function that will be passed the direct response @@ -61,7 +61,7 @@ def get_no_item_name_pages( :rtype: ~azure.core.paging.ItemPaged[~paging.models.ProductResultValue] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResultValue"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResultValue"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,7 +115,7 @@ def get_null_next_link_name_pages( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProductResult"] + # type: (...) -> Iterable["_models.ProductResult"] """A paging operation that must ignore any kind of nextLink, and stop after page 1. :keyword callable cls: A custom type or function that will be passed the direct response @@ -123,7 +123,7 @@ def get_null_next_link_name_pages( :rtype: ~azure.core.paging.ItemPaged[~paging.models.ProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -177,7 +177,7 @@ def get_single_pages( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProductResult"] + # type: (...) -> Iterable["_models.ProductResult"] """A paging operation that finishes on the first call without a nextlink. :keyword callable cls: A custom type or function that will be passed the direct response @@ -185,7 +185,7 @@ def get_single_pages( :rtype: ~azure.core.paging.ItemPaged[~paging.models.ProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -238,10 +238,10 @@ def get_next(next_link=None): def get_multiple_pages( self, client_request_id=None, # type: Optional[str] - paging_get_multiple_pages_options=None, # type: Optional["models.PagingGetMultiplePagesOptions"] + paging_get_multiple_pages_options=None, # type: Optional["_models.PagingGetMultiplePagesOptions"] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProductResult"] + # type: (...) -> Iterable["_models.ProductResult"] """A paging operation that includes a nextLink that has 10 pages. :param client_request_id: @@ -253,7 +253,7 @@ def get_multiple_pages( :rtype: ~azure.core.paging.ItemPaged[~paging.models.ProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -320,7 +320,7 @@ def get_with_query_params( required_query_parameter, # type: int **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProductResult"] + # type: (...) -> Iterable["_models.ProductResult"] """A paging operation that includes a next operation. It has a different query parameter from it's next operation nextOperationWithQueryParams. Returns a ProductResult. @@ -332,7 +332,7 @@ def get_with_query_params( :rtype: ~azure.core.paging.ItemPaged[~paging.models.ProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -391,10 +391,10 @@ def get_next(next_link=None): def get_odata_multiple_pages( self, client_request_id=None, # type: Optional[str] - paging_get_odata_multiple_pages_options=None, # type: Optional["models.PagingGetOdataMultiplePagesOptions"] + paging_get_odata_multiple_pages_options=None, # type: Optional["_models.PagingGetOdataMultiplePagesOptions"] **kwargs # type: Any ): - # type: (...) -> Iterable["models.OdataProductResult"] + # type: (...) -> Iterable["_models.OdataProductResult"] """A paging operation that includes a nextLink in odata format that has 10 pages. :param client_request_id: @@ -406,7 +406,7 @@ def get_odata_multiple_pages( :rtype: ~azure.core.paging.ItemPaged[~paging.models.OdataProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OdataProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OdataProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -470,11 +470,11 @@ def get_next(next_link=None): @distributed_trace def get_multiple_pages_with_offset( self, - paging_get_multiple_pages_with_offset_options, # type: "models.PagingGetMultiplePagesWithOffsetOptions" + paging_get_multiple_pages_with_offset_options, # type: "_models.PagingGetMultiplePagesWithOffsetOptions" client_request_id=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProductResult"] + # type: (...) -> Iterable["_models.ProductResult"] """A paging operation that includes a nextLink that has 10 pages. :param paging_get_multiple_pages_with_offset_options: Parameter group. @@ -486,7 +486,7 @@ def get_multiple_pages_with_offset( :rtype: ~azure.core.paging.ItemPaged[~paging.models.ProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -558,7 +558,7 @@ def get_multiple_pages_retry_first( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProductResult"] + # type: (...) -> Iterable["_models.ProductResult"] """A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. @@ -567,7 +567,7 @@ def get_multiple_pages_retry_first( :rtype: ~azure.core.paging.ItemPaged[~paging.models.ProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -621,7 +621,7 @@ def get_multiple_pages_retry_second( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProductResult"] + # type: (...) -> Iterable["_models.ProductResult"] """A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. @@ -630,7 +630,7 @@ def get_multiple_pages_retry_second( :rtype: ~azure.core.paging.ItemPaged[~paging.models.ProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -684,7 +684,7 @@ def get_single_pages_failure( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProductResult"] + # type: (...) -> Iterable["_models.ProductResult"] """A paging operation that receives a 400 on the first call. :keyword callable cls: A custom type or function that will be passed the direct response @@ -692,7 +692,7 @@ def get_single_pages_failure( :rtype: ~azure.core.paging.ItemPaged[~paging.models.ProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -746,7 +746,7 @@ def get_multiple_pages_failure( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProductResult"] + # type: (...) -> Iterable["_models.ProductResult"] """A paging operation that receives a 400 on the second call. :keyword callable cls: A custom type or function that will be passed the direct response @@ -754,7 +754,7 @@ def get_multiple_pages_failure( :rtype: ~azure.core.paging.ItemPaged[~paging.models.ProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -808,7 +808,7 @@ def get_multiple_pages_failure_uri( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProductResult"] + # type: (...) -> Iterable["_models.ProductResult"] """A paging operation that receives an invalid nextLink. :keyword callable cls: A custom type or function that will be passed the direct response @@ -816,7 +816,7 @@ def get_multiple_pages_failure_uri( :rtype: ~azure.core.paging.ItemPaged[~paging.models.ProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -872,7 +872,7 @@ def get_multiple_pages_fragment_next_link( tenant, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.OdataProductResult"] + # type: (...) -> Iterable["_models.OdataProductResult"] """A paging operation that doesn't return a full URL, just a fragment. :param api_version: Sets the api version to use. @@ -884,7 +884,7 @@ def get_multiple_pages_fragment_next_link( :rtype: ~azure.core.paging.ItemPaged[~paging.models.OdataProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OdataProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OdataProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -949,10 +949,10 @@ def get_next(next_link=None): @distributed_trace def get_multiple_pages_fragment_with_grouping_next_link( self, - custom_parameter_group, # type: "models.CustomParameterGroup" + custom_parameter_group, # type: "_models.CustomParameterGroup" **kwargs # type: Any ): - # type: (...) -> Iterable["models.OdataProductResult"] + # type: (...) -> Iterable["_models.OdataProductResult"] """A paging operation that doesn't return a full URL, just a fragment with parameters grouped. :param custom_parameter_group: Parameter group. @@ -962,7 +962,7 @@ def get_multiple_pages_fragment_with_grouping_next_link( :rtype: ~azure.core.paging.ItemPaged[~paging.models.OdataProductResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OdataProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OdataProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1033,11 +1033,11 @@ def get_next(next_link=None): def _get_multiple_pages_lro_initial( self, client_request_id=None, # type: Optional[str] - paging_get_multiple_pages_lro_options=None, # type: Optional["models.PagingGetMultiplePagesLroOptions"] + paging_get_multiple_pages_lro_options=None, # type: Optional["_models.PagingGetMultiplePagesLroOptions"] **kwargs # type: Any ): - # type: (...) -> "models.ProductResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + # type: (...) -> "_models.ProductResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1086,10 +1086,10 @@ def _get_multiple_pages_lro_initial( def begin_get_multiple_pages_lro( self, client_request_id=None, # type: Optional[str] - paging_get_multiple_pages_lro_options=None, # type: Optional["models.PagingGetMultiplePagesLroOptions"] + paging_get_multiple_pages_lro_options=None, # type: Optional["_models.PagingGetMultiplePagesLroOptions"] **kwargs # type: Any ): - # type: (...) -> LROPoller[ItemPaged["models.ProductResult"]] + # type: (...) -> LROPoller[ItemPaged["_models.ProductResult"]] """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: @@ -1106,7 +1106,7 @@ def begin_get_multiple_pages_lro( :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~paging.models.ProductResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1163,7 +1163,7 @@ def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1208,7 +1208,7 @@ def get_paging_model_with_item_name_with_xms_client_name( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProductResultValueWithXMSClientName"] + # type: (...) -> Iterable["_models.ProductResultValueWithXMSClientName"] """A paging operation that returns a paging model whose item name is is overriden by x-ms-client- name 'indexes'. @@ -1217,7 +1217,7 @@ def get_paging_model_with_item_name_with_xms_client_name( :rtype: ~azure.core.paging.ItemPaged[~paging.models.ProductResultValueWithXMSClientName] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResultValueWithXMSClientName"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductResultValueWithXMSClientName"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations/_storage_accounts_operations.py b/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations/_storage_accounts_operations.py index 32610d18879..bcc19736568 100644 --- a/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations/_storage_accounts_operations.py +++ b/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations/_storage_accounts_operations.py @@ -18,7 +18,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -37,7 +37,7 @@ class StorageAccountsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,9 +48,9 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def check_name_availability( self, - account_name: "models.StorageAccountCheckNameAvailabilityParameters", + account_name: "_models.StorageAccountCheckNameAvailabilityParameters", **kwargs - ) -> "models.CheckNameAvailabilityResult": + ) -> "_models.CheckNameAvailabilityResult": """Checks that account name is valid and is not in use. :param account_name: The name of the storage account within the specified resource group. @@ -62,7 +62,7 @@ async def check_name_availability( :rtype: ~storage.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,10 +110,10 @@ async def _create_initial( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountCreateParameters", + parameters: "_models.StorageAccountCreateParameters", **kwargs - ) -> Optional["models.StorageAccount"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccount"]] + ) -> Optional["_models.StorageAccount"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -166,9 +166,9 @@ async def begin_create( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountCreateParameters", + parameters: "_models.StorageAccountCreateParameters", **kwargs - ) -> AsyncLROPoller["models.StorageAccount"]: + ) -> AsyncLROPoller["_models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. Existing accounts cannot be updated with this API and should instead use the Update Storage Account API. If an account is already created and subsequent PUT request is issued with exact same set of @@ -193,7 +193,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -300,7 +300,7 @@ async def get_properties( resource_group_name: str, account_name: str, **kwargs - ) -> "models.StorageAccount": + ) -> "_models.StorageAccount": """Returns the properties for the specified storage account including but not limited to name, account type, location, and account status. The ListKeys operation should be used to retrieve storage keys. @@ -316,7 +316,7 @@ async def get_properties( :rtype: ~storage.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -362,9 +362,9 @@ async def update( self, resource_group_name: str, account_name: str, - parameters: "models.StorageAccountUpdateParameters", + parameters: "_models.StorageAccountUpdateParameters", **kwargs - ) -> "models.StorageAccount": + ) -> "_models.StorageAccount": """Updates the account type or tags for a storage account. It can also be used to add a custom domain (note that custom domains cannot be added via the Create operation). Only one custom domain is supported per storage account. This API can only be used to update one of tags, @@ -387,7 +387,7 @@ async def update( :rtype: ~storage.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -439,7 +439,7 @@ async def list_keys( resource_group_name: str, account_name: str, **kwargs - ) -> "models.StorageAccountKeys": + ) -> "_models.StorageAccountKeys": """Lists the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user’s subscription. @@ -451,7 +451,7 @@ async def list_keys( :rtype: ~storage.models.StorageAccountKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -496,7 +496,7 @@ async def list_keys( def list( self, **kwargs - ) -> AsyncIterable["models.StorageAccountListResult"]: + ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -505,7 +505,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~storage.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -565,7 +565,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.StorageAccountListResult"]: + ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -576,7 +576,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~storage.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -637,9 +637,9 @@ async def regenerate_key( self, resource_group_name: str, account_name: str, - key_name: Optional[Union[str, "models.KeyName"]] = None, + key_name: Optional[Union[str, "_models.KeyName"]] = None, **kwargs - ) -> "models.StorageAccountKeys": + ) -> "_models.StorageAccountKeys": """Regenerates the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user’s subscription. @@ -655,13 +655,13 @@ async def regenerate_key( :rtype: ~storage.models.StorageAccountKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - _regenerate_key = models.StorageAccountRegenerateKeyParameters(key_name=key_name) + _regenerate_key = _models.StorageAccountRegenerateKeyParameters(key_name=key_name) api_version = "2015-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json, text/json" diff --git a/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations/_usage_operations.py b/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations/_usage_operations.py index bd9cab52a01..cfec75678ec 100644 --- a/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations/_usage_operations.py +++ b/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsageOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list( self, **kwargs - ) -> "models.UsageListResult": + ) -> "_models.UsageListResult": """Gets the current usage count and the limit for the resources under the subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -53,7 +53,7 @@ async def list( :rtype: ~storage.models.UsageListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_storage_accounts_operations.py b/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_storage_accounts_operations.py index 3fa209bfa01..6c0cc398e78 100644 --- a/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_storage_accounts_operations.py +++ b/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_storage_accounts_operations.py @@ -17,7 +17,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -40,7 +40,7 @@ class StorageAccountsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def __init__(self, client, config, serializer, deserializer): @distributed_trace def check_name_availability( self, - account_name, # type: "models.StorageAccountCheckNameAvailabilityParameters" + account_name, # type: "_models.StorageAccountCheckNameAvailabilityParameters" **kwargs # type: Any ): - # type: (...) -> "models.CheckNameAvailabilityResult" + # type: (...) -> "_models.CheckNameAvailabilityResult" """Checks that account name is valid and is not in use. :param account_name: The name of the storage account within the specified resource group. @@ -66,7 +66,7 @@ def check_name_availability( :rtype: ~storage.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,11 +114,11 @@ def _create_initial( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountCreateParameters" + parameters, # type: "_models.StorageAccountCreateParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.StorageAccount"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.StorageAccount"]] + # type: (...) -> Optional["_models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -171,10 +171,10 @@ def begin_create( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountCreateParameters" + parameters, # type: "_models.StorageAccountCreateParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.StorageAccount"] + # type: (...) -> LROPoller["_models.StorageAccount"] """Asynchronously creates a new storage account with the specified parameters. Existing accounts cannot be updated with this API and should instead use the Update Storage Account API. If an account is already created and subsequent PUT request is issued with exact same set of @@ -199,7 +199,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -308,7 +308,7 @@ def get_properties( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.StorageAccount" + # type: (...) -> "_models.StorageAccount" """Returns the properties for the specified storage account including but not limited to name, account type, location, and account status. The ListKeys operation should be used to retrieve storage keys. @@ -324,7 +324,7 @@ def get_properties( :rtype: ~storage.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -370,10 +370,10 @@ def update( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "models.StorageAccountUpdateParameters" + parameters, # type: "_models.StorageAccountUpdateParameters" **kwargs # type: Any ): - # type: (...) -> "models.StorageAccount" + # type: (...) -> "_models.StorageAccount" """Updates the account type or tags for a storage account. It can also be used to add a custom domain (note that custom domains cannot be added via the Create operation). Only one custom domain is supported per storage account. This API can only be used to update one of tags, @@ -396,7 +396,7 @@ def update( :rtype: ~storage.models.StorageAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -449,7 +449,7 @@ def list_keys( account_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountKeys" + # type: (...) -> "_models.StorageAccountKeys" """Lists the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user’s subscription. @@ -461,7 +461,7 @@ def list_keys( :rtype: ~storage.models.StorageAccountKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -507,7 +507,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageAccountListResult"] + # type: (...) -> Iterable["_models.StorageAccountListResult"] """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -516,7 +516,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~storage.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -577,7 +577,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.StorageAccountListResult"] + # type: (...) -> Iterable["_models.StorageAccountListResult"] """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -588,7 +588,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~storage.models.StorageAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -649,10 +649,10 @@ def regenerate_key( self, resource_group_name, # type: str account_name, # type: str - key_name=None, # type: Optional[Union[str, "models.KeyName"]] + key_name=None, # type: Optional[Union[str, "_models.KeyName"]] **kwargs # type: Any ): - # type: (...) -> "models.StorageAccountKeys" + # type: (...) -> "_models.StorageAccountKeys" """Regenerates the access keys for the specified storage account. :param resource_group_name: The name of the resource group within the user’s subscription. @@ -668,13 +668,13 @@ def regenerate_key( :rtype: ~storage.models.StorageAccountKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageAccountKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - _regenerate_key = models.StorageAccountRegenerateKeyParameters(key_name=key_name) + _regenerate_key = _models.StorageAccountRegenerateKeyParameters(key_name=key_name) api_version = "2015-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json, text/json" diff --git a/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_usage_operations.py b/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_usage_operations.py index c90e52b100b..c9f06397f99 100644 --- a/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_usage_operations.py +++ b/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsageOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> "models.UsageListResult" + # type: (...) -> "_models.UsageListResult" """Gets the current usage count and the limit for the resources under the subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -58,7 +58,7 @@ def list( :rtype: ~storage.models.UsageListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.UsageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/azure/Expected/AcceptanceTests/SubscriptionIdApiVersion/subscriptionidapiversion/aio/operations/_group_operations.py b/test/azure/Expected/AcceptanceTests/SubscriptionIdApiVersion/subscriptionidapiversion/aio/operations/_group_operations.py index 5de9790c99c..76853227811 100644 --- a/test/azure/Expected/AcceptanceTests/SubscriptionIdApiVersion/subscriptionidapiversion/aio/operations/_group_operations.py +++ b/test/azure/Expected/AcceptanceTests/SubscriptionIdApiVersion/subscriptionidapiversion/aio/operations/_group_operations.py @@ -14,7 +14,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class GroupOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def get_sample_resource_group( self, resource_group_name: str, **kwargs - ) -> "models.SampleResourceGroup": + ) -> "_models.SampleResourceGroup": """Provides a resouce group with name 'testgroup101' and location 'West US'. :param resource_group_name: Resource Group name 'testgroup101'. @@ -56,7 +56,7 @@ async def get_sample_resource_group( :rtype: ~subscriptionidapiversion.models.SampleResourceGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SampleResourceGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SampleResourceGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -86,7 +86,7 @@ async def get_sample_resource_group( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SampleResourceGroup', pipeline_response) diff --git a/test/azure/Expected/AcceptanceTests/SubscriptionIdApiVersion/subscriptionidapiversion/operations/_group_operations.py b/test/azure/Expected/AcceptanceTests/SubscriptionIdApiVersion/subscriptionidapiversion/operations/_group_operations.py index 27b4906cf6a..ebbbb217bd9 100644 --- a/test/azure/Expected/AcceptanceTests/SubscriptionIdApiVersion/subscriptionidapiversion/operations/_group_operations.py +++ b/test/azure/Expected/AcceptanceTests/SubscriptionIdApiVersion/subscriptionidapiversion/operations/_group_operations.py @@ -14,7 +14,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class GroupOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def get_sample_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SampleResourceGroup" + # type: (...) -> "_models.SampleResourceGroup" """Provides a resouce group with name 'testgroup101' and location 'West US'. :param resource_group_name: Resource Group name 'testgroup101'. @@ -61,7 +61,7 @@ def get_sample_resource_group( :rtype: ~subscriptionidapiversion.models.SampleResourceGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SampleResourceGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SampleResourceGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ def get_sample_resource_group( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SampleResourceGroup', pipeline_response) diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/_operations_mixin.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/_operations_mixin.py index 46d7ce1e64e..797fad39a43 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/_operations_mixin.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/_operations_mixin.py @@ -29,7 +29,7 @@ class MultiapiServiceClientOperationsMixin(object): def begin_test_lro( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): """Put in whatever shape of Product you want, will return a Product with id equal to 100. @@ -62,7 +62,7 @@ def begin_test_lro( def begin_test_lro_and_paging( self, client_request_id=None, # type: Optional[str] - test_lro_and_paging_options=None, # type: Optional["models.TestLroAndPagingOptions"] + test_lro_and_paging_options=None, # type: Optional["_models.TestLroAndPagingOptions"] **kwargs # type: Any ): """A long-running paging operation that includes a nextLink that has 10 pages. diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/aio/_operations_mixin.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/aio/_operations_mixin.py index a8cd74a0e80..fc456b442c6 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/aio/_operations_mixin.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/aio/_operations_mixin.py @@ -25,9 +25,9 @@ class MultiapiServiceClientOperationsMixin(object): async def begin_test_lro( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Put in whatever shape of Product you want, will return a Product with id equal to 100. :param product: Product to put. @@ -58,9 +58,9 @@ async def begin_test_lro( def begin_test_lro_and_paging( self, client_request_id: Optional[str] = None, - test_lro_and_paging_options: Optional["models.TestLroAndPagingOptions"] = None, + test_lro_and_paging_options: Optional["_models.TestLroAndPagingOptions"] = None, **kwargs - ) -> AsyncLROPoller[AsyncItemPaged["models.PagingResult"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.PagingResult"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: @@ -125,7 +125,7 @@ async def test_one( def test_paging( self, **kwargs - ) -> AsyncItemPaged["models.PagingResult"]: + ) -> AsyncItemPaged["_models.PagingResult"]: """Returns ModelThree with optionalProperty 'paged'. :keyword callable cls: A custom type or function that will be passed the direct response diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/_metadata.json b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/_metadata.json index 3848ce04fe1..591df30f498 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/_metadata.json @@ -57,48 +57,48 @@ }, "_test_lro_initial" : { "sync": { - "signature": "def _test_lro_initial(\n self,\n product=None, # type: Optional[\"models.Product\"]\n **kwargs # type: Any\n):\n", + "signature": "def _test_lro_initial(\n self,\n product=None, # type: Optional[\"_models.Product\"]\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param product: Product to put.\n:type product: ~multiapi.v1.models.Product\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Product, or the result of cls(response)\n:rtype: ~multiapi.v1.models.Product or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _test_lro_initial(\n self,\n product: Optional[\"models.Product\"] = None,\n **kwargs\n) -\u003e Optional[\"models.Product\"]:\n", + "signature": "async def _test_lro_initial(\n self,\n product: Optional[\"_models.Product\"] = None,\n **kwargs\n) -\u003e Optional[\"_models.Product\"]:\n", "doc": "\"\"\"\n\n:param product: Product to put.\n:type product: ~multiapi.v1.models.Product\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Product, or the result of cls(response)\n:rtype: ~multiapi.v1.models.Product or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "product" }, "begin_test_lro" : { "sync": { - "signature": "def begin_test_lro(\n self,\n product=None, # type: Optional[\"models.Product\"]\n **kwargs # type: Any\n):\n", + "signature": "def begin_test_lro(\n self,\n product=None, # type: Optional[\"_models.Product\"]\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Put in whatever shape of Product you want, will return a Product with id equal to 100.\n\n:param product: Product to put.\n:type product: ~multiapi.v1.models.Product\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either Product or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~multiapi.v1.models.Product]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def begin_test_lro(\n self,\n product: Optional[\"models.Product\"] = None,\n **kwargs\n) -\u003e AsyncLROPoller[\"models.Product\"]:\n", + "signature": "async def begin_test_lro(\n self,\n product: Optional[\"_models.Product\"] = None,\n **kwargs\n) -\u003e AsyncLROPoller[\"_models.Product\"]:\n", "doc": "\"\"\"Put in whatever shape of Product you want, will return a Product with id equal to 100.\n\n:param product: Product to put.\n:type product: ~multiapi.v1.models.Product\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either Product or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~multiapi.v1.models.Product]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "product" }, "_test_lro_and_paging_initial" : { "sync": { - "signature": "def _test_lro_and_paging_initial(\n self,\n client_request_id=None, # type: Optional[str]\n test_lro_and_paging_options=None, # type: Optional[\"models.TestLroAndPagingOptions\"]\n **kwargs # type: Any\n):\n", + "signature": "def _test_lro_and_paging_initial(\n self,\n client_request_id=None, # type: Optional[str]\n test_lro_and_paging_options=None, # type: Optional[\"_models.TestLroAndPagingOptions\"]\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param client_request_id:\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group.\n:type test_lro_and_paging_options: ~multiapi.v1.models.TestLroAndPagingOptions\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: PagingResult, or the result of cls(response)\n:rtype: ~multiapi.v1.models.PagingResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _test_lro_and_paging_initial(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[\"models.TestLroAndPagingOptions\"] = None,\n **kwargs\n) -\u003e \"models.PagingResult\":\n", + "signature": "async def _test_lro_and_paging_initial(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[\"_models.TestLroAndPagingOptions\"] = None,\n **kwargs\n) -\u003e \"_models.PagingResult\":\n", "doc": "\"\"\"\n\n:param client_request_id:\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group.\n:type test_lro_and_paging_options: ~multiapi.v1.models.TestLroAndPagingOptions\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: PagingResult, or the result of cls(response)\n:rtype: ~multiapi.v1.models.PagingResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "client_request_id, test_lro_and_paging_options" }, "begin_test_lro_and_paging" : { "sync": { - "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id=None, # type: Optional[str]\n test_lro_and_paging_options=None, # type: Optional[\"models.TestLroAndPagingOptions\"]\n **kwargs # type: Any\n):\n", + "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id=None, # type: Optional[str]\n test_lro_and_paging_options=None, # type: Optional[\"_models.TestLroAndPagingOptions\"]\n **kwargs # type: Any\n):\n", "doc": "\"\"\"A long-running paging operation that includes a nextLink that has 10 pages.\n\n:param client_request_id:\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group.\n:type test_lro_and_paging_options: ~multiapi.v1.models.TestLroAndPagingOptions\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns an iterator like instance of either PagingResult or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~multiapi.v1.models.PagingResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": false, - "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[\"models.TestLroAndPagingOptions\"] = None,\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"models.PagingResult\"]]:\n", + "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[\"_models.TestLroAndPagingOptions\"] = None,\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.PagingResult\"]]:\n", "doc": "\"\"\"A long-running paging operation that includes a nextLink that has 10 pages.\n\n:param client_request_id:\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group.\n:type test_lro_and_paging_options: ~multiapi.v1.models.TestLroAndPagingOptions\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns an iterator like instance of either PagingResult or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~multiapi.v1.models.PagingResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "client_request_id, test_lro_and_paging_options" diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations/_multiapi_service_client_operations.py index b3c7ad56f89..55b7b931f50 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations/_multiapi_service_client_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +68,7 @@ async def test_one( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -78,10 +78,10 @@ async def test_one( async def _test_lro_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> Optional["models.Product"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Product"]] + ) -> Optional["_models.Product"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,7 +112,7 @@ async def _test_lro_initial( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -127,9 +127,9 @@ async def _test_lro_initial( async def begin_test_lro( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Put in whatever shape of Product you want, will return a Product with id equal to 100. :param product: Product to put. @@ -145,7 +145,7 @@ async def begin_test_lro( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -185,10 +185,10 @@ def get_long_running_output(pipeline_response): async def _test_lro_and_paging_initial( self, client_request_id: Optional[str] = None, - test_lro_and_paging_options: Optional["models.TestLroAndPagingOptions"] = None, + test_lro_and_paging_options: Optional["_models.TestLroAndPagingOptions"] = None, **kwargs - ) -> "models.PagingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + ) -> "_models.PagingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -236,9 +236,9 @@ async def _test_lro_and_paging_initial( async def begin_test_lro_and_paging( self, client_request_id: Optional[str] = None, - test_lro_and_paging_options: Optional["models.TestLroAndPagingOptions"] = None, + test_lro_and_paging_options: Optional["_models.TestLroAndPagingOptions"] = None, **kwargs - ) -> AsyncLROPoller[AsyncItemPaged["models.PagingResult"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.PagingResult"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: @@ -255,7 +255,7 @@ async def begin_test_lro_and_paging( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~multiapi.v1.models.PagingResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -312,7 +312,7 @@ async def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations/_operation_group_one_operations.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations/_operation_group_one_operations.py index fd5882f4ed4..e3be928c32d 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations/_operation_group_one_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations/_operation_group_one_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class OperationGroupOneOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -76,7 +76,7 @@ async def test_two( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_multiapi_service_client_operations.py index 35b7f5a4946..45b2885d82e 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_multiapi_service_client_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -73,7 +73,7 @@ def test_one( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -83,11 +83,11 @@ def test_one( def _test_lro_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> Optional["models.Product"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Product"]] + # type: (...) -> Optional["_models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,7 +118,7 @@ def _test_lro_initial( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -133,10 +133,10 @@ def _test_lro_initial( def begin_test_lro( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Put in whatever shape of Product you want, will return a Product with id equal to 100. :param product: Product to put. @@ -152,7 +152,7 @@ def begin_test_lro( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -192,11 +192,11 @@ def get_long_running_output(pipeline_response): def _test_lro_and_paging_initial( self, client_request_id=None, # type: Optional[str] - test_lro_and_paging_options=None, # type: Optional["models.TestLroAndPagingOptions"] + test_lro_and_paging_options=None, # type: Optional["_models.TestLroAndPagingOptions"] **kwargs # type: Any ): - # type: (...) -> "models.PagingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + # type: (...) -> "_models.PagingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -244,10 +244,10 @@ def _test_lro_and_paging_initial( def begin_test_lro_and_paging( self, client_request_id=None, # type: Optional[str] - test_lro_and_paging_options=None, # type: Optional["models.TestLroAndPagingOptions"] + test_lro_and_paging_options=None, # type: Optional["_models.TestLroAndPagingOptions"] **kwargs # type: Any ): - # type: (...) -> LROPoller[ItemPaged["models.PagingResult"]] + # type: (...) -> LROPoller[ItemPaged["_models.PagingResult"]] """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: @@ -264,7 +264,7 @@ def begin_test_lro_and_paging( :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~multiapi.v1.models.PagingResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -321,7 +321,7 @@ def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_operation_group_one_operations.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_operation_group_one_operations.py index 620c7c5e4c8..d2cb0370eb6 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_operation_group_one_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_operation_group_one_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class OperationGroupOneOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -81,7 +81,7 @@ def test_two( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/_metadata.json b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/_metadata.json index ee6850b6837..dc62abbac18 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/_metadata.json @@ -51,7 +51,7 @@ }, "async": { "coroutine": true, - "signature": "async def test_one(\n self,\n id: int,\n message: Optional[str] = None,\n **kwargs\n) -\u003e \"models.ModelTwo\":\n", + "signature": "async def test_one(\n self,\n id: int,\n message: Optional[str] = None,\n **kwargs\n) -\u003e \"_models.ModelTwo\":\n", "doc": "\"\"\"TestOne should be in an SecondVersionOperationsMixin. Returns ModelTwo.\n\n:param id: An int parameter.\n:type id: int\n:param message: An optional string parameter.\n:type message: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ModelTwo, or the result of cls(response)\n:rtype: ~multiapi.v2.models.ModelTwo\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "id, message" diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/aio/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/aio/operations/_multiapi_service_client_operations.py index d09ccd6b3eb..7b58e2d72b6 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/aio/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/aio/operations/_multiapi_service_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -25,7 +25,7 @@ async def test_one( id: int, message: Optional[str] = None, **kwargs - ) -> "models.ModelTwo": + ) -> "_models.ModelTwo": """TestOne should be in an SecondVersionOperationsMixin. Returns ModelTwo. :param id: An int parameter. @@ -37,7 +37,7 @@ async def test_one( :rtype: ~multiapi.v2.models.ModelTwo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModelTwo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelTwo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -65,7 +65,7 @@ async def test_one( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ModelTwo', pipeline_response) diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/aio/operations/_operation_group_one_operations.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/aio/operations/_operation_group_one_operations.py index bfe2f9e81b1..c1e535a4578 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/aio/operations/_operation_group_one_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/aio/operations/_operation_group_one_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class OperationGroupOneOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -42,9 +42,9 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def test_two( self, - parameter_one: Optional["models.ModelTwo"] = None, + parameter_one: Optional["_models.ModelTwo"] = None, **kwargs - ) -> "models.ModelTwo": + ) -> "_models.ModelTwo": """TestTwo should be in OperationGroupOneOperations. Takes in ModelTwo and ouputs ModelTwo. :param parameter_one: A ModelTwo parameter. @@ -54,7 +54,7 @@ async def test_two( :rtype: ~multiapi.v2.models.ModelTwo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModelTwo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelTwo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -87,7 +87,7 @@ async def test_two( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ModelTwo', pipeline_response) @@ -134,7 +134,7 @@ async def test_three( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/aio/operations/_operation_group_two_operations.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/aio/operations/_operation_group_two_operations.py index 982239cd63c..e5daa3fb8bf 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/aio/operations/_operation_group_two_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/aio/operations/_operation_group_two_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class OperationGroupTwoOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def test_four( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/operations/_multiapi_service_client_operations.py index 1163b6dfc11..0ecd976c20c 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/operations/_multiapi_service_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -30,7 +30,7 @@ def test_one( message=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ModelTwo" + # type: (...) -> "_models.ModelTwo" """TestOne should be in an SecondVersionOperationsMixin. Returns ModelTwo. :param id: An int parameter. @@ -42,7 +42,7 @@ def test_one( :rtype: ~multiapi.v2.models.ModelTwo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModelTwo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelTwo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -70,7 +70,7 @@ def test_one( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ModelTwo', pipeline_response) diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/operations/_operation_group_one_operations.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/operations/_operation_group_one_operations.py index 9feab037ed2..c5d3476b8ea 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/operations/_operation_group_one_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/operations/_operation_group_one_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class OperationGroupOneOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -46,10 +46,10 @@ def __init__(self, client, config, serializer, deserializer): def test_two( self, - parameter_one=None, # type: Optional["models.ModelTwo"] + parameter_one=None, # type: Optional["_models.ModelTwo"] **kwargs # type: Any ): - # type: (...) -> "models.ModelTwo" + # type: (...) -> "_models.ModelTwo" """TestTwo should be in OperationGroupOneOperations. Takes in ModelTwo and ouputs ModelTwo. :param parameter_one: A ModelTwo parameter. @@ -59,7 +59,7 @@ def test_two( :rtype: ~multiapi.v2.models.ModelTwo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModelTwo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelTwo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -92,7 +92,7 @@ def test_two( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ModelTwo', pipeline_response) @@ -140,7 +140,7 @@ def test_three( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/operations/_operation_group_two_operations.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/operations/_operation_group_two_operations.py index ac7ba151b84..7e1e7e60e3d 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/operations/_operation_group_two_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/operations/_operation_group_two_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class OperationGroupTwoOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def test_four( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/_metadata.json b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/_metadata.json index 3a1d0a21d48..72c70cab7f7 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/_metadata.json @@ -51,7 +51,7 @@ }, "async": { "coroutine": false, - "signature": "def test_paging(\n self,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.PagingResult\"]:\n", + "signature": "def test_paging(\n self,\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.PagingResult\"]:\n", "doc": "\"\"\"Returns ModelThree with optionalProperty \u0027paged\u0027.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either PagingResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~multiapi.v3.models.PagingResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "" diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_multiapi_service_client_operations.py index d109fd9b886..fe2e29297be 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_multiapi_service_client_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -24,7 +24,7 @@ class MultiapiServiceClientOperationsMixin: def test_paging( self, **kwargs - ) -> AsyncIterable["models.PagingResult"]: + ) -> AsyncIterable["_models.PagingResult"]: """Returns ModelThree with optionalProperty 'paged'. :keyword callable cls: A custom type or function that will be passed the direct response @@ -32,7 +32,7 @@ def test_paging( :rtype: ~azure.core.async_paging.AsyncItemPaged[~multiapi.v3.models.PagingResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_operation_group_one_operations.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_operation_group_one_operations.py index 87a9728c423..7038cbdae67 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_operation_group_one_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_operation_group_one_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class OperationGroupOneOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -42,9 +42,9 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def test_two( self, - parameter_one: Optional["models.ModelThree"] = None, + parameter_one: Optional["_models.ModelThree"] = None, **kwargs - ) -> "models.ModelThree": + ) -> "_models.ModelThree": """TestTwo should be in OperationGroupOneOperations. Takes in ModelThree and ouputs ModelThree. :param parameter_one: A ModelThree parameter. @@ -54,7 +54,7 @@ async def test_two( :rtype: ~multiapi.v3.models.ModelThree :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModelThree"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelThree"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -87,7 +87,7 @@ async def test_two( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ModelThree', pipeline_response) diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_operation_group_two_operations.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_operation_group_two_operations.py index 48f3f379107..7fa77cfa060 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_operation_group_two_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_operation_group_two_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class OperationGroupTwoOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -42,7 +42,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def test_four( self, - input: Optional[Union[IO, "models.SourcePath"]] = None, + input: Optional[Union[IO, "_models.SourcePath"]] = None, **kwargs ) -> None: """TestFour should be in OperationGroupTwoOperations. @@ -97,7 +97,7 @@ async def test_four( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -141,7 +141,7 @@ async def test_five( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_multiapi_service_client_operations.py index 1e4815bfc84..e7cbd128f2a 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_multiapi_service_client_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -29,7 +29,7 @@ def test_paging( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PagingResult"] + # type: (...) -> Iterable["_models.PagingResult"] """Returns ModelThree with optionalProperty 'paged'. :keyword callable cls: A custom type or function that will be passed the direct response @@ -37,7 +37,7 @@ def test_paging( :rtype: ~azure.core.paging.ItemPaged[~multiapi.v3.models.PagingResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_operation_group_one_operations.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_operation_group_one_operations.py index bcbdf5c6186..8eefdc7cda0 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_operation_group_one_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_operation_group_one_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class OperationGroupOneOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -46,10 +46,10 @@ def __init__(self, client, config, serializer, deserializer): def test_two( self, - parameter_one=None, # type: Optional["models.ModelThree"] + parameter_one=None, # type: Optional["_models.ModelThree"] **kwargs # type: Any ): - # type: (...) -> "models.ModelThree" + # type: (...) -> "_models.ModelThree" """TestTwo should be in OperationGroupOneOperations. Takes in ModelThree and ouputs ModelThree. :param parameter_one: A ModelThree parameter. @@ -59,7 +59,7 @@ def test_two( :rtype: ~multiapi.v3.models.ModelThree :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModelThree"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelThree"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -92,7 +92,7 @@ def test_two( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ModelThree', pipeline_response) diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_operation_group_two_operations.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_operation_group_two_operations.py index 209fb8a061b..14f0471651b 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_operation_group_two_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_operation_group_two_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class OperationGroupTwoOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer): def test_four( self, - input=None, # type: Optional[Union[IO, "models.SourcePath"]] + input=None, # type: Optional[Union[IO, "_models.SourcePath"]] **kwargs # type: Any ): # type: (...) -> None @@ -102,7 +102,7 @@ def test_four( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -147,7 +147,7 @@ def test_five( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/_operations_mixin.py b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/_operations_mixin.py index bc961371827..dd0e094b021 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/_operations_mixin.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/_operations_mixin.py @@ -29,7 +29,7 @@ class MultiapiServiceClientOperationsMixin(object): def begin_test_lro( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): """Put in whatever shape of Product you want, will return a Product with id equal to 100. @@ -62,7 +62,7 @@ def begin_test_lro( def begin_test_lro_and_paging( self, client_request_id=None, # type: Optional[str] - test_lro_and_paging_options=None, # type: Optional["models.TestLroAndPagingOptions"] + test_lro_and_paging_options=None, # type: Optional["_models.TestLroAndPagingOptions"] **kwargs # type: Any ): """A long-running paging operation that includes a nextLink that has 10 pages. diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/aio/_operations_mixin.py b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/aio/_operations_mixin.py index d8f7fc335c9..e5dca38077f 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/aio/_operations_mixin.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/aio/_operations_mixin.py @@ -25,9 +25,9 @@ class MultiapiServiceClientOperationsMixin(object): async def begin_test_lro( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Put in whatever shape of Product you want, will return a Product with id equal to 100. :param product: Product to put. @@ -58,9 +58,9 @@ async def begin_test_lro( def begin_test_lro_and_paging( self, client_request_id: Optional[str] = None, - test_lro_and_paging_options: Optional["models.TestLroAndPagingOptions"] = None, + test_lro_and_paging_options: Optional["_models.TestLroAndPagingOptions"] = None, **kwargs - ) -> AsyncLROPoller[AsyncItemPaged["models.PagingResult"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.PagingResult"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: @@ -125,7 +125,7 @@ async def test_one( def test_paging( self, **kwargs - ) -> AsyncItemPaged["models.PagingResult"]: + ) -> AsyncItemPaged["_models.PagingResult"]: """Returns ModelThree with optionalProperty 'paged'. :keyword callable cls: A custom type or function that will be passed the direct response diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/_metadata.json b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/_metadata.json index 1119687caf6..c5f579df372 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/_metadata.json @@ -57,48 +57,48 @@ }, "_test_lro_initial" : { "sync": { - "signature": "def _test_lro_initial(\n self,\n product=None, # type: Optional[\"models.Product\"]\n **kwargs # type: Any\n):\n", + "signature": "def _test_lro_initial(\n self,\n product=None, # type: Optional[\"_models.Product\"]\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param product: Product to put.\n:type product: ~multiapicredentialdefaultpolicy.v1.models.Product\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Product, or the result of cls(response)\n:rtype: ~multiapicredentialdefaultpolicy.v1.models.Product or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _test_lro_initial(\n self,\n product: Optional[\"models.Product\"] = None,\n **kwargs\n) -\u003e Optional[\"models.Product\"]:\n", + "signature": "async def _test_lro_initial(\n self,\n product: Optional[\"_models.Product\"] = None,\n **kwargs\n) -\u003e Optional[\"_models.Product\"]:\n", "doc": "\"\"\"\n\n:param product: Product to put.\n:type product: ~multiapicredentialdefaultpolicy.v1.models.Product\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Product, or the result of cls(response)\n:rtype: ~multiapicredentialdefaultpolicy.v1.models.Product or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "product" }, "begin_test_lro" : { "sync": { - "signature": "def begin_test_lro(\n self,\n product=None, # type: Optional[\"models.Product\"]\n **kwargs # type: Any\n):\n", + "signature": "def begin_test_lro(\n self,\n product=None, # type: Optional[\"_models.Product\"]\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Put in whatever shape of Product you want, will return a Product with id equal to 100.\n\n:param product: Product to put.\n:type product: ~multiapicredentialdefaultpolicy.v1.models.Product\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either Product or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~multiapicredentialdefaultpolicy.v1.models.Product]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def begin_test_lro(\n self,\n product: Optional[\"models.Product\"] = None,\n **kwargs\n) -\u003e AsyncLROPoller[\"models.Product\"]:\n", + "signature": "async def begin_test_lro(\n self,\n product: Optional[\"_models.Product\"] = None,\n **kwargs\n) -\u003e AsyncLROPoller[\"_models.Product\"]:\n", "doc": "\"\"\"Put in whatever shape of Product you want, will return a Product with id equal to 100.\n\n:param product: Product to put.\n:type product: ~multiapicredentialdefaultpolicy.v1.models.Product\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either Product or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~multiapicredentialdefaultpolicy.v1.models.Product]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "product" }, "_test_lro_and_paging_initial" : { "sync": { - "signature": "def _test_lro_and_paging_initial(\n self,\n client_request_id=None, # type: Optional[str]\n test_lro_and_paging_options=None, # type: Optional[\"models.TestLroAndPagingOptions\"]\n **kwargs # type: Any\n):\n", + "signature": "def _test_lro_and_paging_initial(\n self,\n client_request_id=None, # type: Optional[str]\n test_lro_and_paging_options=None, # type: Optional[\"_models.TestLroAndPagingOptions\"]\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param client_request_id:\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group.\n:type test_lro_and_paging_options: ~multiapicredentialdefaultpolicy.v1.models.TestLroAndPagingOptions\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: PagingResult, or the result of cls(response)\n:rtype: ~multiapicredentialdefaultpolicy.v1.models.PagingResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _test_lro_and_paging_initial(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[\"models.TestLroAndPagingOptions\"] = None,\n **kwargs\n) -\u003e \"models.PagingResult\":\n", + "signature": "async def _test_lro_and_paging_initial(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[\"_models.TestLroAndPagingOptions\"] = None,\n **kwargs\n) -\u003e \"_models.PagingResult\":\n", "doc": "\"\"\"\n\n:param client_request_id:\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group.\n:type test_lro_and_paging_options: ~multiapicredentialdefaultpolicy.v1.models.TestLroAndPagingOptions\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: PagingResult, or the result of cls(response)\n:rtype: ~multiapicredentialdefaultpolicy.v1.models.PagingResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "client_request_id, test_lro_and_paging_options" }, "begin_test_lro_and_paging" : { "sync": { - "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id=None, # type: Optional[str]\n test_lro_and_paging_options=None, # type: Optional[\"models.TestLroAndPagingOptions\"]\n **kwargs # type: Any\n):\n", + "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id=None, # type: Optional[str]\n test_lro_and_paging_options=None, # type: Optional[\"_models.TestLroAndPagingOptions\"]\n **kwargs # type: Any\n):\n", "doc": "\"\"\"A long-running paging operation that includes a nextLink that has 10 pages.\n\n:param client_request_id:\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group.\n:type test_lro_and_paging_options: ~multiapicredentialdefaultpolicy.v1.models.TestLroAndPagingOptions\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns an iterator like instance of either PagingResult or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~multiapicredentialdefaultpolicy.v1.models.PagingResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": false, - "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[\"models.TestLroAndPagingOptions\"] = None,\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"models.PagingResult\"]]:\n", + "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[\"_models.TestLroAndPagingOptions\"] = None,\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.PagingResult\"]]:\n", "doc": "\"\"\"A long-running paging operation that includes a nextLink that has 10 pages.\n\n:param client_request_id:\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group.\n:type test_lro_and_paging_options: ~multiapicredentialdefaultpolicy.v1.models.TestLroAndPagingOptions\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns an iterator like instance of either PagingResult or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~multiapicredentialdefaultpolicy.v1.models.PagingResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "client_request_id, test_lro_and_paging_options" diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/aio/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/aio/operations/_multiapi_service_client_operations.py index d171316708f..daff06e15fc 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/aio/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/aio/operations/_multiapi_service_client_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +68,7 @@ async def test_one( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -78,10 +78,10 @@ async def test_one( async def _test_lro_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> Optional["models.Product"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Product"]] + ) -> Optional["_models.Product"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,7 +112,7 @@ async def _test_lro_initial( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -127,9 +127,9 @@ async def _test_lro_initial( async def begin_test_lro( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Put in whatever shape of Product you want, will return a Product with id equal to 100. :param product: Product to put. @@ -145,7 +145,7 @@ async def begin_test_lro( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -185,10 +185,10 @@ def get_long_running_output(pipeline_response): async def _test_lro_and_paging_initial( self, client_request_id: Optional[str] = None, - test_lro_and_paging_options: Optional["models.TestLroAndPagingOptions"] = None, + test_lro_and_paging_options: Optional["_models.TestLroAndPagingOptions"] = None, **kwargs - ) -> "models.PagingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + ) -> "_models.PagingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -236,9 +236,9 @@ async def _test_lro_and_paging_initial( async def begin_test_lro_and_paging( self, client_request_id: Optional[str] = None, - test_lro_and_paging_options: Optional["models.TestLroAndPagingOptions"] = None, + test_lro_and_paging_options: Optional["_models.TestLroAndPagingOptions"] = None, **kwargs - ) -> AsyncLROPoller[AsyncItemPaged["models.PagingResult"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.PagingResult"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: @@ -255,7 +255,7 @@ async def begin_test_lro_and_paging( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~multiapicredentialdefaultpolicy.v1.models.PagingResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -312,7 +312,7 @@ async def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/aio/operations/_operation_group_one_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/aio/operations/_operation_group_one_operations.py index e6300fdadc7..df3d102ac9e 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/aio/operations/_operation_group_one_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/aio/operations/_operation_group_one_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class OperationGroupOneOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -76,7 +76,7 @@ async def test_two( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/operations/_multiapi_service_client_operations.py index 2833222a7f3..31f06459fab 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/operations/_multiapi_service_client_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -73,7 +73,7 @@ def test_one( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -83,11 +83,11 @@ def test_one( def _test_lro_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> Optional["models.Product"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Product"]] + # type: (...) -> Optional["_models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,7 +118,7 @@ def _test_lro_initial( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -133,10 +133,10 @@ def _test_lro_initial( def begin_test_lro( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Put in whatever shape of Product you want, will return a Product with id equal to 100. :param product: Product to put. @@ -152,7 +152,7 @@ def begin_test_lro( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -192,11 +192,11 @@ def get_long_running_output(pipeline_response): def _test_lro_and_paging_initial( self, client_request_id=None, # type: Optional[str] - test_lro_and_paging_options=None, # type: Optional["models.TestLroAndPagingOptions"] + test_lro_and_paging_options=None, # type: Optional["_models.TestLroAndPagingOptions"] **kwargs # type: Any ): - # type: (...) -> "models.PagingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + # type: (...) -> "_models.PagingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -244,10 +244,10 @@ def _test_lro_and_paging_initial( def begin_test_lro_and_paging( self, client_request_id=None, # type: Optional[str] - test_lro_and_paging_options=None, # type: Optional["models.TestLroAndPagingOptions"] + test_lro_and_paging_options=None, # type: Optional["_models.TestLroAndPagingOptions"] **kwargs # type: Any ): - # type: (...) -> LROPoller[ItemPaged["models.PagingResult"]] + # type: (...) -> LROPoller[ItemPaged["_models.PagingResult"]] """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: @@ -264,7 +264,7 @@ def begin_test_lro_and_paging( :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~multiapicredentialdefaultpolicy.v1.models.PagingResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -321,7 +321,7 @@ def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/operations/_operation_group_one_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/operations/_operation_group_one_operations.py index 41ba26f4a5e..65f676982ac 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/operations/_operation_group_one_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/operations/_operation_group_one_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class OperationGroupOneOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -81,7 +81,7 @@ def test_two( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/_metadata.json b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/_metadata.json index dd900790893..652d5091ebb 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/_metadata.json @@ -51,7 +51,7 @@ }, "async": { "coroutine": true, - "signature": "async def test_one(\n self,\n id: int,\n message: Optional[str] = None,\n **kwargs\n) -\u003e \"models.ModelTwo\":\n", + "signature": "async def test_one(\n self,\n id: int,\n message: Optional[str] = None,\n **kwargs\n) -\u003e \"_models.ModelTwo\":\n", "doc": "\"\"\"TestOne should be in an SecondVersionOperationsMixin. Returns ModelTwo.\n\n:param id: An int parameter.\n:type id: int\n:param message: An optional string parameter.\n:type message: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ModelTwo, or the result of cls(response)\n:rtype: ~multiapicredentialdefaultpolicy.v2.models.ModelTwo\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "id, message" diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/aio/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/aio/operations/_multiapi_service_client_operations.py index 5e0a8a41563..44adccdbf51 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/aio/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/aio/operations/_multiapi_service_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -25,7 +25,7 @@ async def test_one( id: int, message: Optional[str] = None, **kwargs - ) -> "models.ModelTwo": + ) -> "_models.ModelTwo": """TestOne should be in an SecondVersionOperationsMixin. Returns ModelTwo. :param id: An int parameter. @@ -37,7 +37,7 @@ async def test_one( :rtype: ~multiapicredentialdefaultpolicy.v2.models.ModelTwo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModelTwo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelTwo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -65,7 +65,7 @@ async def test_one( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ModelTwo', pipeline_response) diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/aio/operations/_operation_group_one_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/aio/operations/_operation_group_one_operations.py index 729d6674f60..051567ee7d4 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/aio/operations/_operation_group_one_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/aio/operations/_operation_group_one_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class OperationGroupOneOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -42,9 +42,9 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def test_two( self, - parameter_one: Optional["models.ModelTwo"] = None, + parameter_one: Optional["_models.ModelTwo"] = None, **kwargs - ) -> "models.ModelTwo": + ) -> "_models.ModelTwo": """TestTwo should be in OperationGroupOneOperations. Takes in ModelTwo and ouputs ModelTwo. :param parameter_one: A ModelTwo parameter. @@ -54,7 +54,7 @@ async def test_two( :rtype: ~multiapicredentialdefaultpolicy.v2.models.ModelTwo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModelTwo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelTwo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -87,7 +87,7 @@ async def test_two( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ModelTwo', pipeline_response) @@ -134,7 +134,7 @@ async def test_three( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/aio/operations/_operation_group_two_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/aio/operations/_operation_group_two_operations.py index 52f88f7c7f8..f36e5c0eec4 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/aio/operations/_operation_group_two_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/aio/operations/_operation_group_two_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class OperationGroupTwoOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def test_four( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/operations/_multiapi_service_client_operations.py index ab852715c10..a539c5cdd57 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/operations/_multiapi_service_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -30,7 +30,7 @@ def test_one( message=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ModelTwo" + # type: (...) -> "_models.ModelTwo" """TestOne should be in an SecondVersionOperationsMixin. Returns ModelTwo. :param id: An int parameter. @@ -42,7 +42,7 @@ def test_one( :rtype: ~multiapicredentialdefaultpolicy.v2.models.ModelTwo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModelTwo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelTwo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -70,7 +70,7 @@ def test_one( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ModelTwo', pipeline_response) diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/operations/_operation_group_one_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/operations/_operation_group_one_operations.py index e0c644ec788..9ec852260a6 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/operations/_operation_group_one_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/operations/_operation_group_one_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class OperationGroupOneOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -46,10 +46,10 @@ def __init__(self, client, config, serializer, deserializer): def test_two( self, - parameter_one=None, # type: Optional["models.ModelTwo"] + parameter_one=None, # type: Optional["_models.ModelTwo"] **kwargs # type: Any ): - # type: (...) -> "models.ModelTwo" + # type: (...) -> "_models.ModelTwo" """TestTwo should be in OperationGroupOneOperations. Takes in ModelTwo and ouputs ModelTwo. :param parameter_one: A ModelTwo parameter. @@ -59,7 +59,7 @@ def test_two( :rtype: ~multiapicredentialdefaultpolicy.v2.models.ModelTwo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModelTwo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelTwo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -92,7 +92,7 @@ def test_two( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ModelTwo', pipeline_response) @@ -140,7 +140,7 @@ def test_three( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/operations/_operation_group_two_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/operations/_operation_group_two_operations.py index 6342fdfafb7..44656e52192 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/operations/_operation_group_two_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/operations/_operation_group_two_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class OperationGroupTwoOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def test_four( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/_metadata.json b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/_metadata.json index 27b16a11fa3..a8ab01ef21d 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/_metadata.json @@ -51,7 +51,7 @@ }, "async": { "coroutine": false, - "signature": "def test_paging(\n self,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.PagingResult\"]:\n", + "signature": "def test_paging(\n self,\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.PagingResult\"]:\n", "doc": "\"\"\"Returns ModelThree with optionalProperty \u0027paged\u0027.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either PagingResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~multiapicredentialdefaultpolicy.v3.models.PagingResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "" diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_multiapi_service_client_operations.py index 2e390a7eb5e..22f084ab3ff 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_multiapi_service_client_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -24,7 +24,7 @@ class MultiapiServiceClientOperationsMixin: def test_paging( self, **kwargs - ) -> AsyncIterable["models.PagingResult"]: + ) -> AsyncIterable["_models.PagingResult"]: """Returns ModelThree with optionalProperty 'paged'. :keyword callable cls: A custom type or function that will be passed the direct response @@ -32,7 +32,7 @@ def test_paging( :rtype: ~azure.core.async_paging.AsyncItemPaged[~multiapicredentialdefaultpolicy.v3.models.PagingResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_operation_group_one_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_operation_group_one_operations.py index 759706efac1..e21c934b909 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_operation_group_one_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_operation_group_one_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class OperationGroupOneOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -42,9 +42,9 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def test_two( self, - parameter_one: Optional["models.ModelThree"] = None, + parameter_one: Optional["_models.ModelThree"] = None, **kwargs - ) -> "models.ModelThree": + ) -> "_models.ModelThree": """TestTwo should be in OperationGroupOneOperations. Takes in ModelThree and ouputs ModelThree. :param parameter_one: A ModelThree parameter. @@ -54,7 +54,7 @@ async def test_two( :rtype: ~multiapicredentialdefaultpolicy.v3.models.ModelThree :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModelThree"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelThree"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -87,7 +87,7 @@ async def test_two( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ModelThree', pipeline_response) diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_operation_group_two_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_operation_group_two_operations.py index b4d892f3b01..89d30e346b2 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_operation_group_two_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_operation_group_two_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class OperationGroupTwoOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -42,7 +42,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def test_four( self, - input: Optional[Union[IO, "models.SourcePath"]] = None, + input: Optional[Union[IO, "_models.SourcePath"]] = None, **kwargs ) -> None: """TestFour should be in OperationGroupTwoOperations. @@ -97,7 +97,7 @@ async def test_four( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -141,7 +141,7 @@ async def test_five( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_multiapi_service_client_operations.py index dc2056551fc..916245a09fc 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_multiapi_service_client_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -29,7 +29,7 @@ def test_paging( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PagingResult"] + # type: (...) -> Iterable["_models.PagingResult"] """Returns ModelThree with optionalProperty 'paged'. :keyword callable cls: A custom type or function that will be passed the direct response @@ -37,7 +37,7 @@ def test_paging( :rtype: ~azure.core.paging.ItemPaged[~multiapicredentialdefaultpolicy.v3.models.PagingResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_operation_group_one_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_operation_group_one_operations.py index c51afebe48f..436cddebab4 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_operation_group_one_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_operation_group_one_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class OperationGroupOneOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -46,10 +46,10 @@ def __init__(self, client, config, serializer, deserializer): def test_two( self, - parameter_one=None, # type: Optional["models.ModelThree"] + parameter_one=None, # type: Optional["_models.ModelThree"] **kwargs # type: Any ): - # type: (...) -> "models.ModelThree" + # type: (...) -> "_models.ModelThree" """TestTwo should be in OperationGroupOneOperations. Takes in ModelThree and ouputs ModelThree. :param parameter_one: A ModelThree parameter. @@ -59,7 +59,7 @@ def test_two( :rtype: ~multiapicredentialdefaultpolicy.v3.models.ModelThree :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModelThree"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelThree"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -92,7 +92,7 @@ def test_two( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ModelThree', pipeline_response) diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_operation_group_two_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_operation_group_two_operations.py index 22d5ca2fa92..00279f48b50 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_operation_group_two_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_operation_group_two_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class OperationGroupTwoOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer): def test_four( self, - input=None, # type: Optional[Union[IO, "models.SourcePath"]] + input=None, # type: Optional[Union[IO, "_models.SourcePath"]] **kwargs # type: Any ): # type: (...) -> None @@ -102,7 +102,7 @@ def test_four( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -147,7 +147,7 @@ def test_five( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v1/aio/operations/_multiapi_custom_base_url_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v1/aio/operations/_multiapi_custom_base_url_service_client_operations.py index 2cb44162418..bdc1950d183 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v1/aio/operations/_multiapi_custom_base_url_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v1/aio/operations/_multiapi_custom_base_url_service_client_operations.py @@ -12,7 +12,7 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -64,7 +64,7 @@ async def test( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v1/operations/_multiapi_custom_base_url_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v1/operations/_multiapi_custom_base_url_service_client_operations.py index 87f1c583526..f62dbf36785 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v1/operations/_multiapi_custom_base_url_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v1/operations/_multiapi_custom_base_url_service_client_operations.py @@ -12,7 +12,7 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -69,7 +69,7 @@ def test( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v2/aio/operations/_multiapi_custom_base_url_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v2/aio/operations/_multiapi_custom_base_url_service_client_operations.py index 5eaa36bec69..60cd59b44f7 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v2/aio/operations/_multiapi_custom_base_url_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v2/aio/operations/_multiapi_custom_base_url_service_client_operations.py @@ -12,7 +12,7 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -64,7 +64,7 @@ async def test( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v2/operations/_multiapi_custom_base_url_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v2/operations/_multiapi_custom_base_url_service_client_operations.py index 546026ae96c..bce7a97e56a 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v2/operations/_multiapi_custom_base_url_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v2/operations/_multiapi_custom_base_url_service_client_operations.py @@ -12,7 +12,7 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -69,7 +69,7 @@ def test( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/_operations_mixin.py b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/_operations_mixin.py index 149fd42ff77..7a885423774 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/_operations_mixin.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/_operations_mixin.py @@ -28,7 +28,7 @@ class MultiapiServiceClientOperationsMixin(object): def begin_test_lro( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): """Put in whatever shape of Product you want, will return a Product with id equal to 100. @@ -61,7 +61,7 @@ def begin_test_lro( def begin_test_lro_and_paging( self, client_request_id=None, # type: Optional[str] - test_lro_and_paging_options=None, # type: Optional["models.TestLroAndPagingOptions"] + test_lro_and_paging_options=None, # type: Optional["_models.TestLroAndPagingOptions"] **kwargs # type: Any ): """A long-running paging operation that includes a nextLink that has 10 pages. diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/aio/_operations_mixin.py b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/aio/_operations_mixin.py index e8f7ac19463..7d9d1112ddf 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/aio/_operations_mixin.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/aio/_operations_mixin.py @@ -24,9 +24,9 @@ class MultiapiServiceClientOperationsMixin(object): async def begin_test_lro( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Put in whatever shape of Product you want, will return a Product with id equal to 100. :param product: Product to put. @@ -57,9 +57,9 @@ async def begin_test_lro( def begin_test_lro_and_paging( self, client_request_id: Optional[str] = None, - test_lro_and_paging_options: Optional["models.TestLroAndPagingOptions"] = None, + test_lro_and_paging_options: Optional["_models.TestLroAndPagingOptions"] = None, **kwargs - ) -> AsyncLROPoller[AsyncItemPaged["models.PagingResult"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.PagingResult"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: @@ -124,7 +124,7 @@ async def test_one( def test_paging( self, **kwargs - ) -> AsyncItemPaged["models.PagingResult"]: + ) -> AsyncItemPaged["_models.PagingResult"]: """Returns ModelThree with optionalProperty 'paged'. :keyword callable cls: A custom type or function that will be passed the direct response diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/_metadata.json b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/_metadata.json index 46125d4bd15..e3d6dab61f0 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/_metadata.json @@ -57,48 +57,48 @@ }, "_test_lro_initial" : { "sync": { - "signature": "def _test_lro_initial(\n self,\n product=None, # type: Optional[\"models.Product\"]\n **kwargs # type: Any\n):\n", + "signature": "def _test_lro_initial(\n self,\n product=None, # type: Optional[\"_models.Product\"]\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param product: Product to put.\n:type product: ~multiapidataplane.v1.models.Product\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Product, or the result of cls(response)\n:rtype: ~multiapidataplane.v1.models.Product or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _test_lro_initial(\n self,\n product: Optional[\"models.Product\"] = None,\n **kwargs\n) -\u003e Optional[\"models.Product\"]:\n", + "signature": "async def _test_lro_initial(\n self,\n product: Optional[\"_models.Product\"] = None,\n **kwargs\n) -\u003e Optional[\"_models.Product\"]:\n", "doc": "\"\"\"\n\n:param product: Product to put.\n:type product: ~multiapidataplane.v1.models.Product\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Product, or the result of cls(response)\n:rtype: ~multiapidataplane.v1.models.Product or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "product" }, "begin_test_lro" : { "sync": { - "signature": "def begin_test_lro(\n self,\n product=None, # type: Optional[\"models.Product\"]\n **kwargs # type: Any\n):\n", + "signature": "def begin_test_lro(\n self,\n product=None, # type: Optional[\"_models.Product\"]\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Put in whatever shape of Product you want, will return a Product with id equal to 100.\n\n:param product: Product to put.\n:type product: ~multiapidataplane.v1.models.Product\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either Product or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~multiapidataplane.v1.models.Product]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def begin_test_lro(\n self,\n product: Optional[\"models.Product\"] = None,\n **kwargs\n) -\u003e AsyncLROPoller[\"models.Product\"]:\n", + "signature": "async def begin_test_lro(\n self,\n product: Optional[\"_models.Product\"] = None,\n **kwargs\n) -\u003e AsyncLROPoller[\"_models.Product\"]:\n", "doc": "\"\"\"Put in whatever shape of Product you want, will return a Product with id equal to 100.\n\n:param product: Product to put.\n:type product: ~multiapidataplane.v1.models.Product\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either Product or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~multiapidataplane.v1.models.Product]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "product" }, "_test_lro_and_paging_initial" : { "sync": { - "signature": "def _test_lro_and_paging_initial(\n self,\n client_request_id=None, # type: Optional[str]\n test_lro_and_paging_options=None, # type: Optional[\"models.TestLroAndPagingOptions\"]\n **kwargs # type: Any\n):\n", + "signature": "def _test_lro_and_paging_initial(\n self,\n client_request_id=None, # type: Optional[str]\n test_lro_and_paging_options=None, # type: Optional[\"_models.TestLroAndPagingOptions\"]\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param client_request_id:\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group.\n:type test_lro_and_paging_options: ~multiapidataplane.v1.models.TestLroAndPagingOptions\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: PagingResult, or the result of cls(response)\n:rtype: ~multiapidataplane.v1.models.PagingResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _test_lro_and_paging_initial(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[\"models.TestLroAndPagingOptions\"] = None,\n **kwargs\n) -\u003e \"models.PagingResult\":\n", + "signature": "async def _test_lro_and_paging_initial(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[\"_models.TestLroAndPagingOptions\"] = None,\n **kwargs\n) -\u003e \"_models.PagingResult\":\n", "doc": "\"\"\"\n\n:param client_request_id:\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group.\n:type test_lro_and_paging_options: ~multiapidataplane.v1.models.TestLroAndPagingOptions\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: PagingResult, or the result of cls(response)\n:rtype: ~multiapidataplane.v1.models.PagingResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "client_request_id, test_lro_and_paging_options" }, "begin_test_lro_and_paging" : { "sync": { - "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id=None, # type: Optional[str]\n test_lro_and_paging_options=None, # type: Optional[\"models.TestLroAndPagingOptions\"]\n **kwargs # type: Any\n):\n", + "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id=None, # type: Optional[str]\n test_lro_and_paging_options=None, # type: Optional[\"_models.TestLroAndPagingOptions\"]\n **kwargs # type: Any\n):\n", "doc": "\"\"\"A long-running paging operation that includes a nextLink that has 10 pages.\n\n:param client_request_id:\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group.\n:type test_lro_and_paging_options: ~multiapidataplane.v1.models.TestLroAndPagingOptions\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns an iterator like instance of either PagingResult or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~multiapidataplane.v1.models.PagingResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": false, - "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[\"models.TestLroAndPagingOptions\"] = None,\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"models.PagingResult\"]]:\n", + "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[\"_models.TestLroAndPagingOptions\"] = None,\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.PagingResult\"]]:\n", "doc": "\"\"\"A long-running paging operation that includes a nextLink that has 10 pages.\n\n:param client_request_id:\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group.\n:type test_lro_and_paging_options: ~multiapidataplane.v1.models.TestLroAndPagingOptions\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns an iterator like instance of either PagingResult or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~multiapidataplane.v1.models.PagingResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "client_request_id, test_lro_and_paging_options" diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/aio/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/aio/operations/_multiapi_service_client_operations.py index 42fc455757e..ee0c7bd844b 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/aio/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/aio/operations/_multiapi_service_client_operations.py @@ -15,7 +15,7 @@ from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.polling.async_base_polling import AsyncLROBasePolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,7 +67,7 @@ async def test_one( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -77,10 +77,10 @@ async def test_one( async def _test_lro_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> Optional["models.Product"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Product"]] + ) -> Optional["_models.Product"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,7 +111,7 @@ async def _test_lro_initial( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = None @@ -126,9 +126,9 @@ async def _test_lro_initial( async def begin_test_lro( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Put in whatever shape of Product you want, will return a Product with id equal to 100. :param product: Product to put. @@ -144,7 +144,7 @@ async def begin_test_lro( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -184,10 +184,10 @@ def get_long_running_output(pipeline_response): async def _test_lro_and_paging_initial( self, client_request_id: Optional[str] = None, - test_lro_and_paging_options: Optional["models.TestLroAndPagingOptions"] = None, + test_lro_and_paging_options: Optional["_models.TestLroAndPagingOptions"] = None, **kwargs - ) -> "models.PagingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + ) -> "_models.PagingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,9 +235,9 @@ async def _test_lro_and_paging_initial( async def begin_test_lro_and_paging( self, client_request_id: Optional[str] = None, - test_lro_and_paging_options: Optional["models.TestLroAndPagingOptions"] = None, + test_lro_and_paging_options: Optional["_models.TestLroAndPagingOptions"] = None, **kwargs - ) -> AsyncLROPoller[AsyncItemPaged["models.PagingResult"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.PagingResult"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: @@ -254,7 +254,7 @@ async def begin_test_lro_and_paging( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~multiapidataplane.v1.models.PagingResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -311,7 +311,7 @@ async def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/aio/operations/_operation_group_one_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/aio/operations/_operation_group_one_operations.py index 8e9bcc53100..64cba90bfaf 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/aio/operations/_operation_group_one_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/aio/operations/_operation_group_one_operations.py @@ -12,7 +12,7 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -31,7 +31,7 @@ class OperationGroupOneOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -75,7 +75,7 @@ async def test_two( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/operations/_multiapi_service_client_operations.py index ca75a6b3300..a51dd1705ed 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/operations/_multiapi_service_client_operations.py @@ -15,7 +15,7 @@ from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.polling.base_polling import LROBasePolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -72,7 +72,7 @@ def test_one( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -82,11 +82,11 @@ def test_one( def _test_lro_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> Optional["models.Product"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Product"]] + # type: (...) -> Optional["_models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def _test_lro_initial( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = None @@ -132,10 +132,10 @@ def _test_lro_initial( def begin_test_lro( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Put in whatever shape of Product you want, will return a Product with id equal to 100. :param product: Product to put. @@ -151,7 +151,7 @@ def begin_test_lro( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -191,11 +191,11 @@ def get_long_running_output(pipeline_response): def _test_lro_and_paging_initial( self, client_request_id=None, # type: Optional[str] - test_lro_and_paging_options=None, # type: Optional["models.TestLroAndPagingOptions"] + test_lro_and_paging_options=None, # type: Optional["_models.TestLroAndPagingOptions"] **kwargs # type: Any ): - # type: (...) -> "models.PagingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + # type: (...) -> "_models.PagingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -243,10 +243,10 @@ def _test_lro_and_paging_initial( def begin_test_lro_and_paging( self, client_request_id=None, # type: Optional[str] - test_lro_and_paging_options=None, # type: Optional["models.TestLroAndPagingOptions"] + test_lro_and_paging_options=None, # type: Optional["_models.TestLroAndPagingOptions"] **kwargs # type: Any ): - # type: (...) -> LROPoller[ItemPaged["models.PagingResult"]] + # type: (...) -> LROPoller[ItemPaged["_models.PagingResult"]] """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: @@ -263,7 +263,7 @@ def begin_test_lro_and_paging( :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~multiapidataplane.v1.models.PagingResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -320,7 +320,7 @@ def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/operations/_operation_group_one_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/operations/_operation_group_one_operations.py index 438dcbfb85d..6c51a36e74b 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/operations/_operation_group_one_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/operations/_operation_group_one_operations.py @@ -12,7 +12,7 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -35,7 +35,7 @@ class OperationGroupOneOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -80,7 +80,7 @@ def test_two( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/_metadata.json b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/_metadata.json index 2e9ead54e92..9b76705fa9f 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/_metadata.json @@ -51,7 +51,7 @@ }, "async": { "coroutine": true, - "signature": "async def test_one(\n self,\n id: int,\n message: Optional[str] = None,\n **kwargs\n) -\u003e \"models.ModelTwo\":\n", + "signature": "async def test_one(\n self,\n id: int,\n message: Optional[str] = None,\n **kwargs\n) -\u003e \"_models.ModelTwo\":\n", "doc": "\"\"\"TestOne should be in an SecondVersionOperationsMixin. Returns ModelTwo.\n\n:param id: An int parameter.\n:type id: int\n:param message: An optional string parameter.\n:type message: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ModelTwo, or the result of cls(response)\n:rtype: ~multiapidataplane.v2.models.ModelTwo\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "id, message" diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/aio/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/aio/operations/_multiapi_service_client_operations.py index 0dcb21d86c7..b77ff5d5aed 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/aio/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/aio/operations/_multiapi_service_client_operations.py @@ -12,7 +12,7 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -24,7 +24,7 @@ async def test_one( id: int, message: Optional[str] = None, **kwargs - ) -> "models.ModelTwo": + ) -> "_models.ModelTwo": """TestOne should be in an SecondVersionOperationsMixin. Returns ModelTwo. :param id: An int parameter. @@ -36,7 +36,7 @@ async def test_one( :rtype: ~multiapidataplane.v2.models.ModelTwo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModelTwo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelTwo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -64,7 +64,7 @@ async def test_one( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('ModelTwo', pipeline_response) diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/aio/operations/_operation_group_one_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/aio/operations/_operation_group_one_operations.py index 3f99c6e7c67..07a72a10996 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/aio/operations/_operation_group_one_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/aio/operations/_operation_group_one_operations.py @@ -12,7 +12,7 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -31,7 +31,7 @@ class OperationGroupOneOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -41,9 +41,9 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def test_two( self, - parameter_one: Optional["models.ModelTwo"] = None, + parameter_one: Optional["_models.ModelTwo"] = None, **kwargs - ) -> "models.ModelTwo": + ) -> "_models.ModelTwo": """TestTwo should be in OperationGroupOneOperations. Takes in ModelTwo and ouputs ModelTwo. :param parameter_one: A ModelTwo parameter. @@ -53,7 +53,7 @@ async def test_two( :rtype: ~multiapidataplane.v2.models.ModelTwo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModelTwo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelTwo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -86,7 +86,7 @@ async def test_two( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('ModelTwo', pipeline_response) @@ -133,7 +133,7 @@ async def test_three( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/aio/operations/_operation_group_two_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/aio/operations/_operation_group_two_operations.py index ec5b1fde78f..33b0fc701cd 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/aio/operations/_operation_group_two_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/aio/operations/_operation_group_two_operations.py @@ -12,7 +12,7 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -31,7 +31,7 @@ class OperationGroupTwoOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -79,7 +79,7 @@ async def test_four( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/operations/_multiapi_service_client_operations.py index 054436a9547..791aeded24e 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/operations/_multiapi_service_client_operations.py @@ -12,7 +12,7 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -29,7 +29,7 @@ def test_one( message=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ModelTwo" + # type: (...) -> "_models.ModelTwo" """TestOne should be in an SecondVersionOperationsMixin. Returns ModelTwo. :param id: An int parameter. @@ -41,7 +41,7 @@ def test_one( :rtype: ~multiapidataplane.v2.models.ModelTwo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModelTwo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelTwo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -69,7 +69,7 @@ def test_one( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('ModelTwo', pipeline_response) diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/operations/_operation_group_one_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/operations/_operation_group_one_operations.py index 0b950bcefe5..edb521a5ec5 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/operations/_operation_group_one_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/operations/_operation_group_one_operations.py @@ -12,7 +12,7 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -35,7 +35,7 @@ class OperationGroupOneOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -45,10 +45,10 @@ def __init__(self, client, config, serializer, deserializer): def test_two( self, - parameter_one=None, # type: Optional["models.ModelTwo"] + parameter_one=None, # type: Optional["_models.ModelTwo"] **kwargs # type: Any ): - # type: (...) -> "models.ModelTwo" + # type: (...) -> "_models.ModelTwo" """TestTwo should be in OperationGroupOneOperations. Takes in ModelTwo and ouputs ModelTwo. :param parameter_one: A ModelTwo parameter. @@ -58,7 +58,7 @@ def test_two( :rtype: ~multiapidataplane.v2.models.ModelTwo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModelTwo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelTwo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ def test_two( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('ModelTwo', pipeline_response) @@ -139,7 +139,7 @@ def test_three( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/operations/_operation_group_two_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/operations/_operation_group_two_operations.py index fb772498027..009de52819b 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/operations/_operation_group_two_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/operations/_operation_group_two_operations.py @@ -12,7 +12,7 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -35,7 +35,7 @@ class OperationGroupTwoOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -84,7 +84,7 @@ def test_four( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/_metadata.json b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/_metadata.json index cd34b39d6a4..7a26071b76e 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/_metadata.json @@ -51,7 +51,7 @@ }, "async": { "coroutine": false, - "signature": "def test_paging(\n self,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.PagingResult\"]:\n", + "signature": "def test_paging(\n self,\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.PagingResult\"]:\n", "doc": "\"\"\"Returns ModelThree with optionalProperty \u0027paged\u0027.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either PagingResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~multiapidataplane.v3.models.PagingResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "" diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_multiapi_service_client_operations.py index 09ac20c3426..5f2f9416e62 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_multiapi_service_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -23,7 +23,7 @@ class MultiapiServiceClientOperationsMixin: def test_paging( self, **kwargs - ) -> AsyncIterable["models.PagingResult"]: + ) -> AsyncIterable["_models.PagingResult"]: """Returns ModelThree with optionalProperty 'paged'. :keyword callable cls: A custom type or function that will be passed the direct response @@ -31,7 +31,7 @@ def test_paging( :rtype: ~azure.core.async_paging.AsyncItemPaged[~multiapidataplane.v3.models.PagingResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_operation_group_one_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_operation_group_one_operations.py index 002b1b4d707..58ba581268a 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_operation_group_one_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_operation_group_one_operations.py @@ -12,7 +12,7 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -31,7 +31,7 @@ class OperationGroupOneOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -41,9 +41,9 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def test_two( self, - parameter_one: Optional["models.ModelThree"] = None, + parameter_one: Optional["_models.ModelThree"] = None, **kwargs - ) -> "models.ModelThree": + ) -> "_models.ModelThree": """TestTwo should be in OperationGroupOneOperations. Takes in ModelThree and ouputs ModelThree. :param parameter_one: A ModelThree parameter. @@ -53,7 +53,7 @@ async def test_two( :rtype: ~multiapidataplane.v3.models.ModelThree :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModelThree"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelThree"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -86,7 +86,7 @@ async def test_two( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('ModelThree', pipeline_response) diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_operation_group_two_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_operation_group_two_operations.py index 3ba1ff9b4e3..42fd28e313a 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_operation_group_two_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_operation_group_two_operations.py @@ -12,7 +12,7 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -31,7 +31,7 @@ class OperationGroupTwoOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -41,7 +41,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def test_four( self, - input: Optional[Union[IO, "models.SourcePath"]] = None, + input: Optional[Union[IO, "_models.SourcePath"]] = None, **kwargs ) -> None: """TestFour should be in OperationGroupTwoOperations. @@ -96,7 +96,7 @@ async def test_four( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -140,7 +140,7 @@ async def test_five( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_multiapi_service_client_operations.py index 7586b79a4d3..0763ecd9a9a 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_multiapi_service_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -28,7 +28,7 @@ def test_paging( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PagingResult"] + # type: (...) -> Iterable["_models.PagingResult"] """Returns ModelThree with optionalProperty 'paged'. :keyword callable cls: A custom type or function that will be passed the direct response @@ -36,7 +36,7 @@ def test_paging( :rtype: ~azure.core.paging.ItemPaged[~multiapidataplane.v3.models.PagingResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_operation_group_one_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_operation_group_one_operations.py index dcfabe44940..9d161337088 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_operation_group_one_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_operation_group_one_operations.py @@ -12,7 +12,7 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -35,7 +35,7 @@ class OperationGroupOneOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -45,10 +45,10 @@ def __init__(self, client, config, serializer, deserializer): def test_two( self, - parameter_one=None, # type: Optional["models.ModelThree"] + parameter_one=None, # type: Optional["_models.ModelThree"] **kwargs # type: Any ): - # type: (...) -> "models.ModelThree" + # type: (...) -> "_models.ModelThree" """TestTwo should be in OperationGroupOneOperations. Takes in ModelThree and ouputs ModelThree. :param parameter_one: A ModelThree parameter. @@ -58,7 +58,7 @@ def test_two( :rtype: ~multiapidataplane.v3.models.ModelThree :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModelThree"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelThree"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -91,7 +91,7 @@ def test_two( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('ModelThree', pipeline_response) diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_operation_group_two_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_operation_group_two_operations.py index 322616cd25f..dc785778138 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_operation_group_two_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_operation_group_two_operations.py @@ -12,7 +12,7 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -35,7 +35,7 @@ class OperationGroupTwoOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -45,7 +45,7 @@ def __init__(self, client, config, serializer, deserializer): def test_four( self, - input=None, # type: Optional[Union[IO, "models.SourcePath"]] + input=None, # type: Optional[Union[IO, "_models.SourcePath"]] **kwargs # type: Any ): # type: (...) -> None @@ -101,7 +101,7 @@ def test_four( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -146,7 +146,7 @@ def test_five( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/_operations_mixin.py b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/_operations_mixin.py index 508718d55f6..f3b1aff695e 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/_operations_mixin.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/_operations_mixin.py @@ -29,7 +29,7 @@ class MultiapiServiceClientOperationsMixin(object): def begin_test_lro( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): """Put in whatever shape of Product you want, will return a Product with id equal to 100. @@ -62,7 +62,7 @@ def begin_test_lro( def begin_test_lro_and_paging( self, client_request_id=None, # type: Optional[str] - test_lro_and_paging_options=None, # type: Optional["models.TestLroAndPagingOptions"] + test_lro_and_paging_options=None, # type: Optional["_models.TestLroAndPagingOptions"] **kwargs # type: Any ): """A long-running paging operation that includes a nextLink that has 10 pages. diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/_metadata.json b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/_metadata.json index 40a33c69024..ceaada9e0c3 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/_metadata.json @@ -57,48 +57,48 @@ }, "_test_lro_initial" : { "sync": { - "signature": "def _test_lro_initial(\n self,\n product=None, # type: Optional[\"models.Product\"]\n **kwargs # type: Any\n):\n", + "signature": "def _test_lro_initial(\n self,\n product=None, # type: Optional[\"_models.Product\"]\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param product: Product to put.\n:type product: ~multiapinoasync.v1.models.Product\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Product, or the result of cls(response)\n:rtype: ~multiapinoasync.v1.models.Product or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _test_lro_initial(\n self,\n product: Optional[\"models.Product\"] = None,\n **kwargs\n) -\u003e Optional[\"models.Product\"]:\n", + "signature": "async def _test_lro_initial(\n self,\n product: Optional[\"_models.Product\"] = None,\n **kwargs\n) -\u003e Optional[\"_models.Product\"]:\n", "doc": "\"\"\"\n\n:param product: Product to put.\n:type product: ~multiapinoasync.v1.models.Product\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Product, or the result of cls(response)\n:rtype: ~multiapinoasync.v1.models.Product or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "product" }, "begin_test_lro" : { "sync": { - "signature": "def begin_test_lro(\n self,\n product=None, # type: Optional[\"models.Product\"]\n **kwargs # type: Any\n):\n", + "signature": "def begin_test_lro(\n self,\n product=None, # type: Optional[\"_models.Product\"]\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Put in whatever shape of Product you want, will return a Product with id equal to 100.\n\n:param product: Product to put.\n:type product: ~multiapinoasync.v1.models.Product\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either Product or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~multiapinoasync.v1.models.Product]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def begin_test_lro(\n self,\n product: Optional[\"models.Product\"] = None,\n **kwargs\n) -\u003e AsyncLROPoller[\"models.Product\"]:\n", + "signature": "async def begin_test_lro(\n self,\n product: Optional[\"_models.Product\"] = None,\n **kwargs\n) -\u003e AsyncLROPoller[\"_models.Product\"]:\n", "doc": "\"\"\"Put in whatever shape of Product you want, will return a Product with id equal to 100.\n\n:param product: Product to put.\n:type product: ~multiapinoasync.v1.models.Product\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either Product or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~multiapinoasync.v1.models.Product]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "product" }, "_test_lro_and_paging_initial" : { "sync": { - "signature": "def _test_lro_and_paging_initial(\n self,\n client_request_id=None, # type: Optional[str]\n test_lro_and_paging_options=None, # type: Optional[\"models.TestLroAndPagingOptions\"]\n **kwargs # type: Any\n):\n", + "signature": "def _test_lro_and_paging_initial(\n self,\n client_request_id=None, # type: Optional[str]\n test_lro_and_paging_options=None, # type: Optional[\"_models.TestLroAndPagingOptions\"]\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param client_request_id:\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group.\n:type test_lro_and_paging_options: ~multiapinoasync.v1.models.TestLroAndPagingOptions\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: PagingResult, or the result of cls(response)\n:rtype: ~multiapinoasync.v1.models.PagingResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _test_lro_and_paging_initial(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[\"models.TestLroAndPagingOptions\"] = None,\n **kwargs\n) -\u003e \"models.PagingResult\":\n", + "signature": "async def _test_lro_and_paging_initial(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[\"_models.TestLroAndPagingOptions\"] = None,\n **kwargs\n) -\u003e \"_models.PagingResult\":\n", "doc": "\"\"\"\n\n:param client_request_id:\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group.\n:type test_lro_and_paging_options: ~multiapinoasync.v1.models.TestLroAndPagingOptions\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: PagingResult, or the result of cls(response)\n:rtype: ~multiapinoasync.v1.models.PagingResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "client_request_id, test_lro_and_paging_options" }, "begin_test_lro_and_paging" : { "sync": { - "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id=None, # type: Optional[str]\n test_lro_and_paging_options=None, # type: Optional[\"models.TestLroAndPagingOptions\"]\n **kwargs # type: Any\n):\n", + "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id=None, # type: Optional[str]\n test_lro_and_paging_options=None, # type: Optional[\"_models.TestLroAndPagingOptions\"]\n **kwargs # type: Any\n):\n", "doc": "\"\"\"A long-running paging operation that includes a nextLink that has 10 pages.\n\n:param client_request_id:\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group.\n:type test_lro_and_paging_options: ~multiapinoasync.v1.models.TestLroAndPagingOptions\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns an iterator like instance of either PagingResult or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~multiapinoasync.v1.models.PagingResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": false, - "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[\"models.TestLroAndPagingOptions\"] = None,\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"models.PagingResult\"]]:\n", + "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[\"_models.TestLroAndPagingOptions\"] = None,\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.PagingResult\"]]:\n", "doc": "\"\"\"A long-running paging operation that includes a nextLink that has 10 pages.\n\n:param client_request_id:\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group.\n:type test_lro_and_paging_options: ~multiapinoasync.v1.models.TestLroAndPagingOptions\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns an iterator like instance of either PagingResult or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~multiapinoasync.v1.models.PagingResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "client_request_id, test_lro_and_paging_options" diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_multiapi_service_client_operations.py index 3e0d3431b09..22e40273233 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_multiapi_service_client_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -73,7 +73,7 @@ def test_one( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -83,11 +83,11 @@ def test_one( def _test_lro_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> Optional["models.Product"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Product"]] + # type: (...) -> Optional["_models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,7 +118,7 @@ def _test_lro_initial( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -133,10 +133,10 @@ def _test_lro_initial( def begin_test_lro( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Put in whatever shape of Product you want, will return a Product with id equal to 100. :param product: Product to put. @@ -152,7 +152,7 @@ def begin_test_lro( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -192,11 +192,11 @@ def get_long_running_output(pipeline_response): def _test_lro_and_paging_initial( self, client_request_id=None, # type: Optional[str] - test_lro_and_paging_options=None, # type: Optional["models.TestLroAndPagingOptions"] + test_lro_and_paging_options=None, # type: Optional["_models.TestLroAndPagingOptions"] **kwargs # type: Any ): - # type: (...) -> "models.PagingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + # type: (...) -> "_models.PagingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -244,10 +244,10 @@ def _test_lro_and_paging_initial( def begin_test_lro_and_paging( self, client_request_id=None, # type: Optional[str] - test_lro_and_paging_options=None, # type: Optional["models.TestLroAndPagingOptions"] + test_lro_and_paging_options=None, # type: Optional["_models.TestLroAndPagingOptions"] **kwargs # type: Any ): - # type: (...) -> LROPoller[ItemPaged["models.PagingResult"]] + # type: (...) -> LROPoller[ItemPaged["_models.PagingResult"]] """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: @@ -264,7 +264,7 @@ def begin_test_lro_and_paging( :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~multiapinoasync.v1.models.PagingResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -321,7 +321,7 @@ def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_operation_group_one_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_operation_group_one_operations.py index 618447d0034..8747d9845d3 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_operation_group_one_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_operation_group_one_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class OperationGroupOneOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -81,7 +81,7 @@ def test_two( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/_metadata.json b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/_metadata.json index 4f245c9f0b5..5e321ebf290 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/_metadata.json @@ -51,7 +51,7 @@ }, "async": { "coroutine": true, - "signature": "async def test_one(\n self,\n id: int,\n message: Optional[str] = None,\n **kwargs\n) -\u003e \"models.ModelTwo\":\n", + "signature": "async def test_one(\n self,\n id: int,\n message: Optional[str] = None,\n **kwargs\n) -\u003e \"_models.ModelTwo\":\n", "doc": "\"\"\"TestOne should be in an SecondVersionOperationsMixin. Returns ModelTwo.\n\n:param id: An int parameter.\n:type id: int\n:param message: An optional string parameter.\n:type message: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ModelTwo, or the result of cls(response)\n:rtype: ~multiapinoasync.v2.models.ModelTwo\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "id, message" diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/operations/_multiapi_service_client_operations.py index 608f1136f99..3183783f827 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/operations/_multiapi_service_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -30,7 +30,7 @@ def test_one( message=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ModelTwo" + # type: (...) -> "_models.ModelTwo" """TestOne should be in an SecondVersionOperationsMixin. Returns ModelTwo. :param id: An int parameter. @@ -42,7 +42,7 @@ def test_one( :rtype: ~multiapinoasync.v2.models.ModelTwo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModelTwo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelTwo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -70,7 +70,7 @@ def test_one( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ModelTwo', pipeline_response) diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/operations/_operation_group_one_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/operations/_operation_group_one_operations.py index 32b28ffacb0..a53e02fc903 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/operations/_operation_group_one_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/operations/_operation_group_one_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class OperationGroupOneOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -46,10 +46,10 @@ def __init__(self, client, config, serializer, deserializer): def test_two( self, - parameter_one=None, # type: Optional["models.ModelTwo"] + parameter_one=None, # type: Optional["_models.ModelTwo"] **kwargs # type: Any ): - # type: (...) -> "models.ModelTwo" + # type: (...) -> "_models.ModelTwo" """TestTwo should be in OperationGroupOneOperations. Takes in ModelTwo and ouputs ModelTwo. :param parameter_one: A ModelTwo parameter. @@ -59,7 +59,7 @@ def test_two( :rtype: ~multiapinoasync.v2.models.ModelTwo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModelTwo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelTwo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -92,7 +92,7 @@ def test_two( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ModelTwo', pipeline_response) @@ -140,7 +140,7 @@ def test_three( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/operations/_operation_group_two_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/operations/_operation_group_two_operations.py index 4c0e2dd890d..cdcef6f3045 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/operations/_operation_group_two_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/operations/_operation_group_two_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class OperationGroupTwoOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def test_four( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/_metadata.json b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/_metadata.json index 01b6ffd0a0d..a1222066edc 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/_metadata.json @@ -51,7 +51,7 @@ }, "async": { "coroutine": false, - "signature": "def test_paging(\n self,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.PagingResult\"]:\n", + "signature": "def test_paging(\n self,\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.PagingResult\"]:\n", "doc": "\"\"\"Returns ModelThree with optionalProperty \u0027paged\u0027.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either PagingResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~multiapinoasync.v3.models.PagingResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "" diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_multiapi_service_client_operations.py index dc4a6c0becb..243bee3c3ff 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_multiapi_service_client_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -29,7 +29,7 @@ def test_paging( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PagingResult"] + # type: (...) -> Iterable["_models.PagingResult"] """Returns ModelThree with optionalProperty 'paged'. :keyword callable cls: A custom type or function that will be passed the direct response @@ -37,7 +37,7 @@ def test_paging( :rtype: ~azure.core.paging.ItemPaged[~multiapinoasync.v3.models.PagingResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_operation_group_one_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_operation_group_one_operations.py index 3d78a744e41..666f5f5a329 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_operation_group_one_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_operation_group_one_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class OperationGroupOneOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -46,10 +46,10 @@ def __init__(self, client, config, serializer, deserializer): def test_two( self, - parameter_one=None, # type: Optional["models.ModelThree"] + parameter_one=None, # type: Optional["_models.ModelThree"] **kwargs # type: Any ): - # type: (...) -> "models.ModelThree" + # type: (...) -> "_models.ModelThree" """TestTwo should be in OperationGroupOneOperations. Takes in ModelThree and ouputs ModelThree. :param parameter_one: A ModelThree parameter. @@ -59,7 +59,7 @@ def test_two( :rtype: ~multiapinoasync.v3.models.ModelThree :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModelThree"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelThree"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -92,7 +92,7 @@ def test_two( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ModelThree', pipeline_response) diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_operation_group_two_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_operation_group_two_operations.py index 8273caf6096..7b9115a4edb 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_operation_group_two_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_operation_group_two_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class OperationGroupTwoOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer): def test_four( self, - input=None, # type: Optional[Union[IO, "models.SourcePath"]] + input=None, # type: Optional[Union[IO, "_models.SourcePath"]] **kwargs # type: Any ): # type: (...) -> None @@ -102,7 +102,7 @@ def test_four( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -147,7 +147,7 @@ def test_five( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/_operations_mixin.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/_operations_mixin.py index 4d05a30b175..fac194d40ab 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/_operations_mixin.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/_operations_mixin.py @@ -29,7 +29,7 @@ class MultiapiServiceClientOperationsMixin(object): def begin_test_lro( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): """Put in whatever shape of Product you want, will return a Product with id equal to 100. @@ -62,7 +62,7 @@ def begin_test_lro( def begin_test_lro_and_paging( self, client_request_id=None, # type: Optional[str] - test_lro_and_paging_options=None, # type: Optional["models.TestLroAndPagingOptions"] + test_lro_and_paging_options=None, # type: Optional["_models.TestLroAndPagingOptions"] **kwargs # type: Any ): """A long-running paging operation that includes a nextLink that has 10 pages. diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/aio/_operations_mixin.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/aio/_operations_mixin.py index 44b6a2e1ffd..48ad6223cb0 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/aio/_operations_mixin.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/aio/_operations_mixin.py @@ -25,9 +25,9 @@ class MultiapiServiceClientOperationsMixin(object): async def begin_test_lro( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Put in whatever shape of Product you want, will return a Product with id equal to 100. :param product: Product to put. @@ -58,9 +58,9 @@ async def begin_test_lro( def begin_test_lro_and_paging( self, client_request_id: Optional[str] = None, - test_lro_and_paging_options: Optional["models.TestLroAndPagingOptions"] = None, + test_lro_and_paging_options: Optional["_models.TestLroAndPagingOptions"] = None, **kwargs - ) -> AsyncLROPoller[AsyncItemPaged["models.PagingResult"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.PagingResult"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: @@ -125,7 +125,7 @@ async def test_one( def test_paging( self, **kwargs - ) -> AsyncItemPaged["models.PagingResult"]: + ) -> AsyncItemPaged["_models.PagingResult"]: """Returns ModelThree with optionalProperty 'paged'. :keyword callable cls: A custom type or function that will be passed the direct response diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/_metadata.json b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/_metadata.json index 49541dcf25e..4d40942798e 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/_metadata.json @@ -57,48 +57,48 @@ }, "_test_lro_initial" : { "sync": { - "signature": "def _test_lro_initial(\n self,\n product=None, # type: Optional[\"models.Product\"]\n **kwargs # type: Any\n):\n", + "signature": "def _test_lro_initial(\n self,\n product=None, # type: Optional[\"_models.Product\"]\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param product: Product to put.\n:type product: ~multiapiwithsubmodule.submodule.v1.models.Product\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Product, or the result of cls(response)\n:rtype: ~multiapiwithsubmodule.submodule.v1.models.Product or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _test_lro_initial(\n self,\n product: Optional[\"models.Product\"] = None,\n **kwargs\n) -\u003e Optional[\"models.Product\"]:\n", + "signature": "async def _test_lro_initial(\n self,\n product: Optional[\"_models.Product\"] = None,\n **kwargs\n) -\u003e Optional[\"_models.Product\"]:\n", "doc": "\"\"\"\n\n:param product: Product to put.\n:type product: ~multiapiwithsubmodule.submodule.v1.models.Product\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Product, or the result of cls(response)\n:rtype: ~multiapiwithsubmodule.submodule.v1.models.Product or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "product" }, "begin_test_lro" : { "sync": { - "signature": "def begin_test_lro(\n self,\n product=None, # type: Optional[\"models.Product\"]\n **kwargs # type: Any\n):\n", + "signature": "def begin_test_lro(\n self,\n product=None, # type: Optional[\"_models.Product\"]\n **kwargs # type: Any\n):\n", "doc": "\"\"\"Put in whatever shape of Product you want, will return a Product with id equal to 100.\n\n:param product: Product to put.\n:type product: ~multiapiwithsubmodule.submodule.v1.models.Product\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either Product or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~multiapiwithsubmodule.submodule.v1.models.Product]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def begin_test_lro(\n self,\n product: Optional[\"models.Product\"] = None,\n **kwargs\n) -\u003e AsyncLROPoller[\"models.Product\"]:\n", + "signature": "async def begin_test_lro(\n self,\n product: Optional[\"_models.Product\"] = None,\n **kwargs\n) -\u003e AsyncLROPoller[\"_models.Product\"]:\n", "doc": "\"\"\"Put in whatever shape of Product you want, will return a Product with id equal to 100.\n\n:param product: Product to put.\n:type product: ~multiapiwithsubmodule.submodule.v1.models.Product\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either Product or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~multiapiwithsubmodule.submodule.v1.models.Product]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "product" }, "_test_lro_and_paging_initial" : { "sync": { - "signature": "def _test_lro_and_paging_initial(\n self,\n client_request_id=None, # type: Optional[str]\n test_lro_and_paging_options=None, # type: Optional[\"models.TestLroAndPagingOptions\"]\n **kwargs # type: Any\n):\n", + "signature": "def _test_lro_and_paging_initial(\n self,\n client_request_id=None, # type: Optional[str]\n test_lro_and_paging_options=None, # type: Optional[\"_models.TestLroAndPagingOptions\"]\n **kwargs # type: Any\n):\n", "doc": "\"\"\"\n\n:param client_request_id:\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group.\n:type test_lro_and_paging_options: ~multiapiwithsubmodule.submodule.v1.models.TestLroAndPagingOptions\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: PagingResult, or the result of cls(response)\n:rtype: ~multiapiwithsubmodule.submodule.v1.models.PagingResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, - "signature": "async def _test_lro_and_paging_initial(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[\"models.TestLroAndPagingOptions\"] = None,\n **kwargs\n) -\u003e \"models.PagingResult\":\n", + "signature": "async def _test_lro_and_paging_initial(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[\"_models.TestLroAndPagingOptions\"] = None,\n **kwargs\n) -\u003e \"_models.PagingResult\":\n", "doc": "\"\"\"\n\n:param client_request_id:\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group.\n:type test_lro_and_paging_options: ~multiapiwithsubmodule.submodule.v1.models.TestLroAndPagingOptions\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: PagingResult, or the result of cls(response)\n:rtype: ~multiapiwithsubmodule.submodule.v1.models.PagingResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "client_request_id, test_lro_and_paging_options" }, "begin_test_lro_and_paging" : { "sync": { - "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id=None, # type: Optional[str]\n test_lro_and_paging_options=None, # type: Optional[\"models.TestLroAndPagingOptions\"]\n **kwargs # type: Any\n):\n", + "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id=None, # type: Optional[str]\n test_lro_and_paging_options=None, # type: Optional[\"_models.TestLroAndPagingOptions\"]\n **kwargs # type: Any\n):\n", "doc": "\"\"\"A long-running paging operation that includes a nextLink that has 10 pages.\n\n:param client_request_id:\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group.\n:type test_lro_and_paging_options: ~multiapiwithsubmodule.submodule.v1.models.TestLroAndPagingOptions\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns an iterator like instance of either PagingResult or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~multiapiwithsubmodule.submodule.v1.models.PagingResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "async": { "coroutine": false, - "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[\"models.TestLroAndPagingOptions\"] = None,\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"models.PagingResult\"]]:\n", + "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[\"_models.TestLroAndPagingOptions\"] = None,\n **kwargs\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.PagingResult\"]]:\n", "doc": "\"\"\"A long-running paging operation that includes a nextLink that has 10 pages.\n\n:param client_request_id:\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group.\n:type test_lro_and_paging_options: ~multiapiwithsubmodule.submodule.v1.models.TestLroAndPagingOptions\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: True for ARMPolling, False for no polling, or a\n polling object for personal polling strategy\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns an iterator like instance of either PagingResult or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~multiapiwithsubmodule.submodule.v1.models.PagingResult]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" }, "call": "client_request_id, test_lro_and_paging_options" diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations/_multiapi_service_client_operations.py index 8da802454ae..7f152d57b78 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations/_multiapi_service_client_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +68,7 @@ async def test_one( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -78,10 +78,10 @@ async def test_one( async def _test_lro_initial( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> Optional["models.Product"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Product"]] + ) -> Optional["_models.Product"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,7 +112,7 @@ async def _test_lro_initial( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -127,9 +127,9 @@ async def _test_lro_initial( async def begin_test_lro( self, - product: Optional["models.Product"] = None, + product: Optional["_models.Product"] = None, **kwargs - ) -> AsyncLROPoller["models.Product"]: + ) -> AsyncLROPoller["_models.Product"]: """Put in whatever shape of Product you want, will return a Product with id equal to 100. :param product: Product to put. @@ -145,7 +145,7 @@ async def begin_test_lro( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -185,10 +185,10 @@ def get_long_running_output(pipeline_response): async def _test_lro_and_paging_initial( self, client_request_id: Optional[str] = None, - test_lro_and_paging_options: Optional["models.TestLroAndPagingOptions"] = None, + test_lro_and_paging_options: Optional["_models.TestLroAndPagingOptions"] = None, **kwargs - ) -> "models.PagingResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + ) -> "_models.PagingResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -236,9 +236,9 @@ async def _test_lro_and_paging_initial( async def begin_test_lro_and_paging( self, client_request_id: Optional[str] = None, - test_lro_and_paging_options: Optional["models.TestLroAndPagingOptions"] = None, + test_lro_and_paging_options: Optional["_models.TestLroAndPagingOptions"] = None, **kwargs - ) -> AsyncLROPoller[AsyncItemPaged["models.PagingResult"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.PagingResult"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: @@ -255,7 +255,7 @@ async def begin_test_lro_and_paging( :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~multiapiwithsubmodule.submodule.v1.models.PagingResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -312,7 +312,7 @@ async def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations/_operation_group_one_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations/_operation_group_one_operations.py index 9e02439a979..f49a071e387 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations/_operation_group_one_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations/_operation_group_one_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class OperationGroupOneOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -76,7 +76,7 @@ async def test_two( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_multiapi_service_client_operations.py index 6c9ffcf492d..0bc60612fef 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_multiapi_service_client_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -73,7 +73,7 @@ def test_one( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -83,11 +83,11 @@ def test_one( def _test_lro_initial( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> Optional["models.Product"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Product"]] + # type: (...) -> Optional["_models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,7 +118,7 @@ def _test_lro_initial( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -133,10 +133,10 @@ def _test_lro_initial( def begin_test_lro( self, - product=None, # type: Optional["models.Product"] + product=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Product"] + # type: (...) -> LROPoller["_models.Product"] """Put in whatever shape of Product you want, will return a Product with id equal to 100. :param product: Product to put. @@ -152,7 +152,7 @@ def begin_test_lro( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -192,11 +192,11 @@ def get_long_running_output(pipeline_response): def _test_lro_and_paging_initial( self, client_request_id=None, # type: Optional[str] - test_lro_and_paging_options=None, # type: Optional["models.TestLroAndPagingOptions"] + test_lro_and_paging_options=None, # type: Optional["_models.TestLroAndPagingOptions"] **kwargs # type: Any ): - # type: (...) -> "models.PagingResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + # type: (...) -> "_models.PagingResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -244,10 +244,10 @@ def _test_lro_and_paging_initial( def begin_test_lro_and_paging( self, client_request_id=None, # type: Optional[str] - test_lro_and_paging_options=None, # type: Optional["models.TestLroAndPagingOptions"] + test_lro_and_paging_options=None, # type: Optional["_models.TestLroAndPagingOptions"] **kwargs # type: Any ): - # type: (...) -> LROPoller[ItemPaged["models.PagingResult"]] + # type: (...) -> LROPoller[ItemPaged["_models.PagingResult"]] """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: @@ -264,7 +264,7 @@ def begin_test_lro_and_paging( :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~multiapiwithsubmodule.submodule.v1.models.PagingResult]] :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -321,7 +321,7 @@ def get_next(next_link=None): return pipeline_response polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_operation_group_one_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_operation_group_one_operations.py index 58c3d4af1bb..529df4c28d3 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_operation_group_one_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_operation_group_one_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class OperationGroupOneOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -81,7 +81,7 @@ def test_two( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/_metadata.json b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/_metadata.json index 15b148b4e98..655327a47eb 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/_metadata.json @@ -51,7 +51,7 @@ }, "async": { "coroutine": true, - "signature": "async def test_one(\n self,\n id: int,\n message: Optional[str] = None,\n **kwargs\n) -\u003e \"models.ModelTwo\":\n", + "signature": "async def test_one(\n self,\n id: int,\n message: Optional[str] = None,\n **kwargs\n) -\u003e \"_models.ModelTwo\":\n", "doc": "\"\"\"TestOne should be in an SecondVersionOperationsMixin. Returns ModelTwo.\n\n:param id: An int parameter.\n:type id: int\n:param message: An optional string parameter.\n:type message: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ModelTwo, or the result of cls(response)\n:rtype: ~multiapiwithsubmodule.submodule.v2.models.ModelTwo\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "id, message" diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/aio/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/aio/operations/_multiapi_service_client_operations.py index 0073d1fbaa7..8dd5d64f0b9 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/aio/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/aio/operations/_multiapi_service_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -25,7 +25,7 @@ async def test_one( id: int, message: Optional[str] = None, **kwargs - ) -> "models.ModelTwo": + ) -> "_models.ModelTwo": """TestOne should be in an SecondVersionOperationsMixin. Returns ModelTwo. :param id: An int parameter. @@ -37,7 +37,7 @@ async def test_one( :rtype: ~multiapiwithsubmodule.submodule.v2.models.ModelTwo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModelTwo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelTwo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -65,7 +65,7 @@ async def test_one( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ModelTwo', pipeline_response) diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/aio/operations/_operation_group_one_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/aio/operations/_operation_group_one_operations.py index f051d4866a5..8e7da6d97f2 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/aio/operations/_operation_group_one_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/aio/operations/_operation_group_one_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class OperationGroupOneOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -42,9 +42,9 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def test_two( self, - parameter_one: Optional["models.ModelTwo"] = None, + parameter_one: Optional["_models.ModelTwo"] = None, **kwargs - ) -> "models.ModelTwo": + ) -> "_models.ModelTwo": """TestTwo should be in OperationGroupOneOperations. Takes in ModelTwo and ouputs ModelTwo. :param parameter_one: A ModelTwo parameter. @@ -54,7 +54,7 @@ async def test_two( :rtype: ~multiapiwithsubmodule.submodule.v2.models.ModelTwo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModelTwo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelTwo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -87,7 +87,7 @@ async def test_two( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ModelTwo', pipeline_response) @@ -134,7 +134,7 @@ async def test_three( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/aio/operations/_operation_group_two_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/aio/operations/_operation_group_two_operations.py index f46e6f56b6b..ddf3a884980 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/aio/operations/_operation_group_two_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/aio/operations/_operation_group_two_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class OperationGroupTwoOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def test_four( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/operations/_multiapi_service_client_operations.py index 49f0673da63..91049ff9180 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/operations/_multiapi_service_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -30,7 +30,7 @@ def test_one( message=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ModelTwo" + # type: (...) -> "_models.ModelTwo" """TestOne should be in an SecondVersionOperationsMixin. Returns ModelTwo. :param id: An int parameter. @@ -42,7 +42,7 @@ def test_one( :rtype: ~multiapiwithsubmodule.submodule.v2.models.ModelTwo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModelTwo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelTwo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -70,7 +70,7 @@ def test_one( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ModelTwo', pipeline_response) diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/operations/_operation_group_one_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/operations/_operation_group_one_operations.py index 869cb2f6d00..7a5bfc4e2d5 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/operations/_operation_group_one_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/operations/_operation_group_one_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class OperationGroupOneOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -46,10 +46,10 @@ def __init__(self, client, config, serializer, deserializer): def test_two( self, - parameter_one=None, # type: Optional["models.ModelTwo"] + parameter_one=None, # type: Optional["_models.ModelTwo"] **kwargs # type: Any ): - # type: (...) -> "models.ModelTwo" + # type: (...) -> "_models.ModelTwo" """TestTwo should be in OperationGroupOneOperations. Takes in ModelTwo and ouputs ModelTwo. :param parameter_one: A ModelTwo parameter. @@ -59,7 +59,7 @@ def test_two( :rtype: ~multiapiwithsubmodule.submodule.v2.models.ModelTwo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModelTwo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelTwo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -92,7 +92,7 @@ def test_two( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ModelTwo', pipeline_response) @@ -140,7 +140,7 @@ def test_three( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/operations/_operation_group_two_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/operations/_operation_group_two_operations.py index 5a8c11587a5..a0a1241536a 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/operations/_operation_group_two_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/operations/_operation_group_two_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class OperationGroupTwoOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def test_four( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/_metadata.json b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/_metadata.json index 26d89df83cf..67571b362e3 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/_metadata.json @@ -51,7 +51,7 @@ }, "async": { "coroutine": false, - "signature": "def test_paging(\n self,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.PagingResult\"]:\n", + "signature": "def test_paging(\n self,\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.PagingResult\"]:\n", "doc": "\"\"\"Returns ModelThree with optionalProperty \u0027paged\u0027.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either PagingResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~multiapiwithsubmodule.submodule.v3.models.PagingResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "" diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_multiapi_service_client_operations.py index afec5e965e2..8ea551a3c08 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_multiapi_service_client_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -24,7 +24,7 @@ class MultiapiServiceClientOperationsMixin: def test_paging( self, **kwargs - ) -> AsyncIterable["models.PagingResult"]: + ) -> AsyncIterable["_models.PagingResult"]: """Returns ModelThree with optionalProperty 'paged'. :keyword callable cls: A custom type or function that will be passed the direct response @@ -32,7 +32,7 @@ def test_paging( :rtype: ~azure.core.async_paging.AsyncItemPaged[~multiapiwithsubmodule.submodule.v3.models.PagingResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_operation_group_one_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_operation_group_one_operations.py index b86a539b251..85e8af3818d 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_operation_group_one_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_operation_group_one_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class OperationGroupOneOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -42,9 +42,9 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def test_two( self, - parameter_one: Optional["models.ModelThree"] = None, + parameter_one: Optional["_models.ModelThree"] = None, **kwargs - ) -> "models.ModelThree": + ) -> "_models.ModelThree": """TestTwo should be in OperationGroupOneOperations. Takes in ModelThree and ouputs ModelThree. :param parameter_one: A ModelThree parameter. @@ -54,7 +54,7 @@ async def test_two( :rtype: ~multiapiwithsubmodule.submodule.v3.models.ModelThree :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModelThree"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelThree"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -87,7 +87,7 @@ async def test_two( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ModelThree', pipeline_response) diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_operation_group_two_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_operation_group_two_operations.py index 5d111371873..f28bbfaae16 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_operation_group_two_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_operation_group_two_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class OperationGroupTwoOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -42,7 +42,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def test_four( self, - input: Optional[Union[IO, "models.SourcePath"]] = None, + input: Optional[Union[IO, "_models.SourcePath"]] = None, **kwargs ) -> None: """TestFour should be in OperationGroupTwoOperations. @@ -97,7 +97,7 @@ async def test_four( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -141,7 +141,7 @@ async def test_five( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_multiapi_service_client_operations.py index de70c64333f..b60d307eb41 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_multiapi_service_client_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -29,7 +29,7 @@ def test_paging( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.PagingResult"] + # type: (...) -> Iterable["_models.PagingResult"] """Returns ModelThree with optionalProperty 'paged'. :keyword callable cls: A custom type or function that will be passed the direct response @@ -37,7 +37,7 @@ def test_paging( :rtype: ~azure.core.paging.ItemPaged[~multiapiwithsubmodule.submodule.v3.models.PagingResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PagingResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagingResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_operation_group_one_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_operation_group_one_operations.py index bc24a496422..6ae3e7c0847 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_operation_group_one_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_operation_group_one_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class OperationGroupOneOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -46,10 +46,10 @@ def __init__(self, client, config, serializer, deserializer): def test_two( self, - parameter_one=None, # type: Optional["models.ModelThree"] + parameter_one=None, # type: Optional["_models.ModelThree"] **kwargs # type: Any ): - # type: (...) -> "models.ModelThree" + # type: (...) -> "_models.ModelThree" """TestTwo should be in OperationGroupOneOperations. Takes in ModelThree and ouputs ModelThree. :param parameter_one: A ModelThree parameter. @@ -59,7 +59,7 @@ def test_two( :rtype: ~multiapiwithsubmodule.submodule.v3.models.ModelThree :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ModelThree"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ModelThree"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -92,7 +92,7 @@ def test_two( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ModelThree', pipeline_response) diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_operation_group_two_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_operation_group_two_operations.py index 3c7c2e59ad6..2d594512da1 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_operation_group_two_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_operation_group_two_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class OperationGroupTwoOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer): def test_four( self, - input=None, # type: Optional[Union[IO, "models.SourcePath"]] + input=None, # type: Optional[Union[IO, "_models.SourcePath"]] **kwargs # type: Any ): # type: (...) -> None @@ -102,7 +102,7 @@ def test_four( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -147,7 +147,7 @@ def test_five( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/test/vanilla/AcceptanceTests/asynctests/test_xms_error.py b/test/vanilla/AcceptanceTests/asynctests/test_xms_error.py index 4cfeaceb7f6..2074e9b5adf 100644 --- a/test/vanilla/AcceptanceTests/asynctests/test_xms_error.py +++ b/test/vanilla/AcceptanceTests/asynctests/test_xms_error.py @@ -97,3 +97,10 @@ async def test_do_something_error(self, client): with pytest.raises(ResourceNotFoundError) as excinfo: await client.pet.do_something("fetch") + + @pytest.mark.asyncio + async def test_error_deserialization_with_param_name_models(self, client): + with pytest.raises(HttpResponseError) as excinfo: + await client.pet.has_models_param() + assert isinstance(excinfo.value.model, PetSadError) + assert excinfo.value.status_code == 500 diff --git a/test/vanilla/AcceptanceTests/test_xms_error.py b/test/vanilla/AcceptanceTests/test_xms_error.py index f53dede41e6..cf0f68baf5c 100644 --- a/test/vanilla/AcceptanceTests/test_xms_error.py +++ b/test/vanilla/AcceptanceTests/test_xms_error.py @@ -92,6 +92,12 @@ def test_do_something_error(self, client): with pytest.raises(ResourceNotFoundError) as excinfo: client.pet.do_something("fetch") + def test_error_deserialization_with_param_name_models(self, client): + with pytest.raises(HttpResponseError) as excinfo: + client.pet.has_models_param() + assert isinstance(excinfo.value.model, PetSadError) + assert excinfo.value.status_code == 500 + def test_models(self): from xmserrorresponse.models import Animal diff --git a/test/vanilla/Expected/AcceptanceTests/AdditionalProperties/additionalproperties/aio/operations/_pets_operations.py b/test/vanilla/Expected/AcceptanceTests/AdditionalProperties/additionalproperties/aio/operations/_pets_operations.py index 167111b4671..4335ccc5b5c 100644 --- a/test/vanilla/Expected/AcceptanceTests/AdditionalProperties/additionalproperties/aio/operations/_pets_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/AdditionalProperties/additionalproperties/aio/operations/_pets_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class PetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -43,9 +43,9 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def create_ap_true( self, - create_parameters: "models.PetAPTrue", + create_parameters: "_models.PetAPTrue", **kwargs - ) -> "models.PetAPTrue": + ) -> "_models.PetAPTrue": """Create a Pet which contains more properties than what is defined. :param create_parameters: @@ -55,7 +55,7 @@ async def create_ap_true( :rtype: ~additionalproperties.models.PetAPTrue :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PetAPTrue"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PetAPTrue"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -83,7 +83,7 @@ async def create_ap_true( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('PetAPTrue', pipeline_response) @@ -97,9 +97,9 @@ async def create_ap_true( @distributed_trace_async async def create_cat_ap_true( self, - create_parameters: "models.CatAPTrue", + create_parameters: "_models.CatAPTrue", **kwargs - ) -> "models.CatAPTrue": + ) -> "_models.CatAPTrue": """Create a CatAPTrue which contains more properties than what is defined. :param create_parameters: @@ -109,7 +109,7 @@ async def create_cat_ap_true( :rtype: ~additionalproperties.models.CatAPTrue :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CatAPTrue"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CatAPTrue"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -137,7 +137,7 @@ async def create_cat_ap_true( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('CatAPTrue', pipeline_response) @@ -151,9 +151,9 @@ async def create_cat_ap_true( @distributed_trace_async async def create_ap_object( self, - create_parameters: "models.PetAPObject", + create_parameters: "_models.PetAPObject", **kwargs - ) -> "models.PetAPObject": + ) -> "_models.PetAPObject": """Create a Pet which contains more properties than what is defined. :param create_parameters: @@ -163,7 +163,7 @@ async def create_ap_object( :rtype: ~additionalproperties.models.PetAPObject :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PetAPObject"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PetAPObject"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ async def create_ap_object( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('PetAPObject', pipeline_response) @@ -205,9 +205,9 @@ async def create_ap_object( @distributed_trace_async async def create_ap_string( self, - create_parameters: "models.PetAPString", + create_parameters: "_models.PetAPString", **kwargs - ) -> "models.PetAPString": + ) -> "_models.PetAPString": """Create a Pet which contains more properties than what is defined. :param create_parameters: @@ -217,7 +217,7 @@ async def create_ap_string( :rtype: ~additionalproperties.models.PetAPString :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PetAPString"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PetAPString"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -245,7 +245,7 @@ async def create_ap_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('PetAPString', pipeline_response) @@ -259,9 +259,9 @@ async def create_ap_string( @distributed_trace_async async def create_ap_in_properties( self, - create_parameters: "models.PetAPInProperties", + create_parameters: "_models.PetAPInProperties", **kwargs - ) -> "models.PetAPInProperties": + ) -> "_models.PetAPInProperties": """Create a Pet which contains more properties than what is defined. :param create_parameters: @@ -271,7 +271,7 @@ async def create_ap_in_properties( :rtype: ~additionalproperties.models.PetAPInProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PetAPInProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PetAPInProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -299,7 +299,7 @@ async def create_ap_in_properties( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('PetAPInProperties', pipeline_response) @@ -313,9 +313,9 @@ async def create_ap_in_properties( @distributed_trace_async async def create_ap_in_properties_with_ap_string( self, - create_parameters: "models.PetAPInPropertiesWithAPString", + create_parameters: "_models.PetAPInPropertiesWithAPString", **kwargs - ) -> "models.PetAPInPropertiesWithAPString": + ) -> "_models.PetAPInPropertiesWithAPString": """Create a Pet which contains more properties than what is defined. :param create_parameters: @@ -325,7 +325,7 @@ async def create_ap_in_properties_with_ap_string( :rtype: ~additionalproperties.models.PetAPInPropertiesWithAPString :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PetAPInPropertiesWithAPString"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PetAPInPropertiesWithAPString"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -353,7 +353,7 @@ async def create_ap_in_properties_with_ap_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('PetAPInPropertiesWithAPString', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/AdditionalProperties/additionalproperties/operations/_pets_operations.py b/test/vanilla/Expected/AcceptanceTests/AdditionalProperties/additionalproperties/operations/_pets_operations.py index 6ffb6f01354..ec1bc58a86a 100644 --- a/test/vanilla/Expected/AcceptanceTests/AdditionalProperties/additionalproperties/operations/_pets_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/AdditionalProperties/additionalproperties/operations/_pets_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class PetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -47,10 +47,10 @@ def __init__(self, client, config, serializer, deserializer): @distributed_trace def create_ap_true( self, - create_parameters, # type: "models.PetAPTrue" + create_parameters, # type: "_models.PetAPTrue" **kwargs # type: Any ): - # type: (...) -> "models.PetAPTrue" + # type: (...) -> "_models.PetAPTrue" """Create a Pet which contains more properties than what is defined. :param create_parameters: @@ -60,7 +60,7 @@ def create_ap_true( :rtype: ~additionalproperties.models.PetAPTrue :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PetAPTrue"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PetAPTrue"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ def create_ap_true( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('PetAPTrue', pipeline_response) @@ -102,10 +102,10 @@ def create_ap_true( @distributed_trace def create_cat_ap_true( self, - create_parameters, # type: "models.CatAPTrue" + create_parameters, # type: "_models.CatAPTrue" **kwargs # type: Any ): - # type: (...) -> "models.CatAPTrue" + # type: (...) -> "_models.CatAPTrue" """Create a CatAPTrue which contains more properties than what is defined. :param create_parameters: @@ -115,7 +115,7 @@ def create_cat_ap_true( :rtype: ~additionalproperties.models.CatAPTrue :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CatAPTrue"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CatAPTrue"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -143,7 +143,7 @@ def create_cat_ap_true( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('CatAPTrue', pipeline_response) @@ -157,10 +157,10 @@ def create_cat_ap_true( @distributed_trace def create_ap_object( self, - create_parameters, # type: "models.PetAPObject" + create_parameters, # type: "_models.PetAPObject" **kwargs # type: Any ): - # type: (...) -> "models.PetAPObject" + # type: (...) -> "_models.PetAPObject" """Create a Pet which contains more properties than what is defined. :param create_parameters: @@ -170,7 +170,7 @@ def create_ap_object( :rtype: ~additionalproperties.models.PetAPObject :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PetAPObject"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PetAPObject"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -198,7 +198,7 @@ def create_ap_object( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('PetAPObject', pipeline_response) @@ -212,10 +212,10 @@ def create_ap_object( @distributed_trace def create_ap_string( self, - create_parameters, # type: "models.PetAPString" + create_parameters, # type: "_models.PetAPString" **kwargs # type: Any ): - # type: (...) -> "models.PetAPString" + # type: (...) -> "_models.PetAPString" """Create a Pet which contains more properties than what is defined. :param create_parameters: @@ -225,7 +225,7 @@ def create_ap_string( :rtype: ~additionalproperties.models.PetAPString :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PetAPString"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PetAPString"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,7 +253,7 @@ def create_ap_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('PetAPString', pipeline_response) @@ -267,10 +267,10 @@ def create_ap_string( @distributed_trace def create_ap_in_properties( self, - create_parameters, # type: "models.PetAPInProperties" + create_parameters, # type: "_models.PetAPInProperties" **kwargs # type: Any ): - # type: (...) -> "models.PetAPInProperties" + # type: (...) -> "_models.PetAPInProperties" """Create a Pet which contains more properties than what is defined. :param create_parameters: @@ -280,7 +280,7 @@ def create_ap_in_properties( :rtype: ~additionalproperties.models.PetAPInProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PetAPInProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PetAPInProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -308,7 +308,7 @@ def create_ap_in_properties( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('PetAPInProperties', pipeline_response) @@ -322,10 +322,10 @@ def create_ap_in_properties( @distributed_trace def create_ap_in_properties_with_ap_string( self, - create_parameters, # type: "models.PetAPInPropertiesWithAPString" + create_parameters, # type: "_models.PetAPInPropertiesWithAPString" **kwargs # type: Any ): - # type: (...) -> "models.PetAPInPropertiesWithAPString" + # type: (...) -> "_models.PetAPInPropertiesWithAPString" """Create a Pet which contains more properties than what is defined. :param create_parameters: @@ -335,7 +335,7 @@ def create_ap_in_properties_with_ap_string( :rtype: ~additionalproperties.models.PetAPInPropertiesWithAPString :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PetAPInPropertiesWithAPString"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PetAPInPropertiesWithAPString"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -363,7 +363,7 @@ def create_ap_in_properties_with_ap_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('PetAPInPropertiesWithAPString', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyArray/bodyarray/aio/operations/_array_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyArray/bodyarray/aio/operations/_array_operations.py index 06f7980bcc0..e7bb6ac638b 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyArray/bodyarray/aio/operations/_array_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyArray/bodyarray/aio/operations/_array_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ArrayOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -76,7 +76,7 @@ async def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[int]', pipeline_response) @@ -122,7 +122,7 @@ async def get_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[int]', pipeline_response) @@ -168,7 +168,7 @@ async def get_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[int]', pipeline_response) @@ -222,7 +222,7 @@ async def put_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -265,7 +265,7 @@ async def get_boolean_tfft( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[bool]', pipeline_response) @@ -319,7 +319,7 @@ async def put_boolean_tfft( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -362,7 +362,7 @@ async def get_boolean_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[bool]', pipeline_response) @@ -408,7 +408,7 @@ async def get_boolean_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[bool]', pipeline_response) @@ -454,7 +454,7 @@ async def get_integer_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[int]', pipeline_response) @@ -508,7 +508,7 @@ async def put_integer_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -551,7 +551,7 @@ async def get_int_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[int]', pipeline_response) @@ -597,7 +597,7 @@ async def get_int_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[int]', pipeline_response) @@ -643,7 +643,7 @@ async def get_long_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[long]', pipeline_response) @@ -697,7 +697,7 @@ async def put_long_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -740,7 +740,7 @@ async def get_long_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[long]', pipeline_response) @@ -786,7 +786,7 @@ async def get_long_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[long]', pipeline_response) @@ -832,7 +832,7 @@ async def get_float_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[float]', pipeline_response) @@ -886,7 +886,7 @@ async def put_float_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -929,7 +929,7 @@ async def get_float_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[float]', pipeline_response) @@ -975,7 +975,7 @@ async def get_float_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[float]', pipeline_response) @@ -1021,7 +1021,7 @@ async def get_double_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[float]', pipeline_response) @@ -1075,7 +1075,7 @@ async def put_double_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1118,7 +1118,7 @@ async def get_double_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[float]', pipeline_response) @@ -1164,7 +1164,7 @@ async def get_double_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[float]', pipeline_response) @@ -1210,7 +1210,7 @@ async def get_string_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1264,7 +1264,7 @@ async def put_string_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1276,7 +1276,7 @@ async def put_string_valid( async def get_enum_valid( self, **kwargs - ) -> List[Union[str, "models.FooEnum"]]: + ) -> List[Union[str, "_models.FooEnum"]]: """Get enum array value ['foo1', 'foo2', 'foo3']. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1284,7 +1284,7 @@ async def get_enum_valid( :rtype: list[str or ~bodyarray.models.FooEnum] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List[Union[str, "models.FooEnum"]]] + cls = kwargs.pop('cls', None) # type: ClsType[List[Union[str, "_models.FooEnum"]]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1307,7 +1307,7 @@ async def get_enum_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1321,7 +1321,7 @@ async def get_enum_valid( @distributed_trace_async async def put_enum_valid( self, - array_body: List[Union[str, "models.FooEnum"]], + array_body: List[Union[str, "_models.FooEnum"]], **kwargs ) -> None: """Set array value ['foo1', 'foo2', 'foo3']. @@ -1361,7 +1361,7 @@ async def put_enum_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1373,7 +1373,7 @@ async def put_enum_valid( async def get_string_enum_valid( self, **kwargs - ) -> List[Union[str, "models.Enum0"]]: + ) -> List[Union[str, "_models.Enum0"]]: """Get enum array value ['foo1', 'foo2', 'foo3']. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1381,7 +1381,7 @@ async def get_string_enum_valid( :rtype: list[str or ~bodyarray.models.Enum0] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List[Union[str, "models.Enum0"]]] + cls = kwargs.pop('cls', None) # type: ClsType[List[Union[str, "_models.Enum0"]]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1404,7 +1404,7 @@ async def get_string_enum_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1418,7 +1418,7 @@ async def get_string_enum_valid( @distributed_trace_async async def put_string_enum_valid( self, - array_body: List[Union[str, "models.Enum1"]], + array_body: List[Union[str, "_models.Enum1"]], **kwargs ) -> None: """Set array value ['foo1', 'foo2', 'foo3']. @@ -1458,7 +1458,7 @@ async def put_string_enum_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1501,7 +1501,7 @@ async def get_string_with_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1547,7 +1547,7 @@ async def get_string_with_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1594,7 +1594,7 @@ async def get_uuid_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1649,7 +1649,7 @@ async def put_uuid_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1692,7 +1692,7 @@ async def get_uuid_invalid_chars( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1738,7 +1738,7 @@ async def get_date_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[date]', pipeline_response) @@ -1792,7 +1792,7 @@ async def put_date_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1835,7 +1835,7 @@ async def get_date_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[date]', pipeline_response) @@ -1881,7 +1881,7 @@ async def get_date_invalid_chars( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[date]', pipeline_response) @@ -1928,7 +1928,7 @@ async def get_date_time_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[iso-8601]', pipeline_response) @@ -1983,7 +1983,7 @@ async def put_date_time_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2026,7 +2026,7 @@ async def get_date_time_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[iso-8601]', pipeline_response) @@ -2072,7 +2072,7 @@ async def get_date_time_invalid_chars( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[iso-8601]', pipeline_response) @@ -2119,7 +2119,7 @@ async def get_date_time_rfc1123_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[rfc-1123]', pipeline_response) @@ -2174,7 +2174,7 @@ async def put_date_time_rfc1123_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2217,7 +2217,7 @@ async def get_duration_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[duration]', pipeline_response) @@ -2271,7 +2271,7 @@ async def put_duration_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2315,7 +2315,7 @@ async def get_byte_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[bytearray]', pipeline_response) @@ -2370,7 +2370,7 @@ async def put_byte_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2413,7 +2413,7 @@ async def get_byte_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[bytearray]', pipeline_response) @@ -2460,7 +2460,7 @@ async def get_base64_url( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[base64]', pipeline_response) @@ -2475,7 +2475,7 @@ async def get_base64_url( async def get_complex_null( self, **kwargs - ) -> List["models.Product"]: + ) -> List["_models.Product"]: """Get array of complex type null value. :keyword callable cls: A custom type or function that will be passed the direct response @@ -2483,7 +2483,7 @@ async def get_complex_null( :rtype: list[~bodyarray.models.Product] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2506,7 +2506,7 @@ async def get_complex_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[Product]', pipeline_response) @@ -2521,7 +2521,7 @@ async def get_complex_null( async def get_complex_empty( self, **kwargs - ) -> List["models.Product"]: + ) -> List["_models.Product"]: """Get empty array of complex type []. :keyword callable cls: A custom type or function that will be passed the direct response @@ -2529,7 +2529,7 @@ async def get_complex_empty( :rtype: list[~bodyarray.models.Product] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2552,7 +2552,7 @@ async def get_complex_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[Product]', pipeline_response) @@ -2567,7 +2567,7 @@ async def get_complex_empty( async def get_complex_item_null( self, **kwargs - ) -> List["models.Product"]: + ) -> List["_models.Product"]: """Get array of complex type with null item [{'integer': 1 'string': '2'}, null, {'integer': 5, 'string': '6'}]. @@ -2576,7 +2576,7 @@ async def get_complex_item_null( :rtype: list[~bodyarray.models.Product] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2599,7 +2599,7 @@ async def get_complex_item_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[Product]', pipeline_response) @@ -2614,7 +2614,7 @@ async def get_complex_item_null( async def get_complex_item_empty( self, **kwargs - ) -> List["models.Product"]: + ) -> List["_models.Product"]: """Get array of complex type with empty item [{'integer': 1 'string': '2'}, {}, {'integer': 5, 'string': '6'}]. @@ -2623,7 +2623,7 @@ async def get_complex_item_empty( :rtype: list[~bodyarray.models.Product] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2646,7 +2646,7 @@ async def get_complex_item_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[Product]', pipeline_response) @@ -2661,7 +2661,7 @@ async def get_complex_item_empty( async def get_complex_valid( self, **kwargs - ) -> List["models.Product"]: + ) -> List["_models.Product"]: """Get array of complex type with [{'integer': 1 'string': '2'}, {'integer': 3, 'string': '4'}, {'integer': 5, 'string': '6'}]. @@ -2670,7 +2670,7 @@ async def get_complex_valid( :rtype: list[~bodyarray.models.Product] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2693,7 +2693,7 @@ async def get_complex_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[Product]', pipeline_response) @@ -2707,7 +2707,7 @@ async def get_complex_valid( @distributed_trace_async async def put_complex_valid( self, - array_body: List["models.Product"], + array_body: List["_models.Product"], **kwargs ) -> None: """Put an array of complex type with values [{'integer': 1 'string': '2'}, {'integer': 3, @@ -2748,7 +2748,7 @@ async def put_complex_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2791,7 +2791,7 @@ async def get_array_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[[str]]', pipeline_response) @@ -2837,7 +2837,7 @@ async def get_array_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[[str]]', pipeline_response) @@ -2883,7 +2883,7 @@ async def get_array_item_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[[str]]', pipeline_response) @@ -2929,7 +2929,7 @@ async def get_array_item_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[[str]]', pipeline_response) @@ -2975,7 +2975,7 @@ async def get_array_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[[str]]', pipeline_response) @@ -3029,7 +3029,7 @@ async def put_array_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -3072,7 +3072,7 @@ async def get_dictionary_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[{str}]', pipeline_response) @@ -3118,7 +3118,7 @@ async def get_dictionary_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[{str}]', pipeline_response) @@ -3165,7 +3165,7 @@ async def get_dictionary_item_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[{str}]', pipeline_response) @@ -3212,7 +3212,7 @@ async def get_dictionary_item_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[{str}]', pipeline_response) @@ -3259,7 +3259,7 @@ async def get_dictionary_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[{str}]', pipeline_response) @@ -3314,7 +3314,7 @@ async def put_dictionary_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/BodyArray/bodyarray/operations/_array_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyArray/bodyarray/operations/_array_operations.py index 4e6f7742bdd..c403646982f 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyArray/bodyarray/operations/_array_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyArray/bodyarray/operations/_array_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ArrayOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -81,7 +81,7 @@ def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[int]', pipeline_response) @@ -128,7 +128,7 @@ def get_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[int]', pipeline_response) @@ -175,7 +175,7 @@ def get_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[int]', pipeline_response) @@ -230,7 +230,7 @@ def put_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -274,7 +274,7 @@ def get_boolean_tfft( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[bool]', pipeline_response) @@ -329,7 +329,7 @@ def put_boolean_tfft( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -373,7 +373,7 @@ def get_boolean_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[bool]', pipeline_response) @@ -420,7 +420,7 @@ def get_boolean_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[bool]', pipeline_response) @@ -467,7 +467,7 @@ def get_integer_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[int]', pipeline_response) @@ -522,7 +522,7 @@ def put_integer_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -566,7 +566,7 @@ def get_int_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[int]', pipeline_response) @@ -613,7 +613,7 @@ def get_int_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[int]', pipeline_response) @@ -660,7 +660,7 @@ def get_long_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[long]', pipeline_response) @@ -715,7 +715,7 @@ def put_long_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -759,7 +759,7 @@ def get_long_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[long]', pipeline_response) @@ -806,7 +806,7 @@ def get_long_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[long]', pipeline_response) @@ -853,7 +853,7 @@ def get_float_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[float]', pipeline_response) @@ -908,7 +908,7 @@ def put_float_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -952,7 +952,7 @@ def get_float_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[float]', pipeline_response) @@ -999,7 +999,7 @@ def get_float_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[float]', pipeline_response) @@ -1046,7 +1046,7 @@ def get_double_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[float]', pipeline_response) @@ -1101,7 +1101,7 @@ def put_double_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1145,7 +1145,7 @@ def get_double_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[float]', pipeline_response) @@ -1192,7 +1192,7 @@ def get_double_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[float]', pipeline_response) @@ -1239,7 +1239,7 @@ def get_string_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1294,7 +1294,7 @@ def put_string_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1307,7 +1307,7 @@ def get_enum_valid( self, **kwargs # type: Any ): - # type: (...) -> List[Union[str, "models.FooEnum"]] + # type: (...) -> List[Union[str, "_models.FooEnum"]] """Get enum array value ['foo1', 'foo2', 'foo3']. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1315,7 +1315,7 @@ def get_enum_valid( :rtype: list[str or ~bodyarray.models.FooEnum] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List[Union[str, "models.FooEnum"]]] + cls = kwargs.pop('cls', None) # type: ClsType[List[Union[str, "_models.FooEnum"]]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1338,7 +1338,7 @@ def get_enum_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1352,7 +1352,7 @@ def get_enum_valid( @distributed_trace def put_enum_valid( self, - array_body, # type: List[Union[str, "models.FooEnum"]] + array_body, # type: List[Union[str, "_models.FooEnum"]] **kwargs # type: Any ): # type: (...) -> None @@ -1393,7 +1393,7 @@ def put_enum_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1406,7 +1406,7 @@ def get_string_enum_valid( self, **kwargs # type: Any ): - # type: (...) -> List[Union[str, "models.Enum0"]] + # type: (...) -> List[Union[str, "_models.Enum0"]] """Get enum array value ['foo1', 'foo2', 'foo3']. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1414,7 +1414,7 @@ def get_string_enum_valid( :rtype: list[str or ~bodyarray.models.Enum0] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List[Union[str, "models.Enum0"]]] + cls = kwargs.pop('cls', None) # type: ClsType[List[Union[str, "_models.Enum0"]]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1437,7 +1437,7 @@ def get_string_enum_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1451,7 +1451,7 @@ def get_string_enum_valid( @distributed_trace def put_string_enum_valid( self, - array_body, # type: List[Union[str, "models.Enum1"]] + array_body, # type: List[Union[str, "_models.Enum1"]] **kwargs # type: Any ): # type: (...) -> None @@ -1492,7 +1492,7 @@ def put_string_enum_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1536,7 +1536,7 @@ def get_string_with_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1583,7 +1583,7 @@ def get_string_with_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1631,7 +1631,7 @@ def get_uuid_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1687,7 +1687,7 @@ def put_uuid_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1731,7 +1731,7 @@ def get_uuid_invalid_chars( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1778,7 +1778,7 @@ def get_date_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[date]', pipeline_response) @@ -1833,7 +1833,7 @@ def put_date_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1877,7 +1877,7 @@ def get_date_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[date]', pipeline_response) @@ -1924,7 +1924,7 @@ def get_date_invalid_chars( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[date]', pipeline_response) @@ -1972,7 +1972,7 @@ def get_date_time_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[iso-8601]', pipeline_response) @@ -2028,7 +2028,7 @@ def put_date_time_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2072,7 +2072,7 @@ def get_date_time_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[iso-8601]', pipeline_response) @@ -2119,7 +2119,7 @@ def get_date_time_invalid_chars( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[iso-8601]', pipeline_response) @@ -2167,7 +2167,7 @@ def get_date_time_rfc1123_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[rfc-1123]', pipeline_response) @@ -2223,7 +2223,7 @@ def put_date_time_rfc1123_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2267,7 +2267,7 @@ def get_duration_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[duration]', pipeline_response) @@ -2322,7 +2322,7 @@ def put_duration_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2367,7 +2367,7 @@ def get_byte_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[bytearray]', pipeline_response) @@ -2423,7 +2423,7 @@ def put_byte_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2467,7 +2467,7 @@ def get_byte_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[bytearray]', pipeline_response) @@ -2515,7 +2515,7 @@ def get_base64_url( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[base64]', pipeline_response) @@ -2531,7 +2531,7 @@ def get_complex_null( self, **kwargs # type: Any ): - # type: (...) -> List["models.Product"] + # type: (...) -> List["_models.Product"] """Get array of complex type null value. :keyword callable cls: A custom type or function that will be passed the direct response @@ -2539,7 +2539,7 @@ def get_complex_null( :rtype: list[~bodyarray.models.Product] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2562,7 +2562,7 @@ def get_complex_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[Product]', pipeline_response) @@ -2578,7 +2578,7 @@ def get_complex_empty( self, **kwargs # type: Any ): - # type: (...) -> List["models.Product"] + # type: (...) -> List["_models.Product"] """Get empty array of complex type []. :keyword callable cls: A custom type or function that will be passed the direct response @@ -2586,7 +2586,7 @@ def get_complex_empty( :rtype: list[~bodyarray.models.Product] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2609,7 +2609,7 @@ def get_complex_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[Product]', pipeline_response) @@ -2625,7 +2625,7 @@ def get_complex_item_null( self, **kwargs # type: Any ): - # type: (...) -> List["models.Product"] + # type: (...) -> List["_models.Product"] """Get array of complex type with null item [{'integer': 1 'string': '2'}, null, {'integer': 5, 'string': '6'}]. @@ -2634,7 +2634,7 @@ def get_complex_item_null( :rtype: list[~bodyarray.models.Product] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2657,7 +2657,7 @@ def get_complex_item_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[Product]', pipeline_response) @@ -2673,7 +2673,7 @@ def get_complex_item_empty( self, **kwargs # type: Any ): - # type: (...) -> List["models.Product"] + # type: (...) -> List["_models.Product"] """Get array of complex type with empty item [{'integer': 1 'string': '2'}, {}, {'integer': 5, 'string': '6'}]. @@ -2682,7 +2682,7 @@ def get_complex_item_empty( :rtype: list[~bodyarray.models.Product] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2705,7 +2705,7 @@ def get_complex_item_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[Product]', pipeline_response) @@ -2721,7 +2721,7 @@ def get_complex_valid( self, **kwargs # type: Any ): - # type: (...) -> List["models.Product"] + # type: (...) -> List["_models.Product"] """Get array of complex type with [{'integer': 1 'string': '2'}, {'integer': 3, 'string': '4'}, {'integer': 5, 'string': '6'}]. @@ -2730,7 +2730,7 @@ def get_complex_valid( :rtype: list[~bodyarray.models.Product] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2753,7 +2753,7 @@ def get_complex_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[Product]', pipeline_response) @@ -2767,7 +2767,7 @@ def get_complex_valid( @distributed_trace def put_complex_valid( self, - array_body, # type: List["models.Product"] + array_body, # type: List["_models.Product"] **kwargs # type: Any ): # type: (...) -> None @@ -2809,7 +2809,7 @@ def put_complex_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2853,7 +2853,7 @@ def get_array_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[[str]]', pipeline_response) @@ -2900,7 +2900,7 @@ def get_array_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[[str]]', pipeline_response) @@ -2947,7 +2947,7 @@ def get_array_item_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[[str]]', pipeline_response) @@ -2994,7 +2994,7 @@ def get_array_item_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[[str]]', pipeline_response) @@ -3041,7 +3041,7 @@ def get_array_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[[str]]', pipeline_response) @@ -3096,7 +3096,7 @@ def put_array_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -3140,7 +3140,7 @@ def get_dictionary_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[{str}]', pipeline_response) @@ -3187,7 +3187,7 @@ def get_dictionary_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[{str}]', pipeline_response) @@ -3235,7 +3235,7 @@ def get_dictionary_item_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[{str}]', pipeline_response) @@ -3283,7 +3283,7 @@ def get_dictionary_item_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[{str}]', pipeline_response) @@ -3331,7 +3331,7 @@ def get_dictionary_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[{str}]', pipeline_response) @@ -3387,7 +3387,7 @@ def put_dictionary_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/aio/operations/_array_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/aio/operations/_array_operations.py index b9a07638450..5035652f7ee 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/aio/operations/_array_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/aio/operations/_array_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ArrayOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -76,7 +76,7 @@ async def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[int]', pipeline_response) @@ -122,7 +122,7 @@ async def get_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[int]', pipeline_response) @@ -168,7 +168,7 @@ async def get_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[int]', pipeline_response) @@ -222,7 +222,7 @@ async def put_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -265,7 +265,7 @@ async def get_boolean_tfft( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[bool]', pipeline_response) @@ -319,7 +319,7 @@ async def put_boolean_tfft( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -362,7 +362,7 @@ async def get_boolean_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[bool]', pipeline_response) @@ -408,7 +408,7 @@ async def get_boolean_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[bool]', pipeline_response) @@ -454,7 +454,7 @@ async def get_integer_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[int]', pipeline_response) @@ -508,7 +508,7 @@ async def put_integer_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -551,7 +551,7 @@ async def get_int_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[int]', pipeline_response) @@ -597,7 +597,7 @@ async def get_int_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[int]', pipeline_response) @@ -643,7 +643,7 @@ async def get_long_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[long]', pipeline_response) @@ -697,7 +697,7 @@ async def put_long_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -740,7 +740,7 @@ async def get_long_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[long]', pipeline_response) @@ -786,7 +786,7 @@ async def get_long_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[long]', pipeline_response) @@ -832,7 +832,7 @@ async def get_float_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[float]', pipeline_response) @@ -886,7 +886,7 @@ async def put_float_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -929,7 +929,7 @@ async def get_float_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[float]', pipeline_response) @@ -975,7 +975,7 @@ async def get_float_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[float]', pipeline_response) @@ -1021,7 +1021,7 @@ async def get_double_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[float]', pipeline_response) @@ -1075,7 +1075,7 @@ async def put_double_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1118,7 +1118,7 @@ async def get_double_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[float]', pipeline_response) @@ -1164,7 +1164,7 @@ async def get_double_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[float]', pipeline_response) @@ -1210,7 +1210,7 @@ async def get_string_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1264,7 +1264,7 @@ async def put_string_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1276,7 +1276,7 @@ async def put_string_valid( async def get_enum_valid( self, **kwargs - ) -> List[Union[str, "models.FooEnum"]]: + ) -> List[Union[str, "_models.FooEnum"]]: """Get enum array value ['foo1', 'foo2', 'foo3']. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1284,7 +1284,7 @@ async def get_enum_valid( :rtype: list[str or ~vanilla.body.array.models.FooEnum] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List[Union[str, "models.FooEnum"]]] + cls = kwargs.pop('cls', None) # type: ClsType[List[Union[str, "_models.FooEnum"]]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1307,7 +1307,7 @@ async def get_enum_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1321,7 +1321,7 @@ async def get_enum_valid( @distributed_trace_async async def put_enum_valid( self, - array_body: List[Union[str, "models.FooEnum"]], + array_body: List[Union[str, "_models.FooEnum"]], **kwargs ) -> None: """Set array value ['foo1', 'foo2', 'foo3']. @@ -1361,7 +1361,7 @@ async def put_enum_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1373,7 +1373,7 @@ async def put_enum_valid( async def get_string_enum_valid( self, **kwargs - ) -> List[Union[str, "models.Enum0"]]: + ) -> List[Union[str, "_models.Enum0"]]: """Get enum array value ['foo1', 'foo2', 'foo3']. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1381,7 +1381,7 @@ async def get_string_enum_valid( :rtype: list[str or ~vanilla.body.array.models.Enum0] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List[Union[str, "models.Enum0"]]] + cls = kwargs.pop('cls', None) # type: ClsType[List[Union[str, "_models.Enum0"]]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1404,7 +1404,7 @@ async def get_string_enum_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1418,7 +1418,7 @@ async def get_string_enum_valid( @distributed_trace_async async def put_string_enum_valid( self, - array_body: List[Union[str, "models.Enum1"]], + array_body: List[Union[str, "_models.Enum1"]], **kwargs ) -> None: """Set array value ['foo1', 'foo2', 'foo3']. @@ -1458,7 +1458,7 @@ async def put_string_enum_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1501,7 +1501,7 @@ async def get_string_with_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1547,7 +1547,7 @@ async def get_string_with_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1594,7 +1594,7 @@ async def get_uuid_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1649,7 +1649,7 @@ async def put_uuid_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1692,7 +1692,7 @@ async def get_uuid_invalid_chars( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1738,7 +1738,7 @@ async def get_date_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[date]', pipeline_response) @@ -1792,7 +1792,7 @@ async def put_date_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1835,7 +1835,7 @@ async def get_date_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[date]', pipeline_response) @@ -1881,7 +1881,7 @@ async def get_date_invalid_chars( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[date]', pipeline_response) @@ -1928,7 +1928,7 @@ async def get_date_time_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[iso-8601]', pipeline_response) @@ -1983,7 +1983,7 @@ async def put_date_time_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2026,7 +2026,7 @@ async def get_date_time_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[iso-8601]', pipeline_response) @@ -2072,7 +2072,7 @@ async def get_date_time_invalid_chars( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[iso-8601]', pipeline_response) @@ -2119,7 +2119,7 @@ async def get_date_time_rfc1123_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[rfc-1123]', pipeline_response) @@ -2174,7 +2174,7 @@ async def put_date_time_rfc1123_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2217,7 +2217,7 @@ async def get_duration_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[duration]', pipeline_response) @@ -2271,7 +2271,7 @@ async def put_duration_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2315,7 +2315,7 @@ async def get_byte_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[bytearray]', pipeline_response) @@ -2370,7 +2370,7 @@ async def put_byte_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2413,7 +2413,7 @@ async def get_byte_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[bytearray]', pipeline_response) @@ -2460,7 +2460,7 @@ async def get_base64_url( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[base64]', pipeline_response) @@ -2475,7 +2475,7 @@ async def get_base64_url( async def get_complex_null( self, **kwargs - ) -> List["models.Product"]: + ) -> List["_models.Product"]: """Get array of complex type null value. :keyword callable cls: A custom type or function that will be passed the direct response @@ -2483,7 +2483,7 @@ async def get_complex_null( :rtype: list[~vanilla.body.array.models.Product] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2506,7 +2506,7 @@ async def get_complex_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[Product]', pipeline_response) @@ -2521,7 +2521,7 @@ async def get_complex_null( async def get_complex_empty( self, **kwargs - ) -> List["models.Product"]: + ) -> List["_models.Product"]: """Get empty array of complex type []. :keyword callable cls: A custom type or function that will be passed the direct response @@ -2529,7 +2529,7 @@ async def get_complex_empty( :rtype: list[~vanilla.body.array.models.Product] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2552,7 +2552,7 @@ async def get_complex_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[Product]', pipeline_response) @@ -2567,7 +2567,7 @@ async def get_complex_empty( async def get_complex_item_null( self, **kwargs - ) -> List["models.Product"]: + ) -> List["_models.Product"]: """Get array of complex type with null item [{'integer': 1 'string': '2'}, null, {'integer': 5, 'string': '6'}]. @@ -2576,7 +2576,7 @@ async def get_complex_item_null( :rtype: list[~vanilla.body.array.models.Product] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2599,7 +2599,7 @@ async def get_complex_item_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[Product]', pipeline_response) @@ -2614,7 +2614,7 @@ async def get_complex_item_null( async def get_complex_item_empty( self, **kwargs - ) -> List["models.Product"]: + ) -> List["_models.Product"]: """Get array of complex type with empty item [{'integer': 1 'string': '2'}, {}, {'integer': 5, 'string': '6'}]. @@ -2623,7 +2623,7 @@ async def get_complex_item_empty( :rtype: list[~vanilla.body.array.models.Product] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2646,7 +2646,7 @@ async def get_complex_item_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[Product]', pipeline_response) @@ -2661,7 +2661,7 @@ async def get_complex_item_empty( async def get_complex_valid( self, **kwargs - ) -> List["models.Product"]: + ) -> List["_models.Product"]: """Get array of complex type with [{'integer': 1 'string': '2'}, {'integer': 3, 'string': '4'}, {'integer': 5, 'string': '6'}]. @@ -2670,7 +2670,7 @@ async def get_complex_valid( :rtype: list[~vanilla.body.array.models.Product] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2693,7 +2693,7 @@ async def get_complex_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[Product]', pipeline_response) @@ -2707,7 +2707,7 @@ async def get_complex_valid( @distributed_trace_async async def put_complex_valid( self, - array_body: List["models.Product"], + array_body: List["_models.Product"], **kwargs ) -> None: """Put an array of complex type with values [{'integer': 1 'string': '2'}, {'integer': 3, @@ -2748,7 +2748,7 @@ async def put_complex_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2791,7 +2791,7 @@ async def get_array_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[[str]]', pipeline_response) @@ -2837,7 +2837,7 @@ async def get_array_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[[str]]', pipeline_response) @@ -2883,7 +2883,7 @@ async def get_array_item_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[[str]]', pipeline_response) @@ -2929,7 +2929,7 @@ async def get_array_item_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[[str]]', pipeline_response) @@ -2975,7 +2975,7 @@ async def get_array_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[[str]]', pipeline_response) @@ -3029,7 +3029,7 @@ async def put_array_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -3072,7 +3072,7 @@ async def get_dictionary_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[{str}]', pipeline_response) @@ -3118,7 +3118,7 @@ async def get_dictionary_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[{str}]', pipeline_response) @@ -3165,7 +3165,7 @@ async def get_dictionary_item_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[{str}]', pipeline_response) @@ -3212,7 +3212,7 @@ async def get_dictionary_item_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[{str}]', pipeline_response) @@ -3259,7 +3259,7 @@ async def get_dictionary_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[{str}]', pipeline_response) @@ -3314,7 +3314,7 @@ async def put_dictionary_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/operations/_array_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/operations/_array_operations.py index 0c60eb1e521..917df4ce27f 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/operations/_array_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/operations/_array_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ArrayOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -81,7 +81,7 @@ def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[int]', pipeline_response) @@ -128,7 +128,7 @@ def get_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[int]', pipeline_response) @@ -175,7 +175,7 @@ def get_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[int]', pipeline_response) @@ -230,7 +230,7 @@ def put_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -274,7 +274,7 @@ def get_boolean_tfft( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[bool]', pipeline_response) @@ -329,7 +329,7 @@ def put_boolean_tfft( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -373,7 +373,7 @@ def get_boolean_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[bool]', pipeline_response) @@ -420,7 +420,7 @@ def get_boolean_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[bool]', pipeline_response) @@ -467,7 +467,7 @@ def get_integer_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[int]', pipeline_response) @@ -522,7 +522,7 @@ def put_integer_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -566,7 +566,7 @@ def get_int_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[int]', pipeline_response) @@ -613,7 +613,7 @@ def get_int_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[int]', pipeline_response) @@ -660,7 +660,7 @@ def get_long_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[long]', pipeline_response) @@ -715,7 +715,7 @@ def put_long_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -759,7 +759,7 @@ def get_long_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[long]', pipeline_response) @@ -806,7 +806,7 @@ def get_long_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[long]', pipeline_response) @@ -853,7 +853,7 @@ def get_float_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[float]', pipeline_response) @@ -908,7 +908,7 @@ def put_float_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -952,7 +952,7 @@ def get_float_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[float]', pipeline_response) @@ -999,7 +999,7 @@ def get_float_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[float]', pipeline_response) @@ -1046,7 +1046,7 @@ def get_double_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[float]', pipeline_response) @@ -1101,7 +1101,7 @@ def put_double_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1145,7 +1145,7 @@ def get_double_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[float]', pipeline_response) @@ -1192,7 +1192,7 @@ def get_double_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[float]', pipeline_response) @@ -1239,7 +1239,7 @@ def get_string_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1294,7 +1294,7 @@ def put_string_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1307,7 +1307,7 @@ def get_enum_valid( self, **kwargs # type: Any ): - # type: (...) -> List[Union[str, "models.FooEnum"]] + # type: (...) -> List[Union[str, "_models.FooEnum"]] """Get enum array value ['foo1', 'foo2', 'foo3']. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1315,7 +1315,7 @@ def get_enum_valid( :rtype: list[str or ~vanilla.body.array.models.FooEnum] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List[Union[str, "models.FooEnum"]]] + cls = kwargs.pop('cls', None) # type: ClsType[List[Union[str, "_models.FooEnum"]]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1338,7 +1338,7 @@ def get_enum_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1352,7 +1352,7 @@ def get_enum_valid( @distributed_trace def put_enum_valid( self, - array_body, # type: List[Union[str, "models.FooEnum"]] + array_body, # type: List[Union[str, "_models.FooEnum"]] **kwargs # type: Any ): # type: (...) -> None @@ -1393,7 +1393,7 @@ def put_enum_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1406,7 +1406,7 @@ def get_string_enum_valid( self, **kwargs # type: Any ): - # type: (...) -> List[Union[str, "models.Enum0"]] + # type: (...) -> List[Union[str, "_models.Enum0"]] """Get enum array value ['foo1', 'foo2', 'foo3']. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1414,7 +1414,7 @@ def get_string_enum_valid( :rtype: list[str or ~vanilla.body.array.models.Enum0] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List[Union[str, "models.Enum0"]]] + cls = kwargs.pop('cls', None) # type: ClsType[List[Union[str, "_models.Enum0"]]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1437,7 +1437,7 @@ def get_string_enum_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1451,7 +1451,7 @@ def get_string_enum_valid( @distributed_trace def put_string_enum_valid( self, - array_body, # type: List[Union[str, "models.Enum1"]] + array_body, # type: List[Union[str, "_models.Enum1"]] **kwargs # type: Any ): # type: (...) -> None @@ -1492,7 +1492,7 @@ def put_string_enum_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1536,7 +1536,7 @@ def get_string_with_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1583,7 +1583,7 @@ def get_string_with_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1631,7 +1631,7 @@ def get_uuid_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1687,7 +1687,7 @@ def put_uuid_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1731,7 +1731,7 @@ def get_uuid_invalid_chars( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[str]', pipeline_response) @@ -1778,7 +1778,7 @@ def get_date_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[date]', pipeline_response) @@ -1833,7 +1833,7 @@ def put_date_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1877,7 +1877,7 @@ def get_date_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[date]', pipeline_response) @@ -1924,7 +1924,7 @@ def get_date_invalid_chars( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[date]', pipeline_response) @@ -1972,7 +1972,7 @@ def get_date_time_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[iso-8601]', pipeline_response) @@ -2028,7 +2028,7 @@ def put_date_time_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2072,7 +2072,7 @@ def get_date_time_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[iso-8601]', pipeline_response) @@ -2119,7 +2119,7 @@ def get_date_time_invalid_chars( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[iso-8601]', pipeline_response) @@ -2167,7 +2167,7 @@ def get_date_time_rfc1123_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[rfc-1123]', pipeline_response) @@ -2223,7 +2223,7 @@ def put_date_time_rfc1123_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2267,7 +2267,7 @@ def get_duration_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[duration]', pipeline_response) @@ -2322,7 +2322,7 @@ def put_duration_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2367,7 +2367,7 @@ def get_byte_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[bytearray]', pipeline_response) @@ -2423,7 +2423,7 @@ def put_byte_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2467,7 +2467,7 @@ def get_byte_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[bytearray]', pipeline_response) @@ -2515,7 +2515,7 @@ def get_base64_url( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[base64]', pipeline_response) @@ -2531,7 +2531,7 @@ def get_complex_null( self, **kwargs # type: Any ): - # type: (...) -> List["models.Product"] + # type: (...) -> List["_models.Product"] """Get array of complex type null value. :keyword callable cls: A custom type or function that will be passed the direct response @@ -2539,7 +2539,7 @@ def get_complex_null( :rtype: list[~vanilla.body.array.models.Product] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2562,7 +2562,7 @@ def get_complex_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[Product]', pipeline_response) @@ -2578,7 +2578,7 @@ def get_complex_empty( self, **kwargs # type: Any ): - # type: (...) -> List["models.Product"] + # type: (...) -> List["_models.Product"] """Get empty array of complex type []. :keyword callable cls: A custom type or function that will be passed the direct response @@ -2586,7 +2586,7 @@ def get_complex_empty( :rtype: list[~vanilla.body.array.models.Product] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2609,7 +2609,7 @@ def get_complex_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[Product]', pipeline_response) @@ -2625,7 +2625,7 @@ def get_complex_item_null( self, **kwargs # type: Any ): - # type: (...) -> List["models.Product"] + # type: (...) -> List["_models.Product"] """Get array of complex type with null item [{'integer': 1 'string': '2'}, null, {'integer': 5, 'string': '6'}]. @@ -2634,7 +2634,7 @@ def get_complex_item_null( :rtype: list[~vanilla.body.array.models.Product] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2657,7 +2657,7 @@ def get_complex_item_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[Product]', pipeline_response) @@ -2673,7 +2673,7 @@ def get_complex_item_empty( self, **kwargs # type: Any ): - # type: (...) -> List["models.Product"] + # type: (...) -> List["_models.Product"] """Get array of complex type with empty item [{'integer': 1 'string': '2'}, {}, {'integer': 5, 'string': '6'}]. @@ -2682,7 +2682,7 @@ def get_complex_item_empty( :rtype: list[~vanilla.body.array.models.Product] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2705,7 +2705,7 @@ def get_complex_item_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[Product]', pipeline_response) @@ -2721,7 +2721,7 @@ def get_complex_valid( self, **kwargs # type: Any ): - # type: (...) -> List["models.Product"] + # type: (...) -> List["_models.Product"] """Get array of complex type with [{'integer': 1 'string': '2'}, {'integer': 3, 'string': '4'}, {'integer': 5, 'string': '6'}]. @@ -2730,7 +2730,7 @@ def get_complex_valid( :rtype: list[~vanilla.body.array.models.Product] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Product"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2753,7 +2753,7 @@ def get_complex_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[Product]', pipeline_response) @@ -2767,7 +2767,7 @@ def get_complex_valid( @distributed_trace def put_complex_valid( self, - array_body, # type: List["models.Product"] + array_body, # type: List["_models.Product"] **kwargs # type: Any ): # type: (...) -> None @@ -2809,7 +2809,7 @@ def put_complex_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2853,7 +2853,7 @@ def get_array_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[[str]]', pipeline_response) @@ -2900,7 +2900,7 @@ def get_array_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[[str]]', pipeline_response) @@ -2947,7 +2947,7 @@ def get_array_item_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[[str]]', pipeline_response) @@ -2994,7 +2994,7 @@ def get_array_item_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[[str]]', pipeline_response) @@ -3041,7 +3041,7 @@ def get_array_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[[str]]', pipeline_response) @@ -3096,7 +3096,7 @@ def put_array_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -3140,7 +3140,7 @@ def get_dictionary_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[{str}]', pipeline_response) @@ -3187,7 +3187,7 @@ def get_dictionary_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[{str}]', pipeline_response) @@ -3235,7 +3235,7 @@ def get_dictionary_item_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[{str}]', pipeline_response) @@ -3283,7 +3283,7 @@ def get_dictionary_item_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[{str}]', pipeline_response) @@ -3331,7 +3331,7 @@ def get_dictionary_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[{str}]', pipeline_response) @@ -3387,7 +3387,7 @@ def put_dictionary_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/BodyBoolean/bodyboolean/aio/operations/_bool_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyBoolean/bodyboolean/aio/operations/_bool_operations.py index e8787e26edb..46db69f547e 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyBoolean/bodyboolean/aio/operations/_bool_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyBoolean/bodyboolean/aio/operations/_bool_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class BoolOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -75,7 +75,7 @@ async def get_true( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bool', pipeline_response) @@ -127,7 +127,7 @@ async def put_true( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -170,7 +170,7 @@ async def get_false( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bool', pipeline_response) @@ -222,7 +222,7 @@ async def put_false( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -265,7 +265,7 @@ async def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bool', pipeline_response) @@ -311,7 +311,7 @@ async def get_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bool', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyBoolean/bodyboolean/operations/_bool_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyBoolean/bodyboolean/operations/_bool_operations.py index 841519490b1..5ca160d33bb 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyBoolean/bodyboolean/operations/_bool_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyBoolean/bodyboolean/operations/_bool_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class BoolOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -80,7 +80,7 @@ def get_true( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bool', pipeline_response) @@ -133,7 +133,7 @@ def put_true( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -177,7 +177,7 @@ def get_false( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bool', pipeline_response) @@ -230,7 +230,7 @@ def put_false( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -274,7 +274,7 @@ def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bool', pipeline_response) @@ -321,7 +321,7 @@ def get_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bool', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyByte/bodybyte/aio/operations/_byte_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyByte/bodybyte/aio/operations/_byte_operations.py index d408c3b9043..c471dd829b5 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyByte/bodybyte/aio/operations/_byte_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyByte/bodybyte/aio/operations/_byte_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ByteOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -75,7 +75,7 @@ async def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bytearray', pipeline_response) @@ -121,7 +121,7 @@ async def get_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bytearray', pipeline_response) @@ -167,7 +167,7 @@ async def get_non_ascii( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bytearray', pipeline_response) @@ -221,7 +221,7 @@ async def put_non_ascii( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -264,7 +264,7 @@ async def get_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bytearray', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyByte/bodybyte/operations/_byte_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyByte/bodybyte/operations/_byte_operations.py index 5a308a3f267..8ce4a02558d 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyByte/bodybyte/operations/_byte_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyByte/bodybyte/operations/_byte_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ByteOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -80,7 +80,7 @@ def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bytearray', pipeline_response) @@ -127,7 +127,7 @@ def get_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bytearray', pipeline_response) @@ -174,7 +174,7 @@ def get_non_ascii( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bytearray', pipeline_response) @@ -229,7 +229,7 @@ def put_non_ascii( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -273,7 +273,7 @@ def get_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bytearray', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyByteWithPackageName/bodybytewithpackagename/aio/operations/_byte_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyByteWithPackageName/bodybytewithpackagename/aio/operations/_byte_operations.py index 3e0eb08be2f..f706eb22cad 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyByteWithPackageName/bodybytewithpackagename/aio/operations/_byte_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyByteWithPackageName/bodybytewithpackagename/aio/operations/_byte_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ByteOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -75,7 +75,7 @@ async def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bytearray', pipeline_response) @@ -121,7 +121,7 @@ async def get_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bytearray', pipeline_response) @@ -167,7 +167,7 @@ async def get_non_ascii( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bytearray', pipeline_response) @@ -221,7 +221,7 @@ async def put_non_ascii( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -264,7 +264,7 @@ async def get_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bytearray', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyByteWithPackageName/bodybytewithpackagename/operations/_byte_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyByteWithPackageName/bodybytewithpackagename/operations/_byte_operations.py index bc014593a31..30fe9e38a52 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyByteWithPackageName/bodybytewithpackagename/operations/_byte_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyByteWithPackageName/bodybytewithpackagename/operations/_byte_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ByteOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -80,7 +80,7 @@ def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bytearray', pipeline_response) @@ -127,7 +127,7 @@ def get_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bytearray', pipeline_response) @@ -174,7 +174,7 @@ def get_non_ascii( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bytearray', pipeline_response) @@ -229,7 +229,7 @@ def put_non_ascii( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -273,7 +273,7 @@ def get_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bytearray', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_array_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_array_operations.py index 2b3b888fe9d..7b6dae7ad04 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_array_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_array_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ArrayOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def get_valid( self, **kwargs - ) -> "models.ArrayWrapper": + ) -> "_models.ArrayWrapper": """Get complex types with array property. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ async def get_valid( :rtype: ~bodycomplex.models.ArrayWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArrayWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArrayWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -75,7 +75,7 @@ async def get_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('ArrayWrapper', pipeline_response) @@ -107,7 +107,7 @@ async def put_valid( } error_map.update(kwargs.pop('error_map', {})) - _complex_body = models.ArrayWrapper(array=array) + _complex_body = _models.ArrayWrapper(array=array) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -131,7 +131,7 @@ async def put_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -143,7 +143,7 @@ async def put_valid( async def get_empty( self, **kwargs - ) -> "models.ArrayWrapper": + ) -> "_models.ArrayWrapper": """Get complex types with array property which is empty. :keyword callable cls: A custom type or function that will be passed the direct response @@ -151,7 +151,7 @@ async def get_empty( :rtype: ~bodycomplex.models.ArrayWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArrayWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArrayWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -174,7 +174,7 @@ async def get_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('ArrayWrapper', pipeline_response) @@ -206,7 +206,7 @@ async def put_empty( } error_map.update(kwargs.pop('error_map', {})) - _complex_body = models.ArrayWrapper(array=array) + _complex_body = _models.ArrayWrapper(array=array) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -230,7 +230,7 @@ async def put_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -242,7 +242,7 @@ async def put_empty( async def get_not_provided( self, **kwargs - ) -> "models.ArrayWrapper": + ) -> "_models.ArrayWrapper": """Get complex types with array property while server doesn't provide a response payload. :keyword callable cls: A custom type or function that will be passed the direct response @@ -250,7 +250,7 @@ async def get_not_provided( :rtype: ~bodycomplex.models.ArrayWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArrayWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArrayWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -273,7 +273,7 @@ async def get_not_provided( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('ArrayWrapper', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_basic_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_basic_operations.py index 2b5b728b6e0..0d5ddd0b1c5 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_basic_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_basic_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class BasicOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def get_valid( self, **kwargs - ) -> "models.Basic": + ) -> "_models.Basic": """Get complex type {id: 2, name: 'abc', color: 'YELLOW'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ async def get_valid( :rtype: ~bodycomplex.models.Basic :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Basic"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Basic"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -75,7 +75,7 @@ async def get_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Basic', pipeline_response) @@ -89,7 +89,7 @@ async def get_valid( @distributed_trace_async async def put_valid( self, - complex_body: "models.Basic", + complex_body: "_models.Basic", **kwargs ) -> None: """Please put {id: 2, name: 'abc', color: 'Magenta'}. @@ -131,7 +131,7 @@ async def put_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -143,7 +143,7 @@ async def put_valid( async def get_invalid( self, **kwargs - ) -> "models.Basic": + ) -> "_models.Basic": """Get a basic complex type that is invalid for the local strong type. :keyword callable cls: A custom type or function that will be passed the direct response @@ -151,7 +151,7 @@ async def get_invalid( :rtype: ~bodycomplex.models.Basic :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Basic"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Basic"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -174,7 +174,7 @@ async def get_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Basic', pipeline_response) @@ -189,7 +189,7 @@ async def get_invalid( async def get_empty( self, **kwargs - ) -> "models.Basic": + ) -> "_models.Basic": """Get a basic complex type that is empty. :keyword callable cls: A custom type or function that will be passed the direct response @@ -197,7 +197,7 @@ async def get_empty( :rtype: ~bodycomplex.models.Basic :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Basic"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Basic"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,7 +220,7 @@ async def get_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Basic', pipeline_response) @@ -235,7 +235,7 @@ async def get_empty( async def get_null( self, **kwargs - ) -> "models.Basic": + ) -> "_models.Basic": """Get a basic complex type whose properties are null. :keyword callable cls: A custom type or function that will be passed the direct response @@ -243,7 +243,7 @@ async def get_null( :rtype: ~bodycomplex.models.Basic :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Basic"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Basic"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -266,7 +266,7 @@ async def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Basic', pipeline_response) @@ -281,7 +281,7 @@ async def get_null( async def get_not_provided( self, **kwargs - ) -> "models.Basic": + ) -> "_models.Basic": """Get a basic complex type while the server doesn't provide a response payload. :keyword callable cls: A custom type or function that will be passed the direct response @@ -289,7 +289,7 @@ async def get_not_provided( :rtype: ~bodycomplex.models.Basic :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Basic"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Basic"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -312,7 +312,7 @@ async def get_not_provided( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Basic', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_dictionary_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_dictionary_operations.py index c3391849dbd..b3fb964cf0a 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_dictionary_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_dictionary_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class DictionaryOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def get_valid( self, **kwargs - ) -> "models.DictionaryWrapper": + ) -> "_models.DictionaryWrapper": """Get complex types with dictionary property. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ async def get_valid( :rtype: ~bodycomplex.models.DictionaryWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DictionaryWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DictionaryWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -75,7 +75,7 @@ async def get_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('DictionaryWrapper', pipeline_response) @@ -107,7 +107,7 @@ async def put_valid( } error_map.update(kwargs.pop('error_map', {})) - _complex_body = models.DictionaryWrapper(default_program=default_program) + _complex_body = _models.DictionaryWrapper(default_program=default_program) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -131,7 +131,7 @@ async def put_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -143,7 +143,7 @@ async def put_valid( async def get_empty( self, **kwargs - ) -> "models.DictionaryWrapper": + ) -> "_models.DictionaryWrapper": """Get complex types with dictionary property which is empty. :keyword callable cls: A custom type or function that will be passed the direct response @@ -151,7 +151,7 @@ async def get_empty( :rtype: ~bodycomplex.models.DictionaryWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DictionaryWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DictionaryWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -174,7 +174,7 @@ async def get_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('DictionaryWrapper', pipeline_response) @@ -206,7 +206,7 @@ async def put_empty( } error_map.update(kwargs.pop('error_map', {})) - _complex_body = models.DictionaryWrapper(default_program=default_program) + _complex_body = _models.DictionaryWrapper(default_program=default_program) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -230,7 +230,7 @@ async def put_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -242,7 +242,7 @@ async def put_empty( async def get_null( self, **kwargs - ) -> "models.DictionaryWrapper": + ) -> "_models.DictionaryWrapper": """Get complex types with dictionary property which is null. :keyword callable cls: A custom type or function that will be passed the direct response @@ -250,7 +250,7 @@ async def get_null( :rtype: ~bodycomplex.models.DictionaryWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DictionaryWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DictionaryWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -273,7 +273,7 @@ async def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('DictionaryWrapper', pipeline_response) @@ -288,7 +288,7 @@ async def get_null( async def get_not_provided( self, **kwargs - ) -> "models.DictionaryWrapper": + ) -> "_models.DictionaryWrapper": """Get complex types with dictionary property while server doesn't provide a response payload. :keyword callable cls: A custom type or function that will be passed the direct response @@ -296,7 +296,7 @@ async def get_not_provided( :rtype: ~bodycomplex.models.DictionaryWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DictionaryWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DictionaryWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -319,7 +319,7 @@ async def get_not_provided( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('DictionaryWrapper', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_flattencomplex_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_flattencomplex_operations.py index e0736a6057f..dce60e6dd06 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_flattencomplex_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_flattencomplex_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class FlattencomplexOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def get_valid( self, **kwargs - ) -> "models.MyBaseType": + ) -> "_models.MyBaseType": """get_valid. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ async def get_valid( :rtype: ~bodycomplex.models.MyBaseType :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MyBaseType"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyBaseType"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_inheritance_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_inheritance_operations.py index d72dd233c24..a87b9d7d1eb 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_inheritance_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_inheritance_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class InheritanceOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def get_valid( self, **kwargs - ) -> "models.Siamese": + ) -> "_models.Siamese": """Get complex types that extend others. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ async def get_valid( :rtype: ~bodycomplex.models.Siamese :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Siamese"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Siamese"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -75,7 +75,7 @@ async def get_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Siamese', pipeline_response) @@ -89,7 +89,7 @@ async def get_valid( @distributed_trace_async async def put_valid( self, - complex_body: "models.Siamese", + complex_body: "_models.Siamese", **kwargs ) -> None: """Put complex types that extend others. @@ -131,7 +131,7 @@ async def put_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_polymorphicrecursive_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_polymorphicrecursive_operations.py index a32f1fc4e12..3620fbc74ab 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_polymorphicrecursive_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_polymorphicrecursive_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class PolymorphicrecursiveOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def get_valid( self, **kwargs - ) -> "models.Fish": + ) -> "_models.Fish": """Get complex types that are polymorphic and have recursive references. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ async def get_valid( :rtype: ~bodycomplex.models.Fish :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Fish"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Fish"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -75,7 +75,7 @@ async def get_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Fish', pipeline_response) @@ -89,7 +89,7 @@ async def get_valid( @distributed_trace_async async def put_valid( self, - complex_body: "models.Fish", + complex_body: "_models.Fish", **kwargs ) -> None: """Put complex types that are polymorphic and have recursive references. @@ -181,7 +181,7 @@ async def put_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_polymorphism_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_polymorphism_operations.py index efdbf821f75..72c625d7504 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_polymorphism_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_polymorphism_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class PolymorphismOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def get_valid( self, **kwargs - ) -> "models.Fish": + ) -> "_models.Fish": """Get complex types that are polymorphic. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ async def get_valid( :rtype: ~bodycomplex.models.Fish :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Fish"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Fish"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -75,7 +75,7 @@ async def get_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Fish', pipeline_response) @@ -89,7 +89,7 @@ async def get_valid( @distributed_trace_async async def put_valid( self, - complex_body: "models.Fish", + complex_body: "_models.Fish", **kwargs ) -> None: """Put complex types that are polymorphic. @@ -161,7 +161,7 @@ async def put_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -173,7 +173,7 @@ async def put_valid( async def get_dot_syntax( self, **kwargs - ) -> "models.DotFish": + ) -> "_models.DotFish": """Get complex types that are polymorphic, JSON key contains a dot. :keyword callable cls: A custom type or function that will be passed the direct response @@ -181,7 +181,7 @@ async def get_dot_syntax( :rtype: ~bodycomplex.models.DotFish :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DotFish"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DotFish"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -204,7 +204,7 @@ async def get_dot_syntax( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('DotFish', pipeline_response) @@ -219,7 +219,7 @@ async def get_dot_syntax( async def get_composed_with_discriminator( self, **kwargs - ) -> "models.DotFishMarket": + ) -> "_models.DotFishMarket": """Get complex object composing a polymorphic scalar property and array property with polymorphic element type, with discriminator specified. Deserialization must NOT fail and use the discriminator type specified on the wire. @@ -229,7 +229,7 @@ async def get_composed_with_discriminator( :rtype: ~bodycomplex.models.DotFishMarket :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DotFishMarket"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DotFishMarket"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -252,7 +252,7 @@ async def get_composed_with_discriminator( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('DotFishMarket', pipeline_response) @@ -267,7 +267,7 @@ async def get_composed_with_discriminator( async def get_composed_without_discriminator( self, **kwargs - ) -> "models.DotFishMarket": + ) -> "_models.DotFishMarket": """Get complex object composing a polymorphic scalar property and array property with polymorphic element type, without discriminator specified on wire. Deserialization must NOT fail and use the explicit type of the property. @@ -277,7 +277,7 @@ async def get_composed_without_discriminator( :rtype: ~bodycomplex.models.DotFishMarket :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DotFishMarket"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DotFishMarket"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -300,7 +300,7 @@ async def get_composed_without_discriminator( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('DotFishMarket', pipeline_response) @@ -315,7 +315,7 @@ async def get_composed_without_discriminator( async def get_complicated( self, **kwargs - ) -> "models.Salmon": + ) -> "_models.Salmon": """Get complex types that are polymorphic, but not at the root of the hierarchy; also have additional properties. @@ -324,7 +324,7 @@ async def get_complicated( :rtype: ~bodycomplex.models.Salmon :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Salmon"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Salmon"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -347,7 +347,7 @@ async def get_complicated( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Salmon', pipeline_response) @@ -361,7 +361,7 @@ async def get_complicated( @distributed_trace_async async def put_complicated( self, - complex_body: "models.Salmon", + complex_body: "_models.Salmon", **kwargs ) -> None: """Put complex types that are polymorphic, but not at the root of the hierarchy; also have @@ -402,7 +402,7 @@ async def put_complicated( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -413,9 +413,9 @@ async def put_complicated( @distributed_trace_async async def put_missing_discriminator( self, - complex_body: "models.Salmon", + complex_body: "_models.Salmon", **kwargs - ) -> "models.Salmon": + ) -> "_models.Salmon": """Put complex types that are polymorphic, omitting the discriminator. :param complex_body: @@ -425,7 +425,7 @@ async def put_missing_discriminator( :rtype: ~bodycomplex.models.Salmon :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Salmon"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Salmon"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -453,7 +453,7 @@ async def put_missing_discriminator( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Salmon', pipeline_response) @@ -467,7 +467,7 @@ async def put_missing_discriminator( @distributed_trace_async async def put_valid_missing_required( self, - complex_body: "models.Fish", + complex_body: "_models.Fish", **kwargs ) -> None: """Put complex types that are polymorphic, attempting to omit required 'birthday' field - the @@ -534,7 +534,7 @@ async def put_valid_missing_required( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_primitive_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_primitive_operations.py index 408ee1feeb6..ea8908f0f83 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_primitive_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_primitive_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class PrimitiveOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def get_int( self, **kwargs - ) -> "models.IntWrapper": + ) -> "_models.IntWrapper": """Get complex types with integer properties. :keyword callable cls: A custom type or function that will be passed the direct response @@ -53,7 +53,7 @@ async def get_int( :rtype: ~bodycomplex.models.IntWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IntWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IntWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -76,7 +76,7 @@ async def get_int( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('IntWrapper', pipeline_response) @@ -90,7 +90,7 @@ async def get_int( @distributed_trace_async async def put_int( self, - complex_body: "models.IntWrapper", + complex_body: "_models.IntWrapper", **kwargs ) -> None: """Put complex types with integer properties. @@ -130,7 +130,7 @@ async def put_int( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -142,7 +142,7 @@ async def put_int( async def get_long( self, **kwargs - ) -> "models.LongWrapper": + ) -> "_models.LongWrapper": """Get complex types with long properties. :keyword callable cls: A custom type or function that will be passed the direct response @@ -150,7 +150,7 @@ async def get_long( :rtype: ~bodycomplex.models.LongWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LongWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LongWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -173,7 +173,7 @@ async def get_long( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('LongWrapper', pipeline_response) @@ -187,7 +187,7 @@ async def get_long( @distributed_trace_async async def put_long( self, - complex_body: "models.LongWrapper", + complex_body: "_models.LongWrapper", **kwargs ) -> None: """Put complex types with long properties. @@ -227,7 +227,7 @@ async def put_long( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -239,7 +239,7 @@ async def put_long( async def get_float( self, **kwargs - ) -> "models.FloatWrapper": + ) -> "_models.FloatWrapper": """Get complex types with float properties. :keyword callable cls: A custom type or function that will be passed the direct response @@ -247,7 +247,7 @@ async def get_float( :rtype: ~bodycomplex.models.FloatWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FloatWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FloatWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,7 +270,7 @@ async def get_float( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('FloatWrapper', pipeline_response) @@ -284,7 +284,7 @@ async def get_float( @distributed_trace_async async def put_float( self, - complex_body: "models.FloatWrapper", + complex_body: "_models.FloatWrapper", **kwargs ) -> None: """Put complex types with float properties. @@ -324,7 +324,7 @@ async def put_float( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -336,7 +336,7 @@ async def put_float( async def get_double( self, **kwargs - ) -> "models.DoubleWrapper": + ) -> "_models.DoubleWrapper": """Get complex types with double properties. :keyword callable cls: A custom type or function that will be passed the direct response @@ -344,7 +344,7 @@ async def get_double( :rtype: ~bodycomplex.models.DoubleWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DoubleWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DoubleWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -367,7 +367,7 @@ async def get_double( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('DoubleWrapper', pipeline_response) @@ -381,7 +381,7 @@ async def get_double( @distributed_trace_async async def put_double( self, - complex_body: "models.DoubleWrapper", + complex_body: "_models.DoubleWrapper", **kwargs ) -> None: """Put complex types with double properties. @@ -422,7 +422,7 @@ async def put_double( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -434,7 +434,7 @@ async def put_double( async def get_bool( self, **kwargs - ) -> "models.BooleanWrapper": + ) -> "_models.BooleanWrapper": """Get complex types with bool properties. :keyword callable cls: A custom type or function that will be passed the direct response @@ -442,7 +442,7 @@ async def get_bool( :rtype: ~bodycomplex.models.BooleanWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BooleanWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BooleanWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -465,7 +465,7 @@ async def get_bool( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('BooleanWrapper', pipeline_response) @@ -479,7 +479,7 @@ async def get_bool( @distributed_trace_async async def put_bool( self, - complex_body: "models.BooleanWrapper", + complex_body: "_models.BooleanWrapper", **kwargs ) -> None: """Put complex types with bool properties. @@ -519,7 +519,7 @@ async def put_bool( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -531,7 +531,7 @@ async def put_bool( async def get_string( self, **kwargs - ) -> "models.StringWrapper": + ) -> "_models.StringWrapper": """Get complex types with string properties. :keyword callable cls: A custom type or function that will be passed the direct response @@ -539,7 +539,7 @@ async def get_string( :rtype: ~bodycomplex.models.StringWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StringWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -562,7 +562,7 @@ async def get_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('StringWrapper', pipeline_response) @@ -576,7 +576,7 @@ async def get_string( @distributed_trace_async async def put_string( self, - complex_body: "models.StringWrapper", + complex_body: "_models.StringWrapper", **kwargs ) -> None: """Put complex types with string properties. @@ -616,7 +616,7 @@ async def put_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -628,7 +628,7 @@ async def put_string( async def get_date( self, **kwargs - ) -> "models.DateWrapper": + ) -> "_models.DateWrapper": """Get complex types with date properties. :keyword callable cls: A custom type or function that will be passed the direct response @@ -636,7 +636,7 @@ async def get_date( :rtype: ~bodycomplex.models.DateWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DateWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DateWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -659,7 +659,7 @@ async def get_date( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('DateWrapper', pipeline_response) @@ -673,7 +673,7 @@ async def get_date( @distributed_trace_async async def put_date( self, - complex_body: "models.DateWrapper", + complex_body: "_models.DateWrapper", **kwargs ) -> None: """Put complex types with date properties. @@ -713,7 +713,7 @@ async def put_date( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -725,7 +725,7 @@ async def put_date( async def get_date_time( self, **kwargs - ) -> "models.DatetimeWrapper": + ) -> "_models.DatetimeWrapper": """Get complex types with datetime properties. :keyword callable cls: A custom type or function that will be passed the direct response @@ -733,7 +733,7 @@ async def get_date_time( :rtype: ~bodycomplex.models.DatetimeWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DatetimeWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatetimeWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -756,7 +756,7 @@ async def get_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('DatetimeWrapper', pipeline_response) @@ -770,7 +770,7 @@ async def get_date_time( @distributed_trace_async async def put_date_time( self, - complex_body: "models.DatetimeWrapper", + complex_body: "_models.DatetimeWrapper", **kwargs ) -> None: """Put complex types with datetime properties. @@ -810,7 +810,7 @@ async def put_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -822,7 +822,7 @@ async def put_date_time( async def get_date_time_rfc1123( self, **kwargs - ) -> "models.Datetimerfc1123Wrapper": + ) -> "_models.Datetimerfc1123Wrapper": """Get complex types with datetimeRfc1123 properties. :keyword callable cls: A custom type or function that will be passed the direct response @@ -830,7 +830,7 @@ async def get_date_time_rfc1123( :rtype: ~bodycomplex.models.Datetimerfc1123Wrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Datetimerfc1123Wrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Datetimerfc1123Wrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -853,7 +853,7 @@ async def get_date_time_rfc1123( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Datetimerfc1123Wrapper', pipeline_response) @@ -867,7 +867,7 @@ async def get_date_time_rfc1123( @distributed_trace_async async def put_date_time_rfc1123( self, - complex_body: "models.Datetimerfc1123Wrapper", + complex_body: "_models.Datetimerfc1123Wrapper", **kwargs ) -> None: """Put complex types with datetimeRfc1123 properties. @@ -908,7 +908,7 @@ async def put_date_time_rfc1123( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -920,7 +920,7 @@ async def put_date_time_rfc1123( async def get_duration( self, **kwargs - ) -> "models.DurationWrapper": + ) -> "_models.DurationWrapper": """Get complex types with duration properties. :keyword callable cls: A custom type or function that will be passed the direct response @@ -928,7 +928,7 @@ async def get_duration( :rtype: ~bodycomplex.models.DurationWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DurationWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DurationWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -951,7 +951,7 @@ async def get_duration( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('DurationWrapper', pipeline_response) @@ -983,7 +983,7 @@ async def put_duration( } error_map.update(kwargs.pop('error_map', {})) - _complex_body = models.DurationWrapper(field=field) + _complex_body = _models.DurationWrapper(field=field) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1007,7 +1007,7 @@ async def put_duration( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1019,7 +1019,7 @@ async def put_duration( async def get_byte( self, **kwargs - ) -> "models.ByteWrapper": + ) -> "_models.ByteWrapper": """Get complex types with byte properties. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1027,7 +1027,7 @@ async def get_byte( :rtype: ~bodycomplex.models.ByteWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ByteWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ByteWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1050,7 +1050,7 @@ async def get_byte( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('ByteWrapper', pipeline_response) @@ -1082,7 +1082,7 @@ async def put_byte( } error_map.update(kwargs.pop('error_map', {})) - _complex_body = models.ByteWrapper(field=field) + _complex_body = _models.ByteWrapper(field=field) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1106,7 +1106,7 @@ async def put_byte( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_readonlyproperty_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_readonlyproperty_operations.py index f133e07f2c4..c54a17e60e4 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_readonlyproperty_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_readonlyproperty_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ReadonlypropertyOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def get_valid( self, **kwargs - ) -> "models.ReadonlyObj": + ) -> "_models.ReadonlyObj": """Get complex types that have readonly properties. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ async def get_valid( :rtype: ~bodycomplex.models.ReadonlyObj :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ReadonlyObj"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReadonlyObj"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -75,7 +75,7 @@ async def get_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('ReadonlyObj', pipeline_response) @@ -107,7 +107,7 @@ async def put_valid( } error_map.update(kwargs.pop('error_map', {})) - _complex_body = models.ReadonlyObj(size=size) + _complex_body = _models.ReadonlyObj(size=size) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -131,7 +131,7 @@ async def put_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_array_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_array_operations.py index 804589b249e..13fe884eef0 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_array_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_array_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ArrayOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def get_valid( self, **kwargs # type: Any ): - # type: (...) -> "models.ArrayWrapper" + # type: (...) -> "_models.ArrayWrapper" """Get complex types with array property. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def get_valid( :rtype: ~bodycomplex.models.ArrayWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArrayWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArrayWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -80,7 +80,7 @@ def get_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('ArrayWrapper', pipeline_response) @@ -113,7 +113,7 @@ def put_valid( } error_map.update(kwargs.pop('error_map', {})) - _complex_body = models.ArrayWrapper(array=array) + _complex_body = _models.ArrayWrapper(array=array) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -137,7 +137,7 @@ def put_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -150,7 +150,7 @@ def get_empty( self, **kwargs # type: Any ): - # type: (...) -> "models.ArrayWrapper" + # type: (...) -> "_models.ArrayWrapper" """Get complex types with array property which is empty. :keyword callable cls: A custom type or function that will be passed the direct response @@ -158,7 +158,7 @@ def get_empty( :rtype: ~bodycomplex.models.ArrayWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArrayWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArrayWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -181,7 +181,7 @@ def get_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('ArrayWrapper', pipeline_response) @@ -214,7 +214,7 @@ def put_empty( } error_map.update(kwargs.pop('error_map', {})) - _complex_body = models.ArrayWrapper(array=array) + _complex_body = _models.ArrayWrapper(array=array) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -238,7 +238,7 @@ def put_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -251,7 +251,7 @@ def get_not_provided( self, **kwargs # type: Any ): - # type: (...) -> "models.ArrayWrapper" + # type: (...) -> "_models.ArrayWrapper" """Get complex types with array property while server doesn't provide a response payload. :keyword callable cls: A custom type or function that will be passed the direct response @@ -259,7 +259,7 @@ def get_not_provided( :rtype: ~bodycomplex.models.ArrayWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArrayWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArrayWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -282,7 +282,7 @@ def get_not_provided( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('ArrayWrapper', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_basic_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_basic_operations.py index 378ed4cd92e..77e8536dd9b 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_basic_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_basic_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class BasicOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def get_valid( self, **kwargs # type: Any ): - # type: (...) -> "models.Basic" + # type: (...) -> "_models.Basic" """Get complex type {id: 2, name: 'abc', color: 'YELLOW'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def get_valid( :rtype: ~bodycomplex.models.Basic :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Basic"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Basic"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -80,7 +80,7 @@ def get_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Basic', pipeline_response) @@ -94,7 +94,7 @@ def get_valid( @distributed_trace def put_valid( self, - complex_body, # type: "models.Basic" + complex_body, # type: "_models.Basic" **kwargs # type: Any ): # type: (...) -> None @@ -137,7 +137,7 @@ def put_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -150,7 +150,7 @@ def get_invalid( self, **kwargs # type: Any ): - # type: (...) -> "models.Basic" + # type: (...) -> "_models.Basic" """Get a basic complex type that is invalid for the local strong type. :keyword callable cls: A custom type or function that will be passed the direct response @@ -158,7 +158,7 @@ def get_invalid( :rtype: ~bodycomplex.models.Basic :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Basic"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Basic"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -181,7 +181,7 @@ def get_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Basic', pipeline_response) @@ -197,7 +197,7 @@ def get_empty( self, **kwargs # type: Any ): - # type: (...) -> "models.Basic" + # type: (...) -> "_models.Basic" """Get a basic complex type that is empty. :keyword callable cls: A custom type or function that will be passed the direct response @@ -205,7 +205,7 @@ def get_empty( :rtype: ~bodycomplex.models.Basic :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Basic"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Basic"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,7 +228,7 @@ def get_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Basic', pipeline_response) @@ -244,7 +244,7 @@ def get_null( self, **kwargs # type: Any ): - # type: (...) -> "models.Basic" + # type: (...) -> "_models.Basic" """Get a basic complex type whose properties are null. :keyword callable cls: A custom type or function that will be passed the direct response @@ -252,7 +252,7 @@ def get_null( :rtype: ~bodycomplex.models.Basic :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Basic"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Basic"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,7 +275,7 @@ def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Basic', pipeline_response) @@ -291,7 +291,7 @@ def get_not_provided( self, **kwargs # type: Any ): - # type: (...) -> "models.Basic" + # type: (...) -> "_models.Basic" """Get a basic complex type while the server doesn't provide a response payload. :keyword callable cls: A custom type or function that will be passed the direct response @@ -299,7 +299,7 @@ def get_not_provided( :rtype: ~bodycomplex.models.Basic :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Basic"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Basic"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -322,7 +322,7 @@ def get_not_provided( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Basic', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_dictionary_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_dictionary_operations.py index ee979a924ec..c911f0bde6c 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_dictionary_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_dictionary_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class DictionaryOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def get_valid( self, **kwargs # type: Any ): - # type: (...) -> "models.DictionaryWrapper" + # type: (...) -> "_models.DictionaryWrapper" """Get complex types with dictionary property. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def get_valid( :rtype: ~bodycomplex.models.DictionaryWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DictionaryWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DictionaryWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -80,7 +80,7 @@ def get_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('DictionaryWrapper', pipeline_response) @@ -113,7 +113,7 @@ def put_valid( } error_map.update(kwargs.pop('error_map', {})) - _complex_body = models.DictionaryWrapper(default_program=default_program) + _complex_body = _models.DictionaryWrapper(default_program=default_program) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -137,7 +137,7 @@ def put_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -150,7 +150,7 @@ def get_empty( self, **kwargs # type: Any ): - # type: (...) -> "models.DictionaryWrapper" + # type: (...) -> "_models.DictionaryWrapper" """Get complex types with dictionary property which is empty. :keyword callable cls: A custom type or function that will be passed the direct response @@ -158,7 +158,7 @@ def get_empty( :rtype: ~bodycomplex.models.DictionaryWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DictionaryWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DictionaryWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -181,7 +181,7 @@ def get_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('DictionaryWrapper', pipeline_response) @@ -214,7 +214,7 @@ def put_empty( } error_map.update(kwargs.pop('error_map', {})) - _complex_body = models.DictionaryWrapper(default_program=default_program) + _complex_body = _models.DictionaryWrapper(default_program=default_program) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -238,7 +238,7 @@ def put_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -251,7 +251,7 @@ def get_null( self, **kwargs # type: Any ): - # type: (...) -> "models.DictionaryWrapper" + # type: (...) -> "_models.DictionaryWrapper" """Get complex types with dictionary property which is null. :keyword callable cls: A custom type or function that will be passed the direct response @@ -259,7 +259,7 @@ def get_null( :rtype: ~bodycomplex.models.DictionaryWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DictionaryWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DictionaryWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -282,7 +282,7 @@ def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('DictionaryWrapper', pipeline_response) @@ -298,7 +298,7 @@ def get_not_provided( self, **kwargs # type: Any ): - # type: (...) -> "models.DictionaryWrapper" + # type: (...) -> "_models.DictionaryWrapper" """Get complex types with dictionary property while server doesn't provide a response payload. :keyword callable cls: A custom type or function that will be passed the direct response @@ -306,7 +306,7 @@ def get_not_provided( :rtype: ~bodycomplex.models.DictionaryWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DictionaryWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DictionaryWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -329,7 +329,7 @@ def get_not_provided( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('DictionaryWrapper', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_flattencomplex_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_flattencomplex_operations.py index cae057acc20..65aec88ae78 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_flattencomplex_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_flattencomplex_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class FlattencomplexOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def get_valid( self, **kwargs # type: Any ): - # type: (...) -> "models.MyBaseType" + # type: (...) -> "_models.MyBaseType" """get_valid. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def get_valid( :rtype: ~bodycomplex.models.MyBaseType :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MyBaseType"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyBaseType"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_inheritance_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_inheritance_operations.py index 38fa57d21b9..f7f457a6a4b 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_inheritance_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_inheritance_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class InheritanceOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def get_valid( self, **kwargs # type: Any ): - # type: (...) -> "models.Siamese" + # type: (...) -> "_models.Siamese" """Get complex types that extend others. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def get_valid( :rtype: ~bodycomplex.models.Siamese :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Siamese"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Siamese"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -80,7 +80,7 @@ def get_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Siamese', pipeline_response) @@ -94,7 +94,7 @@ def get_valid( @distributed_trace def put_valid( self, - complex_body, # type: "models.Siamese" + complex_body, # type: "_models.Siamese" **kwargs # type: Any ): # type: (...) -> None @@ -137,7 +137,7 @@ def put_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_polymorphicrecursive_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_polymorphicrecursive_operations.py index fe4c316f832..d6ee5f529d5 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_polymorphicrecursive_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_polymorphicrecursive_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class PolymorphicrecursiveOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def get_valid( self, **kwargs # type: Any ): - # type: (...) -> "models.Fish" + # type: (...) -> "_models.Fish" """Get complex types that are polymorphic and have recursive references. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def get_valid( :rtype: ~bodycomplex.models.Fish :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Fish"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Fish"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -80,7 +80,7 @@ def get_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Fish', pipeline_response) @@ -94,7 +94,7 @@ def get_valid( @distributed_trace def put_valid( self, - complex_body, # type: "models.Fish" + complex_body, # type: "_models.Fish" **kwargs # type: Any ): # type: (...) -> None @@ -187,7 +187,7 @@ def put_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_polymorphism_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_polymorphism_operations.py index 5f4429e365a..c757887a9dc 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_polymorphism_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_polymorphism_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class PolymorphismOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def get_valid( self, **kwargs # type: Any ): - # type: (...) -> "models.Fish" + # type: (...) -> "_models.Fish" """Get complex types that are polymorphic. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def get_valid( :rtype: ~bodycomplex.models.Fish :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Fish"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Fish"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -80,7 +80,7 @@ def get_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Fish', pipeline_response) @@ -94,7 +94,7 @@ def get_valid( @distributed_trace def put_valid( self, - complex_body, # type: "models.Fish" + complex_body, # type: "_models.Fish" **kwargs # type: Any ): # type: (...) -> None @@ -167,7 +167,7 @@ def put_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -180,7 +180,7 @@ def get_dot_syntax( self, **kwargs # type: Any ): - # type: (...) -> "models.DotFish" + # type: (...) -> "_models.DotFish" """Get complex types that are polymorphic, JSON key contains a dot. :keyword callable cls: A custom type or function that will be passed the direct response @@ -188,7 +188,7 @@ def get_dot_syntax( :rtype: ~bodycomplex.models.DotFish :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DotFish"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DotFish"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,7 +211,7 @@ def get_dot_syntax( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('DotFish', pipeline_response) @@ -227,7 +227,7 @@ def get_composed_with_discriminator( self, **kwargs # type: Any ): - # type: (...) -> "models.DotFishMarket" + # type: (...) -> "_models.DotFishMarket" """Get complex object composing a polymorphic scalar property and array property with polymorphic element type, with discriminator specified. Deserialization must NOT fail and use the discriminator type specified on the wire. @@ -237,7 +237,7 @@ def get_composed_with_discriminator( :rtype: ~bodycomplex.models.DotFishMarket :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DotFishMarket"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DotFishMarket"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -260,7 +260,7 @@ def get_composed_with_discriminator( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('DotFishMarket', pipeline_response) @@ -276,7 +276,7 @@ def get_composed_without_discriminator( self, **kwargs # type: Any ): - # type: (...) -> "models.DotFishMarket" + # type: (...) -> "_models.DotFishMarket" """Get complex object composing a polymorphic scalar property and array property with polymorphic element type, without discriminator specified on wire. Deserialization must NOT fail and use the explicit type of the property. @@ -286,7 +286,7 @@ def get_composed_without_discriminator( :rtype: ~bodycomplex.models.DotFishMarket :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DotFishMarket"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DotFishMarket"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +309,7 @@ def get_composed_without_discriminator( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('DotFishMarket', pipeline_response) @@ -325,7 +325,7 @@ def get_complicated( self, **kwargs # type: Any ): - # type: (...) -> "models.Salmon" + # type: (...) -> "_models.Salmon" """Get complex types that are polymorphic, but not at the root of the hierarchy; also have additional properties. @@ -334,7 +334,7 @@ def get_complicated( :rtype: ~bodycomplex.models.Salmon :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Salmon"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Salmon"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -357,7 +357,7 @@ def get_complicated( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Salmon', pipeline_response) @@ -371,7 +371,7 @@ def get_complicated( @distributed_trace def put_complicated( self, - complex_body, # type: "models.Salmon" + complex_body, # type: "_models.Salmon" **kwargs # type: Any ): # type: (...) -> None @@ -413,7 +413,7 @@ def put_complicated( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -424,10 +424,10 @@ def put_complicated( @distributed_trace def put_missing_discriminator( self, - complex_body, # type: "models.Salmon" + complex_body, # type: "_models.Salmon" **kwargs # type: Any ): - # type: (...) -> "models.Salmon" + # type: (...) -> "_models.Salmon" """Put complex types that are polymorphic, omitting the discriminator. :param complex_body: @@ -437,7 +437,7 @@ def put_missing_discriminator( :rtype: ~bodycomplex.models.Salmon :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Salmon"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Salmon"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -465,7 +465,7 @@ def put_missing_discriminator( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Salmon', pipeline_response) @@ -479,7 +479,7 @@ def put_missing_discriminator( @distributed_trace def put_valid_missing_required( self, - complex_body, # type: "models.Fish" + complex_body, # type: "_models.Fish" **kwargs # type: Any ): # type: (...) -> None @@ -547,7 +547,7 @@ def put_valid_missing_required( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_primitive_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_primitive_operations.py index cb0761ff662..2a7524fba97 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_primitive_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_primitive_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class PrimitiveOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def get_int( self, **kwargs # type: Any ): - # type: (...) -> "models.IntWrapper" + # type: (...) -> "_models.IntWrapper" """Get complex types with integer properties. :keyword callable cls: A custom type or function that will be passed the direct response @@ -58,7 +58,7 @@ def get_int( :rtype: ~bodycomplex.models.IntWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IntWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IntWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -81,7 +81,7 @@ def get_int( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('IntWrapper', pipeline_response) @@ -95,7 +95,7 @@ def get_int( @distributed_trace def put_int( self, - complex_body, # type: "models.IntWrapper" + complex_body, # type: "_models.IntWrapper" **kwargs # type: Any ): # type: (...) -> None @@ -136,7 +136,7 @@ def put_int( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -149,7 +149,7 @@ def get_long( self, **kwargs # type: Any ): - # type: (...) -> "models.LongWrapper" + # type: (...) -> "_models.LongWrapper" """Get complex types with long properties. :keyword callable cls: A custom type or function that will be passed the direct response @@ -157,7 +157,7 @@ def get_long( :rtype: ~bodycomplex.models.LongWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LongWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LongWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -180,7 +180,7 @@ def get_long( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('LongWrapper', pipeline_response) @@ -194,7 +194,7 @@ def get_long( @distributed_trace def put_long( self, - complex_body, # type: "models.LongWrapper" + complex_body, # type: "_models.LongWrapper" **kwargs # type: Any ): # type: (...) -> None @@ -235,7 +235,7 @@ def put_long( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -248,7 +248,7 @@ def get_float( self, **kwargs # type: Any ): - # type: (...) -> "models.FloatWrapper" + # type: (...) -> "_models.FloatWrapper" """Get complex types with float properties. :keyword callable cls: A custom type or function that will be passed the direct response @@ -256,7 +256,7 @@ def get_float( :rtype: ~bodycomplex.models.FloatWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.FloatWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FloatWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -279,7 +279,7 @@ def get_float( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('FloatWrapper', pipeline_response) @@ -293,7 +293,7 @@ def get_float( @distributed_trace def put_float( self, - complex_body, # type: "models.FloatWrapper" + complex_body, # type: "_models.FloatWrapper" **kwargs # type: Any ): # type: (...) -> None @@ -334,7 +334,7 @@ def put_float( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -347,7 +347,7 @@ def get_double( self, **kwargs # type: Any ): - # type: (...) -> "models.DoubleWrapper" + # type: (...) -> "_models.DoubleWrapper" """Get complex types with double properties. :keyword callable cls: A custom type or function that will be passed the direct response @@ -355,7 +355,7 @@ def get_double( :rtype: ~bodycomplex.models.DoubleWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DoubleWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DoubleWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -378,7 +378,7 @@ def get_double( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('DoubleWrapper', pipeline_response) @@ -392,7 +392,7 @@ def get_double( @distributed_trace def put_double( self, - complex_body, # type: "models.DoubleWrapper" + complex_body, # type: "_models.DoubleWrapper" **kwargs # type: Any ): # type: (...) -> None @@ -434,7 +434,7 @@ def put_double( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -447,7 +447,7 @@ def get_bool( self, **kwargs # type: Any ): - # type: (...) -> "models.BooleanWrapper" + # type: (...) -> "_models.BooleanWrapper" """Get complex types with bool properties. :keyword callable cls: A custom type or function that will be passed the direct response @@ -455,7 +455,7 @@ def get_bool( :rtype: ~bodycomplex.models.BooleanWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BooleanWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BooleanWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +478,7 @@ def get_bool( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('BooleanWrapper', pipeline_response) @@ -492,7 +492,7 @@ def get_bool( @distributed_trace def put_bool( self, - complex_body, # type: "models.BooleanWrapper" + complex_body, # type: "_models.BooleanWrapper" **kwargs # type: Any ): # type: (...) -> None @@ -533,7 +533,7 @@ def put_bool( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -546,7 +546,7 @@ def get_string( self, **kwargs # type: Any ): - # type: (...) -> "models.StringWrapper" + # type: (...) -> "_models.StringWrapper" """Get complex types with string properties. :keyword callable cls: A custom type or function that will be passed the direct response @@ -554,7 +554,7 @@ def get_string( :rtype: ~bodycomplex.models.StringWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StringWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -577,7 +577,7 @@ def get_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('StringWrapper', pipeline_response) @@ -591,7 +591,7 @@ def get_string( @distributed_trace def put_string( self, - complex_body, # type: "models.StringWrapper" + complex_body, # type: "_models.StringWrapper" **kwargs # type: Any ): # type: (...) -> None @@ -632,7 +632,7 @@ def put_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -645,7 +645,7 @@ def get_date( self, **kwargs # type: Any ): - # type: (...) -> "models.DateWrapper" + # type: (...) -> "_models.DateWrapper" """Get complex types with date properties. :keyword callable cls: A custom type or function that will be passed the direct response @@ -653,7 +653,7 @@ def get_date( :rtype: ~bodycomplex.models.DateWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DateWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DateWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -676,7 +676,7 @@ def get_date( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('DateWrapper', pipeline_response) @@ -690,7 +690,7 @@ def get_date( @distributed_trace def put_date( self, - complex_body, # type: "models.DateWrapper" + complex_body, # type: "_models.DateWrapper" **kwargs # type: Any ): # type: (...) -> None @@ -731,7 +731,7 @@ def put_date( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -744,7 +744,7 @@ def get_date_time( self, **kwargs # type: Any ): - # type: (...) -> "models.DatetimeWrapper" + # type: (...) -> "_models.DatetimeWrapper" """Get complex types with datetime properties. :keyword callable cls: A custom type or function that will be passed the direct response @@ -752,7 +752,7 @@ def get_date_time( :rtype: ~bodycomplex.models.DatetimeWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DatetimeWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DatetimeWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -775,7 +775,7 @@ def get_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('DatetimeWrapper', pipeline_response) @@ -789,7 +789,7 @@ def get_date_time( @distributed_trace def put_date_time( self, - complex_body, # type: "models.DatetimeWrapper" + complex_body, # type: "_models.DatetimeWrapper" **kwargs # type: Any ): # type: (...) -> None @@ -830,7 +830,7 @@ def put_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -843,7 +843,7 @@ def get_date_time_rfc1123( self, **kwargs # type: Any ): - # type: (...) -> "models.Datetimerfc1123Wrapper" + # type: (...) -> "_models.Datetimerfc1123Wrapper" """Get complex types with datetimeRfc1123 properties. :keyword callable cls: A custom type or function that will be passed the direct response @@ -851,7 +851,7 @@ def get_date_time_rfc1123( :rtype: ~bodycomplex.models.Datetimerfc1123Wrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Datetimerfc1123Wrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Datetimerfc1123Wrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -874,7 +874,7 @@ def get_date_time_rfc1123( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Datetimerfc1123Wrapper', pipeline_response) @@ -888,7 +888,7 @@ def get_date_time_rfc1123( @distributed_trace def put_date_time_rfc1123( self, - complex_body, # type: "models.Datetimerfc1123Wrapper" + complex_body, # type: "_models.Datetimerfc1123Wrapper" **kwargs # type: Any ): # type: (...) -> None @@ -930,7 +930,7 @@ def put_date_time_rfc1123( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -943,7 +943,7 @@ def get_duration( self, **kwargs # type: Any ): - # type: (...) -> "models.DurationWrapper" + # type: (...) -> "_models.DurationWrapper" """Get complex types with duration properties. :keyword callable cls: A custom type or function that will be passed the direct response @@ -951,7 +951,7 @@ def get_duration( :rtype: ~bodycomplex.models.DurationWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DurationWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DurationWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -974,7 +974,7 @@ def get_duration( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('DurationWrapper', pipeline_response) @@ -1007,7 +1007,7 @@ def put_duration( } error_map.update(kwargs.pop('error_map', {})) - _complex_body = models.DurationWrapper(field=field) + _complex_body = _models.DurationWrapper(field=field) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1031,7 +1031,7 @@ def put_duration( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1044,7 +1044,7 @@ def get_byte( self, **kwargs # type: Any ): - # type: (...) -> "models.ByteWrapper" + # type: (...) -> "_models.ByteWrapper" """Get complex types with byte properties. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1052,7 +1052,7 @@ def get_byte( :rtype: ~bodycomplex.models.ByteWrapper :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ByteWrapper"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ByteWrapper"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1075,7 +1075,7 @@ def get_byte( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('ByteWrapper', pipeline_response) @@ -1108,7 +1108,7 @@ def put_byte( } error_map.update(kwargs.pop('error_map', {})) - _complex_body = models.ByteWrapper(field=field) + _complex_body = _models.ByteWrapper(field=field) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1132,7 +1132,7 @@ def put_byte( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_readonlyproperty_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_readonlyproperty_operations.py index 9e6fbd1f451..14f465493af 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_readonlyproperty_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_readonlyproperty_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ReadonlypropertyOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def get_valid( self, **kwargs # type: Any ): - # type: (...) -> "models.ReadonlyObj" + # type: (...) -> "_models.ReadonlyObj" """Get complex types that have readonly properties. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def get_valid( :rtype: ~bodycomplex.models.ReadonlyObj :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ReadonlyObj"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReadonlyObj"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -80,7 +80,7 @@ def get_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('ReadonlyObj', pipeline_response) @@ -113,7 +113,7 @@ def put_valid( } error_map.update(kwargs.pop('error_map', {})) - _complex_body = models.ReadonlyObj(size=size) + _complex_body = _models.ReadonlyObj(size=size) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -137,7 +137,7 @@ def put_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/BodyDate/bodydate/aio/operations/_date_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyDate/bodydate/aio/operations/_date_operations.py index 1b9ad1b206b..5c1ce5bcfc4 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyDate/bodydate/aio/operations/_date_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyDate/bodydate/aio/operations/_date_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DateOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -76,7 +76,7 @@ async def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('date', pipeline_response) @@ -122,7 +122,7 @@ async def get_invalid_date( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('date', pipeline_response) @@ -168,7 +168,7 @@ async def get_overflow_date( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('date', pipeline_response) @@ -214,7 +214,7 @@ async def get_underflow_date( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('date', pipeline_response) @@ -268,7 +268,7 @@ async def put_max_date( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -311,7 +311,7 @@ async def get_max_date( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('date', pipeline_response) @@ -365,7 +365,7 @@ async def put_min_date( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -408,7 +408,7 @@ async def get_min_date( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('date', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyDate/bodydate/operations/_date_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyDate/bodydate/operations/_date_operations.py index 16040be60be..29ec5d72005 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyDate/bodydate/operations/_date_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyDate/bodydate/operations/_date_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DateOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -81,7 +81,7 @@ def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('date', pipeline_response) @@ -128,7 +128,7 @@ def get_invalid_date( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('date', pipeline_response) @@ -175,7 +175,7 @@ def get_overflow_date( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('date', pipeline_response) @@ -222,7 +222,7 @@ def get_underflow_date( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('date', pipeline_response) @@ -277,7 +277,7 @@ def put_max_date( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -321,7 +321,7 @@ def get_max_date( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('date', pipeline_response) @@ -376,7 +376,7 @@ def put_min_date( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -420,7 +420,7 @@ def get_min_date( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('date', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyDateTime/bodydatetime/aio/operations/_datetime_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyDateTime/bodydatetime/aio/operations/_datetime_operations.py index 485660616ac..1dedae00b8e 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyDateTime/bodydatetime/aio/operations/_datetime_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyDateTime/bodydatetime/aio/operations/_datetime_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DatetimeOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -76,7 +76,7 @@ async def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -122,7 +122,7 @@ async def get_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -168,7 +168,7 @@ async def get_overflow( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -214,7 +214,7 @@ async def get_underflow( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -268,7 +268,7 @@ async def put_utc_max_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -322,7 +322,7 @@ async def put_utc_max_date_time7_digits( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -365,7 +365,7 @@ async def get_utc_lowercase_max_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -411,7 +411,7 @@ async def get_utc_uppercase_max_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -460,7 +460,7 @@ async def get_utc_uppercase_max_date_time7_digits( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -514,7 +514,7 @@ async def put_local_positive_offset_max_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -557,7 +557,7 @@ async def get_local_positive_offset_lowercase_max_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -603,7 +603,7 @@ async def get_local_positive_offset_uppercase_max_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -657,7 +657,7 @@ async def put_local_negative_offset_max_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -700,7 +700,7 @@ async def get_local_negative_offset_uppercase_max_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -746,7 +746,7 @@ async def get_local_negative_offset_lowercase_max_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -800,7 +800,7 @@ async def put_utc_min_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -843,7 +843,7 @@ async def get_utc_min_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -897,7 +897,7 @@ async def put_local_positive_offset_min_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -940,7 +940,7 @@ async def get_local_positive_offset_min_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -994,7 +994,7 @@ async def put_local_negative_offset_min_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1037,7 +1037,7 @@ async def get_local_negative_offset_min_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -1083,7 +1083,7 @@ async def get_local_no_offset_min_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyDateTime/bodydatetime/operations/_datetime_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyDateTime/bodydatetime/operations/_datetime_operations.py index e31a2dfc264..c781a75b8a9 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyDateTime/bodydatetime/operations/_datetime_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyDateTime/bodydatetime/operations/_datetime_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DatetimeOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -81,7 +81,7 @@ def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -128,7 +128,7 @@ def get_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -175,7 +175,7 @@ def get_overflow( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -222,7 +222,7 @@ def get_underflow( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -277,7 +277,7 @@ def put_utc_max_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -332,7 +332,7 @@ def put_utc_max_date_time7_digits( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -376,7 +376,7 @@ def get_utc_lowercase_max_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -423,7 +423,7 @@ def get_utc_uppercase_max_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -473,7 +473,7 @@ def get_utc_uppercase_max_date_time7_digits( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -528,7 +528,7 @@ def put_local_positive_offset_max_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -572,7 +572,7 @@ def get_local_positive_offset_lowercase_max_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -619,7 +619,7 @@ def get_local_positive_offset_uppercase_max_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -674,7 +674,7 @@ def put_local_negative_offset_max_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -718,7 +718,7 @@ def get_local_negative_offset_uppercase_max_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -765,7 +765,7 @@ def get_local_negative_offset_lowercase_max_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -820,7 +820,7 @@ def put_utc_min_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -864,7 +864,7 @@ def get_utc_min_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -919,7 +919,7 @@ def put_local_positive_offset_min_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -963,7 +963,7 @@ def get_local_positive_offset_min_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -1018,7 +1018,7 @@ def put_local_negative_offset_min_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1062,7 +1062,7 @@ def get_local_negative_offset_min_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) @@ -1109,7 +1109,7 @@ def get_local_no_offset_min_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('iso-8601', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyDateTimeRfc1123/bodydatetimerfc1123/aio/operations/_datetimerfc1123_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyDateTimeRfc1123/bodydatetimerfc1123/aio/operations/_datetimerfc1123_operations.py index 7541fdcd221..b4d400e46de 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyDateTimeRfc1123/bodydatetimerfc1123/aio/operations/_datetimerfc1123_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyDateTimeRfc1123/bodydatetimerfc1123/aio/operations/_datetimerfc1123_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Datetimerfc1123Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -76,7 +76,7 @@ async def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('rfc-1123', pipeline_response) @@ -122,7 +122,7 @@ async def get_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('rfc-1123', pipeline_response) @@ -168,7 +168,7 @@ async def get_overflow( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('rfc-1123', pipeline_response) @@ -214,7 +214,7 @@ async def get_underflow( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('rfc-1123', pipeline_response) @@ -268,7 +268,7 @@ async def put_utc_max_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -311,7 +311,7 @@ async def get_utc_lowercase_max_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('rfc-1123', pipeline_response) @@ -357,7 +357,7 @@ async def get_utc_uppercase_max_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('rfc-1123', pipeline_response) @@ -411,7 +411,7 @@ async def put_utc_min_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -454,7 +454,7 @@ async def get_utc_min_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('rfc-1123', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyDateTimeRfc1123/bodydatetimerfc1123/operations/_datetimerfc1123_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyDateTimeRfc1123/bodydatetimerfc1123/operations/_datetimerfc1123_operations.py index 29c511ad193..27022c8c55b 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyDateTimeRfc1123/bodydatetimerfc1123/operations/_datetimerfc1123_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyDateTimeRfc1123/bodydatetimerfc1123/operations/_datetimerfc1123_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Datetimerfc1123Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -81,7 +81,7 @@ def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('rfc-1123', pipeline_response) @@ -128,7 +128,7 @@ def get_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('rfc-1123', pipeline_response) @@ -175,7 +175,7 @@ def get_overflow( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('rfc-1123', pipeline_response) @@ -222,7 +222,7 @@ def get_underflow( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('rfc-1123', pipeline_response) @@ -277,7 +277,7 @@ def put_utc_max_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -321,7 +321,7 @@ def get_utc_lowercase_max_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('rfc-1123', pipeline_response) @@ -368,7 +368,7 @@ def get_utc_uppercase_max_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('rfc-1123', pipeline_response) @@ -423,7 +423,7 @@ def put_utc_min_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -467,7 +467,7 @@ def get_utc_min_date_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('rfc-1123', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyDictionary/bodydictionary/aio/operations/_dictionary_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyDictionary/bodydictionary/aio/operations/_dictionary_operations.py index 0bc5fd2fe92..544e6cafe34 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyDictionary/bodydictionary/aio/operations/_dictionary_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyDictionary/bodydictionary/aio/operations/_dictionary_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DictionaryOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -76,7 +76,7 @@ async def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{int}', pipeline_response) @@ -122,7 +122,7 @@ async def get_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{int}', pipeline_response) @@ -176,7 +176,7 @@ async def put_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -219,7 +219,7 @@ async def get_null_value( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{str}', pipeline_response) @@ -265,7 +265,7 @@ async def get_null_key( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{str}', pipeline_response) @@ -311,7 +311,7 @@ async def get_empty_string_key( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{str}', pipeline_response) @@ -357,7 +357,7 @@ async def get_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{str}', pipeline_response) @@ -403,7 +403,7 @@ async def get_boolean_tfft( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{bool}', pipeline_response) @@ -457,7 +457,7 @@ async def put_boolean_tfft( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -500,7 +500,7 @@ async def get_boolean_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{bool}', pipeline_response) @@ -546,7 +546,7 @@ async def get_boolean_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{bool}', pipeline_response) @@ -592,7 +592,7 @@ async def get_integer_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{int}', pipeline_response) @@ -646,7 +646,7 @@ async def put_integer_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -689,7 +689,7 @@ async def get_int_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{int}', pipeline_response) @@ -735,7 +735,7 @@ async def get_int_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{int}', pipeline_response) @@ -781,7 +781,7 @@ async def get_long_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{long}', pipeline_response) @@ -835,7 +835,7 @@ async def put_long_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -878,7 +878,7 @@ async def get_long_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{long}', pipeline_response) @@ -924,7 +924,7 @@ async def get_long_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{long}', pipeline_response) @@ -970,7 +970,7 @@ async def get_float_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{float}', pipeline_response) @@ -1024,7 +1024,7 @@ async def put_float_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1067,7 +1067,7 @@ async def get_float_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{float}', pipeline_response) @@ -1113,7 +1113,7 @@ async def get_float_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{float}', pipeline_response) @@ -1159,7 +1159,7 @@ async def get_double_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{float}', pipeline_response) @@ -1213,7 +1213,7 @@ async def put_double_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1256,7 +1256,7 @@ async def get_double_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{float}', pipeline_response) @@ -1302,7 +1302,7 @@ async def get_double_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{float}', pipeline_response) @@ -1348,7 +1348,7 @@ async def get_string_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{str}', pipeline_response) @@ -1402,7 +1402,7 @@ async def put_string_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1445,7 +1445,7 @@ async def get_string_with_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{str}', pipeline_response) @@ -1491,7 +1491,7 @@ async def get_string_with_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{str}', pipeline_response) @@ -1537,7 +1537,7 @@ async def get_date_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{date}', pipeline_response) @@ -1591,7 +1591,7 @@ async def put_date_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1634,7 +1634,7 @@ async def get_date_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{date}', pipeline_response) @@ -1680,7 +1680,7 @@ async def get_date_invalid_chars( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{date}', pipeline_response) @@ -1727,7 +1727,7 @@ async def get_date_time_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{iso-8601}', pipeline_response) @@ -1782,7 +1782,7 @@ async def put_date_time_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1825,7 +1825,7 @@ async def get_date_time_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{iso-8601}', pipeline_response) @@ -1871,7 +1871,7 @@ async def get_date_time_invalid_chars( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{iso-8601}', pipeline_response) @@ -1918,7 +1918,7 @@ async def get_date_time_rfc1123_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{rfc-1123}', pipeline_response) @@ -1973,7 +1973,7 @@ async def put_date_time_rfc1123_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2016,7 +2016,7 @@ async def get_duration_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{duration}', pipeline_response) @@ -2070,7 +2070,7 @@ async def put_duration_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2114,7 +2114,7 @@ async def get_byte_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{bytearray}', pipeline_response) @@ -2169,7 +2169,7 @@ async def put_byte_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2213,7 +2213,7 @@ async def get_byte_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{bytearray}', pipeline_response) @@ -2260,7 +2260,7 @@ async def get_base64_url( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{base64}', pipeline_response) @@ -2275,7 +2275,7 @@ async def get_base64_url( async def get_complex_null( self, **kwargs - ) -> Optional[Dict[str, "models.Widget"]]: + ) -> Optional[Dict[str, "_models.Widget"]]: """Get dictionary of complex type null value. :keyword callable cls: A custom type or function that will be passed the direct response @@ -2283,7 +2283,7 @@ async def get_complex_null( :rtype: dict[str, ~bodydictionary.models.Widget] or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional[Dict[str, "models.Widget"]]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[Dict[str, "_models.Widget"]]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2306,7 +2306,7 @@ async def get_complex_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{Widget}', pipeline_response) @@ -2321,7 +2321,7 @@ async def get_complex_null( async def get_complex_empty( self, **kwargs - ) -> Dict[str, "models.Widget"]: + ) -> Dict[str, "_models.Widget"]: """Get empty dictionary of complex type {}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -2329,7 +2329,7 @@ async def get_complex_empty( :rtype: dict[str, ~bodydictionary.models.Widget] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, "models.Widget"]] + cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, "_models.Widget"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2352,7 +2352,7 @@ async def get_complex_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{Widget}', pipeline_response) @@ -2367,7 +2367,7 @@ async def get_complex_empty( async def get_complex_item_null( self, **kwargs - ) -> Dict[str, "models.Widget"]: + ) -> Dict[str, "_models.Widget"]: """Get dictionary of complex type with null item {"0": {"integer": 1, "string": "2"}, "1": null, "2": {"integer": 5, "string": "6"}}. @@ -2376,7 +2376,7 @@ async def get_complex_item_null( :rtype: dict[str, ~bodydictionary.models.Widget] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, "models.Widget"]] + cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, "_models.Widget"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2399,7 +2399,7 @@ async def get_complex_item_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{Widget}', pipeline_response) @@ -2414,7 +2414,7 @@ async def get_complex_item_null( async def get_complex_item_empty( self, **kwargs - ) -> Dict[str, "models.Widget"]: + ) -> Dict[str, "_models.Widget"]: """Get dictionary of complex type with empty item {"0": {"integer": 1, "string": "2"}, "1:" {}, "2": {"integer": 5, "string": "6"}}. @@ -2423,7 +2423,7 @@ async def get_complex_item_empty( :rtype: dict[str, ~bodydictionary.models.Widget] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, "models.Widget"]] + cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, "_models.Widget"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2446,7 +2446,7 @@ async def get_complex_item_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{Widget}', pipeline_response) @@ -2461,7 +2461,7 @@ async def get_complex_item_empty( async def get_complex_valid( self, **kwargs - ) -> Dict[str, "models.Widget"]: + ) -> Dict[str, "_models.Widget"]: """Get dictionary of complex type with {"0": {"integer": 1, "string": "2"}, "1": {"integer": 3, "string": "4"}, "2": {"integer": 5, "string": "6"}}. @@ -2470,7 +2470,7 @@ async def get_complex_valid( :rtype: dict[str, ~bodydictionary.models.Widget] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, "models.Widget"]] + cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, "_models.Widget"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2493,7 +2493,7 @@ async def get_complex_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{Widget}', pipeline_response) @@ -2507,7 +2507,7 @@ async def get_complex_valid( @distributed_trace_async async def put_complex_valid( self, - array_body: Dict[str, "models.Widget"], + array_body: Dict[str, "_models.Widget"], **kwargs ) -> None: """Put an dictionary of complex type with values {"0": {"integer": 1, "string": "2"}, "1": @@ -2548,7 +2548,7 @@ async def put_complex_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2591,7 +2591,7 @@ async def get_array_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{[str]}', pipeline_response) @@ -2637,7 +2637,7 @@ async def get_array_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{[str]}', pipeline_response) @@ -2683,7 +2683,7 @@ async def get_array_item_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{[str]}', pipeline_response) @@ -2729,7 +2729,7 @@ async def get_array_item_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{[str]}', pipeline_response) @@ -2776,7 +2776,7 @@ async def get_array_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{[str]}', pipeline_response) @@ -2831,7 +2831,7 @@ async def put_array_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2874,7 +2874,7 @@ async def get_dictionary_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{object}', pipeline_response) @@ -2920,7 +2920,7 @@ async def get_dictionary_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{object}', pipeline_response) @@ -2967,7 +2967,7 @@ async def get_dictionary_item_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{object}', pipeline_response) @@ -3014,7 +3014,7 @@ async def get_dictionary_item_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{object}', pipeline_response) @@ -3062,7 +3062,7 @@ async def get_dictionary_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{object}', pipeline_response) @@ -3118,7 +3118,7 @@ async def put_dictionary_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/BodyDictionary/bodydictionary/operations/_dictionary_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyDictionary/bodydictionary/operations/_dictionary_operations.py index e49a130c7a1..510ce86fe4c 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyDictionary/bodydictionary/operations/_dictionary_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyDictionary/bodydictionary/operations/_dictionary_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DictionaryOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -81,7 +81,7 @@ def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{int}', pipeline_response) @@ -128,7 +128,7 @@ def get_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{int}', pipeline_response) @@ -183,7 +183,7 @@ def put_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -227,7 +227,7 @@ def get_null_value( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{str}', pipeline_response) @@ -274,7 +274,7 @@ def get_null_key( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{str}', pipeline_response) @@ -321,7 +321,7 @@ def get_empty_string_key( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{str}', pipeline_response) @@ -368,7 +368,7 @@ def get_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{str}', pipeline_response) @@ -415,7 +415,7 @@ def get_boolean_tfft( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{bool}', pipeline_response) @@ -470,7 +470,7 @@ def put_boolean_tfft( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -514,7 +514,7 @@ def get_boolean_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{bool}', pipeline_response) @@ -561,7 +561,7 @@ def get_boolean_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{bool}', pipeline_response) @@ -608,7 +608,7 @@ def get_integer_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{int}', pipeline_response) @@ -663,7 +663,7 @@ def put_integer_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -707,7 +707,7 @@ def get_int_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{int}', pipeline_response) @@ -754,7 +754,7 @@ def get_int_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{int}', pipeline_response) @@ -801,7 +801,7 @@ def get_long_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{long}', pipeline_response) @@ -856,7 +856,7 @@ def put_long_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -900,7 +900,7 @@ def get_long_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{long}', pipeline_response) @@ -947,7 +947,7 @@ def get_long_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{long}', pipeline_response) @@ -994,7 +994,7 @@ def get_float_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{float}', pipeline_response) @@ -1049,7 +1049,7 @@ def put_float_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1093,7 +1093,7 @@ def get_float_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{float}', pipeline_response) @@ -1140,7 +1140,7 @@ def get_float_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{float}', pipeline_response) @@ -1187,7 +1187,7 @@ def get_double_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{float}', pipeline_response) @@ -1242,7 +1242,7 @@ def put_double_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1286,7 +1286,7 @@ def get_double_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{float}', pipeline_response) @@ -1333,7 +1333,7 @@ def get_double_invalid_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{float}', pipeline_response) @@ -1380,7 +1380,7 @@ def get_string_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{str}', pipeline_response) @@ -1435,7 +1435,7 @@ def put_string_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1479,7 +1479,7 @@ def get_string_with_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{str}', pipeline_response) @@ -1526,7 +1526,7 @@ def get_string_with_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{str}', pipeline_response) @@ -1573,7 +1573,7 @@ def get_date_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{date}', pipeline_response) @@ -1628,7 +1628,7 @@ def put_date_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1672,7 +1672,7 @@ def get_date_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{date}', pipeline_response) @@ -1719,7 +1719,7 @@ def get_date_invalid_chars( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{date}', pipeline_response) @@ -1767,7 +1767,7 @@ def get_date_time_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{iso-8601}', pipeline_response) @@ -1823,7 +1823,7 @@ def put_date_time_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1867,7 +1867,7 @@ def get_date_time_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{iso-8601}', pipeline_response) @@ -1914,7 +1914,7 @@ def get_date_time_invalid_chars( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{iso-8601}', pipeline_response) @@ -1962,7 +1962,7 @@ def get_date_time_rfc1123_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{rfc-1123}', pipeline_response) @@ -2018,7 +2018,7 @@ def put_date_time_rfc1123_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2062,7 +2062,7 @@ def get_duration_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{duration}', pipeline_response) @@ -2117,7 +2117,7 @@ def put_duration_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2162,7 +2162,7 @@ def get_byte_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{bytearray}', pipeline_response) @@ -2218,7 +2218,7 @@ def put_byte_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2263,7 +2263,7 @@ def get_byte_invalid_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{bytearray}', pipeline_response) @@ -2311,7 +2311,7 @@ def get_base64_url( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{base64}', pipeline_response) @@ -2327,7 +2327,7 @@ def get_complex_null( self, **kwargs # type: Any ): - # type: (...) -> Optional[Dict[str, "models.Widget"]] + # type: (...) -> Optional[Dict[str, "_models.Widget"]] """Get dictionary of complex type null value. :keyword callable cls: A custom type or function that will be passed the direct response @@ -2335,7 +2335,7 @@ def get_complex_null( :rtype: dict[str, ~bodydictionary.models.Widget] or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional[Dict[str, "models.Widget"]]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[Dict[str, "_models.Widget"]]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2358,7 +2358,7 @@ def get_complex_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{Widget}', pipeline_response) @@ -2374,7 +2374,7 @@ def get_complex_empty( self, **kwargs # type: Any ): - # type: (...) -> Dict[str, "models.Widget"] + # type: (...) -> Dict[str, "_models.Widget"] """Get empty dictionary of complex type {}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -2382,7 +2382,7 @@ def get_complex_empty( :rtype: dict[str, ~bodydictionary.models.Widget] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, "models.Widget"]] + cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, "_models.Widget"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2405,7 +2405,7 @@ def get_complex_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{Widget}', pipeline_response) @@ -2421,7 +2421,7 @@ def get_complex_item_null( self, **kwargs # type: Any ): - # type: (...) -> Dict[str, "models.Widget"] + # type: (...) -> Dict[str, "_models.Widget"] """Get dictionary of complex type with null item {"0": {"integer": 1, "string": "2"}, "1": null, "2": {"integer": 5, "string": "6"}}. @@ -2430,7 +2430,7 @@ def get_complex_item_null( :rtype: dict[str, ~bodydictionary.models.Widget] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, "models.Widget"]] + cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, "_models.Widget"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2453,7 +2453,7 @@ def get_complex_item_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{Widget}', pipeline_response) @@ -2469,7 +2469,7 @@ def get_complex_item_empty( self, **kwargs # type: Any ): - # type: (...) -> Dict[str, "models.Widget"] + # type: (...) -> Dict[str, "_models.Widget"] """Get dictionary of complex type with empty item {"0": {"integer": 1, "string": "2"}, "1:" {}, "2": {"integer": 5, "string": "6"}}. @@ -2478,7 +2478,7 @@ def get_complex_item_empty( :rtype: dict[str, ~bodydictionary.models.Widget] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, "models.Widget"]] + cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, "_models.Widget"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2501,7 +2501,7 @@ def get_complex_item_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{Widget}', pipeline_response) @@ -2517,7 +2517,7 @@ def get_complex_valid( self, **kwargs # type: Any ): - # type: (...) -> Dict[str, "models.Widget"] + # type: (...) -> Dict[str, "_models.Widget"] """Get dictionary of complex type with {"0": {"integer": 1, "string": "2"}, "1": {"integer": 3, "string": "4"}, "2": {"integer": 5, "string": "6"}}. @@ -2526,7 +2526,7 @@ def get_complex_valid( :rtype: dict[str, ~bodydictionary.models.Widget] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, "models.Widget"]] + cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, "_models.Widget"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2549,7 +2549,7 @@ def get_complex_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{Widget}', pipeline_response) @@ -2563,7 +2563,7 @@ def get_complex_valid( @distributed_trace def put_complex_valid( self, - array_body, # type: Dict[str, "models.Widget"] + array_body, # type: Dict[str, "_models.Widget"] **kwargs # type: Any ): # type: (...) -> None @@ -2605,7 +2605,7 @@ def put_complex_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2649,7 +2649,7 @@ def get_array_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{[str]}', pipeline_response) @@ -2696,7 +2696,7 @@ def get_array_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{[str]}', pipeline_response) @@ -2743,7 +2743,7 @@ def get_array_item_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{[str]}', pipeline_response) @@ -2790,7 +2790,7 @@ def get_array_item_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{[str]}', pipeline_response) @@ -2838,7 +2838,7 @@ def get_array_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{[str]}', pipeline_response) @@ -2894,7 +2894,7 @@ def put_array_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -2938,7 +2938,7 @@ def get_dictionary_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{object}', pipeline_response) @@ -2985,7 +2985,7 @@ def get_dictionary_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{object}', pipeline_response) @@ -3033,7 +3033,7 @@ def get_dictionary_item_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{object}', pipeline_response) @@ -3081,7 +3081,7 @@ def get_dictionary_item_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{object}', pipeline_response) @@ -3130,7 +3130,7 @@ def get_dictionary_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{object}', pipeline_response) @@ -3187,7 +3187,7 @@ def put_dictionary_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/BodyDuration/bodyduration/aio/operations/_duration_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyDuration/bodyduration/aio/operations/_duration_operations.py index c34fbbb55d3..88e9bf120af 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyDuration/bodyduration/aio/operations/_duration_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyDuration/bodyduration/aio/operations/_duration_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DurationOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -76,7 +76,7 @@ async def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('duration', pipeline_response) @@ -130,7 +130,7 @@ async def put_positive_duration( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -173,7 +173,7 @@ async def get_positive_duration( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('duration', pipeline_response) @@ -219,7 +219,7 @@ async def get_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('duration', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyDuration/bodyduration/operations/_duration_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyDuration/bodyduration/operations/_duration_operations.py index ba3a5bd93c2..1310f4279eb 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyDuration/bodyduration/operations/_duration_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyDuration/bodyduration/operations/_duration_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DurationOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -81,7 +81,7 @@ def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('duration', pipeline_response) @@ -136,7 +136,7 @@ def put_positive_duration( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -180,7 +180,7 @@ def get_positive_duration( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('duration', pipeline_response) @@ -227,7 +227,7 @@ def get_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('duration', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyFile/bodyfile/aio/operations/_files_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyFile/bodyfile/aio/operations/_files_operations.py index 3b3ee28bdad..a0ebae13b5a 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyFile/bodyfile/aio/operations/_files_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyFile/bodyfile/aio/operations/_files_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class FilesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -75,7 +75,7 @@ async def get_file( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = response.stream_download(self._client._pipeline) @@ -121,7 +121,7 @@ async def get_file_large( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = response.stream_download(self._client._pipeline) @@ -167,7 +167,7 @@ async def get_empty_file( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = response.stream_download(self._client._pipeline) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyFile/bodyfile/operations/_files_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyFile/bodyfile/operations/_files_operations.py index ef0b1ba53b1..9b50b436a4c 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyFile/bodyfile/operations/_files_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyFile/bodyfile/operations/_files_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class FilesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -80,7 +80,7 @@ def get_file( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = response.stream_download(self._client._pipeline) @@ -127,7 +127,7 @@ def get_file_large( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = response.stream_download(self._client._pipeline) @@ -174,7 +174,7 @@ def get_empty_file( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = response.stream_download(self._client._pipeline) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyFormData/bodyformdata/aio/operations/_formdata_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyFormData/bodyformdata/aio/operations/_formdata_operations.py index 22af91f3e2d..b01b5082b00 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyFormData/bodyformdata/aio/operations/_formdata_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyFormData/bodyformdata/aio/operations/_formdata_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class FormdataOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -88,7 +88,7 @@ async def upload_file( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = response.stream_download(self._client._pipeline) @@ -141,7 +141,7 @@ async def upload_file_via_body( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = response.stream_download(self._client._pipeline) @@ -196,7 +196,7 @@ async def upload_files( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = response.stream_download(self._client._pipeline) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyFormData/bodyformdata/operations/_formdata_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyFormData/bodyformdata/operations/_formdata_operations.py index 52e2863575f..3b583bd9fb1 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyFormData/bodyformdata/operations/_formdata_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyFormData/bodyformdata/operations/_formdata_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class FormdataOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -93,7 +93,7 @@ def upload_file( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = response.stream_download(self._client._pipeline) @@ -147,7 +147,7 @@ def upload_file_via_body( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = response.stream_download(self._client._pipeline) @@ -203,7 +203,7 @@ def upload_files( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = response.stream_download(self._client._pipeline) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyInteger/bodyinteger/aio/operations/_int_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyInteger/bodyinteger/aio/operations/_int_operations.py index 65a59bc0c12..3abf2f3b1b3 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyInteger/bodyinteger/aio/operations/_int_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyInteger/bodyinteger/aio/operations/_int_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class IntOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -76,7 +76,7 @@ async def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('int', pipeline_response) @@ -122,7 +122,7 @@ async def get_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('int', pipeline_response) @@ -168,7 +168,7 @@ async def get_overflow_int32( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('int', pipeline_response) @@ -214,7 +214,7 @@ async def get_underflow_int32( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('int', pipeline_response) @@ -260,7 +260,7 @@ async def get_overflow_int64( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('long', pipeline_response) @@ -306,7 +306,7 @@ async def get_underflow_int64( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('long', pipeline_response) @@ -360,7 +360,7 @@ async def put_max32( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -411,7 +411,7 @@ async def put_max64( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -462,7 +462,7 @@ async def put_min32( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -513,7 +513,7 @@ async def put_min64( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -556,7 +556,7 @@ async def get_unix_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('unix-time', pipeline_response) @@ -610,7 +610,7 @@ async def put_unix_time_date( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -653,7 +653,7 @@ async def get_invalid_unix_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('unix-time', pipeline_response) @@ -699,7 +699,7 @@ async def get_null_unix_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('unix-time', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyInteger/bodyinteger/operations/_int_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyInteger/bodyinteger/operations/_int_operations.py index 5e36a2036d2..ae7f1e37f98 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyInteger/bodyinteger/operations/_int_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyInteger/bodyinteger/operations/_int_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class IntOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -81,7 +81,7 @@ def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('int', pipeline_response) @@ -128,7 +128,7 @@ def get_invalid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('int', pipeline_response) @@ -175,7 +175,7 @@ def get_overflow_int32( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('int', pipeline_response) @@ -222,7 +222,7 @@ def get_underflow_int32( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('int', pipeline_response) @@ -269,7 +269,7 @@ def get_overflow_int64( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('long', pipeline_response) @@ -316,7 +316,7 @@ def get_underflow_int64( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('long', pipeline_response) @@ -371,7 +371,7 @@ def put_max32( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -423,7 +423,7 @@ def put_max64( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -475,7 +475,7 @@ def put_min32( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -527,7 +527,7 @@ def put_min64( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -571,7 +571,7 @@ def get_unix_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('unix-time', pipeline_response) @@ -626,7 +626,7 @@ def put_unix_time_date( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -670,7 +670,7 @@ def get_invalid_unix_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('unix-time', pipeline_response) @@ -717,7 +717,7 @@ def get_null_unix_time( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('unix-time', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyNumber/bodynumber/aio/operations/_number_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyNumber/bodynumber/aio/operations/_number_operations.py index 426e3c7d23e..6006beeeb0d 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyNumber/bodynumber/aio/operations/_number_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyNumber/bodynumber/aio/operations/_number_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class NumberOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -75,7 +75,7 @@ async def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) @@ -121,7 +121,7 @@ async def get_invalid_float( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) @@ -167,7 +167,7 @@ async def get_invalid_double( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) @@ -213,7 +213,7 @@ async def get_invalid_decimal( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) @@ -267,7 +267,7 @@ async def put_big_float( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -310,7 +310,7 @@ async def get_big_float( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) @@ -364,7 +364,7 @@ async def put_big_double( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -407,7 +407,7 @@ async def get_big_double( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) @@ -459,7 +459,7 @@ async def put_big_double_positive_decimal( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -502,7 +502,7 @@ async def get_big_double_positive_decimal( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) @@ -554,7 +554,7 @@ async def put_big_double_negative_decimal( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -597,7 +597,7 @@ async def get_big_double_negative_decimal( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) @@ -651,7 +651,7 @@ async def put_big_decimal( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -694,7 +694,7 @@ async def get_big_decimal( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) @@ -746,7 +746,7 @@ async def put_big_decimal_positive_decimal( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -789,7 +789,7 @@ async def get_big_decimal_positive_decimal( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) @@ -841,7 +841,7 @@ async def put_big_decimal_negative_decimal( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -884,7 +884,7 @@ async def get_big_decimal_negative_decimal( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) @@ -938,7 +938,7 @@ async def put_small_float( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -981,7 +981,7 @@ async def get_small_float( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) @@ -1035,7 +1035,7 @@ async def put_small_double( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1078,7 +1078,7 @@ async def get_small_double( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) @@ -1132,7 +1132,7 @@ async def put_small_decimal( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1175,7 +1175,7 @@ async def get_small_decimal( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyNumber/bodynumber/operations/_number_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyNumber/bodynumber/operations/_number_operations.py index 21f4b629777..f7c3a7182d8 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyNumber/bodynumber/operations/_number_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyNumber/bodynumber/operations/_number_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class NumberOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -80,7 +80,7 @@ def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) @@ -127,7 +127,7 @@ def get_invalid_float( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) @@ -174,7 +174,7 @@ def get_invalid_double( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) @@ -221,7 +221,7 @@ def get_invalid_decimal( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) @@ -276,7 +276,7 @@ def put_big_float( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -320,7 +320,7 @@ def get_big_float( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) @@ -375,7 +375,7 @@ def put_big_double( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -419,7 +419,7 @@ def get_big_double( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) @@ -472,7 +472,7 @@ def put_big_double_positive_decimal( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -516,7 +516,7 @@ def get_big_double_positive_decimal( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) @@ -569,7 +569,7 @@ def put_big_double_negative_decimal( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -613,7 +613,7 @@ def get_big_double_negative_decimal( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) @@ -668,7 +668,7 @@ def put_big_decimal( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -712,7 +712,7 @@ def get_big_decimal( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) @@ -765,7 +765,7 @@ def put_big_decimal_positive_decimal( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -809,7 +809,7 @@ def get_big_decimal_positive_decimal( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) @@ -862,7 +862,7 @@ def put_big_decimal_negative_decimal( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -906,7 +906,7 @@ def get_big_decimal_negative_decimal( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) @@ -961,7 +961,7 @@ def put_small_float( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1005,7 +1005,7 @@ def get_small_float( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) @@ -1060,7 +1060,7 @@ def put_small_double( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1104,7 +1104,7 @@ def get_small_double( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) @@ -1159,7 +1159,7 @@ def put_small_decimal( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1203,7 +1203,7 @@ def get_small_decimal( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('float', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyString/bodystring/aio/operations/_enum_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyString/bodystring/aio/operations/_enum_operations.py index 5a62756c5ef..814aacd8585 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyString/bodystring/aio/operations/_enum_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyString/bodystring/aio/operations/_enum_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class EnumOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def get_not_expandable( self, **kwargs - ) -> Union[str, "models.Colors"]: + ) -> Union[str, "_models.Colors"]: """Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ async def get_not_expandable( :rtype: str or ~bodystring.models.Colors :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Union[str, "models.Colors"]] + cls = kwargs.pop('cls', None) # type: ClsType[Union[str, "_models.Colors"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -75,7 +75,7 @@ async def get_not_expandable( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('str', pipeline_response) @@ -89,7 +89,7 @@ async def get_not_expandable( @distributed_trace_async async def put_not_expandable( self, - string_body: Union[str, "models.Colors"], + string_body: Union[str, "_models.Colors"], **kwargs ) -> None: """Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. @@ -129,7 +129,7 @@ async def put_not_expandable( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -141,7 +141,7 @@ async def put_not_expandable( async def get_referenced( self, **kwargs - ) -> Union[str, "models.Colors"]: + ) -> Union[str, "_models.Colors"]: """Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. :keyword callable cls: A custom type or function that will be passed the direct response @@ -149,7 +149,7 @@ async def get_referenced( :rtype: str or ~bodystring.models.Colors :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Union[str, "models.Colors"]] + cls = kwargs.pop('cls', None) # type: ClsType[Union[str, "_models.Colors"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -172,7 +172,7 @@ async def get_referenced( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('str', pipeline_response) @@ -186,7 +186,7 @@ async def get_referenced( @distributed_trace_async async def put_referenced( self, - enum_string_body: Union[str, "models.Colors"], + enum_string_body: Union[str, "_models.Colors"], **kwargs ) -> None: """Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. @@ -226,7 +226,7 @@ async def put_referenced( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -238,7 +238,7 @@ async def put_referenced( async def get_referenced_constant( self, **kwargs - ) -> "models.RefColorConstant": + ) -> "_models.RefColorConstant": """Get value 'green-color' from the constant. :keyword callable cls: A custom type or function that will be passed the direct response @@ -246,7 +246,7 @@ async def get_referenced_constant( :rtype: ~bodystring.models.RefColorConstant :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RefColorConstant"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RefColorConstant"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -269,7 +269,7 @@ async def get_referenced_constant( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('RefColorConstant', pipeline_response) @@ -301,7 +301,7 @@ async def put_referenced_constant( } error_map.update(kwargs.pop('error_map', {})) - _enum_string_body = models.RefColorConstant(field1=field1) + _enum_string_body = _models.RefColorConstant(field1=field1) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -325,7 +325,7 @@ async def put_referenced_constant( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/BodyString/bodystring/aio/operations/_string_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyString/bodystring/aio/operations/_string_operations.py index f79b8888072..661acf6fc8e 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyString/bodystring/aio/operations/_string_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyString/bodystring/aio/operations/_string_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class StringOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -75,7 +75,7 @@ async def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('str', pipeline_response) @@ -132,7 +132,7 @@ async def put_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -175,7 +175,7 @@ async def get_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('str', pipeline_response) @@ -227,7 +227,7 @@ async def put_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -270,7 +270,7 @@ async def get_mbcs( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('str', pipeline_response) @@ -322,7 +322,7 @@ async def put_mbcs( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -367,7 +367,7 @@ async def get_whitespace( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('str', pipeline_response) @@ -421,7 +421,7 @@ async def put_whitespace( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -464,7 +464,7 @@ async def get_not_provided( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('str', pipeline_response) @@ -510,7 +510,7 @@ async def get_base64_encoded( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bytearray', pipeline_response) @@ -556,7 +556,7 @@ async def get_base64_url_encoded( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('base64', pipeline_response) @@ -610,7 +610,7 @@ async def put_base64_url_encoded( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -653,7 +653,7 @@ async def get_null_base64_url_encoded( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('base64', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyString/bodystring/operations/_enum_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyString/bodystring/operations/_enum_operations.py index 248c6d790f2..e82ddd736bf 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyString/bodystring/operations/_enum_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyString/bodystring/operations/_enum_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class EnumOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def get_not_expandable( self, **kwargs # type: Any ): - # type: (...) -> Union[str, "models.Colors"] + # type: (...) -> Union[str, "_models.Colors"] """Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def get_not_expandable( :rtype: str or ~bodystring.models.Colors :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Union[str, "models.Colors"]] + cls = kwargs.pop('cls', None) # type: ClsType[Union[str, "_models.Colors"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -80,7 +80,7 @@ def get_not_expandable( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('str', pipeline_response) @@ -94,7 +94,7 @@ def get_not_expandable( @distributed_trace def put_not_expandable( self, - string_body, # type: Union[str, "models.Colors"] + string_body, # type: Union[str, "_models.Colors"] **kwargs # type: Any ): # type: (...) -> None @@ -135,7 +135,7 @@ def put_not_expandable( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -148,7 +148,7 @@ def get_referenced( self, **kwargs # type: Any ): - # type: (...) -> Union[str, "models.Colors"] + # type: (...) -> Union[str, "_models.Colors"] """Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. :keyword callable cls: A custom type or function that will be passed the direct response @@ -156,7 +156,7 @@ def get_referenced( :rtype: str or ~bodystring.models.Colors :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Union[str, "models.Colors"]] + cls = kwargs.pop('cls', None) # type: ClsType[Union[str, "_models.Colors"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -179,7 +179,7 @@ def get_referenced( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('str', pipeline_response) @@ -193,7 +193,7 @@ def get_referenced( @distributed_trace def put_referenced( self, - enum_string_body, # type: Union[str, "models.Colors"] + enum_string_body, # type: Union[str, "_models.Colors"] **kwargs # type: Any ): # type: (...) -> None @@ -234,7 +234,7 @@ def put_referenced( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -247,7 +247,7 @@ def get_referenced_constant( self, **kwargs # type: Any ): - # type: (...) -> "models.RefColorConstant" + # type: (...) -> "_models.RefColorConstant" """Get value 'green-color' from the constant. :keyword callable cls: A custom type or function that will be passed the direct response @@ -255,7 +255,7 @@ def get_referenced_constant( :rtype: ~bodystring.models.RefColorConstant :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RefColorConstant"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RefColorConstant"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -278,7 +278,7 @@ def get_referenced_constant( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('RefColorConstant', pipeline_response) @@ -311,7 +311,7 @@ def put_referenced_constant( } error_map.update(kwargs.pop('error_map', {})) - _enum_string_body = models.RefColorConstant(field1=field1) + _enum_string_body = _models.RefColorConstant(field1=field1) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -335,7 +335,7 @@ def put_referenced_constant( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/BodyString/bodystring/operations/_string_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyString/bodystring/operations/_string_operations.py index 236d2c69754..0385f363bbd 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyString/bodystring/operations/_string_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyString/bodystring/operations/_string_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class StringOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -80,7 +80,7 @@ def get_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('str', pipeline_response) @@ -138,7 +138,7 @@ def put_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -182,7 +182,7 @@ def get_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('str', pipeline_response) @@ -235,7 +235,7 @@ def put_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -279,7 +279,7 @@ def get_mbcs( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('str', pipeline_response) @@ -332,7 +332,7 @@ def put_mbcs( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -378,7 +378,7 @@ def get_whitespace( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('str', pipeline_response) @@ -433,7 +433,7 @@ def put_whitespace( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -477,7 +477,7 @@ def get_not_provided( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('str', pipeline_response) @@ -524,7 +524,7 @@ def get_base64_encoded( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bytearray', pipeline_response) @@ -571,7 +571,7 @@ def get_base64_url_encoded( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('base64', pipeline_response) @@ -626,7 +626,7 @@ def put_base64_url_encoded( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -670,7 +670,7 @@ def get_null_base64_url_encoded( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('base64', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyTime/bodytime/aio/operations/_time_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyTime/bodytime/aio/operations/_time_operations.py index 9354795f82c..577aad1be4c 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyTime/bodytime/aio/operations/_time_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyTime/bodytime/aio/operations/_time_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class TimeOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -76,7 +76,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('time', pipeline_response) @@ -130,7 +130,7 @@ async def put( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('str', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyTime/bodytime/operations/_time_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyTime/bodytime/operations/_time_operations.py index 3dd24a11be5..7434041ace0 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyTime/bodytime/operations/_time_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyTime/bodytime/operations/_time_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class TimeOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -81,7 +81,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('time', pipeline_response) @@ -136,7 +136,7 @@ def put( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('str', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/Constants/constants/aio/operations/_contants_operations.py b/test/vanilla/Expected/AcceptanceTests/Constants/constants/aio/operations/_contants_operations.py index 9804ae67df3..244fe373761 100644 --- a/test/vanilla/Expected/AcceptanceTests/Constants/constants/aio/operations/_contants_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Constants/constants/aio/operations/_contants_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ContantsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def put_no_model_as_string_no_required_two_value_no_default( self, - input: Optional[Union[str, "models.NoModelAsStringNoRequiredTwoValueNoDefaultOpEnum"]] = None, + input: Optional[Union[str, "_models.NoModelAsStringNoRequiredTwoValueNoDefaultOpEnum"]] = None, **kwargs ) -> None: """Puts constants to the testserver. @@ -90,7 +90,7 @@ async def put_no_model_as_string_no_required_two_value_no_default( @distributed_trace_async async def put_no_model_as_string_no_required_two_value_default( self, - input: Optional[Union[str, "models.NoModelAsStringNoRequiredTwoValueDefaultOpEnum"]] = "value1", + input: Optional[Union[str, "_models.NoModelAsStringNoRequiredTwoValueDefaultOpEnum"]] = "value1", **kwargs ) -> None: """Puts constants to the testserver. @@ -231,7 +231,7 @@ async def put_no_model_as_string_no_required_one_value_default( @distributed_trace_async async def put_no_model_as_string_required_two_value_no_default( self, - input: Union[str, "models.NoModelAsStringRequiredTwoValueNoDefaultOpEnum"], + input: Union[str, "_models.NoModelAsStringRequiredTwoValueNoDefaultOpEnum"], **kwargs ) -> None: """Puts constants to the testserver. @@ -277,7 +277,7 @@ async def put_no_model_as_string_required_two_value_no_default( @distributed_trace_async async def put_no_model_as_string_required_two_value_default( self, - input: Union[str, "models.NoModelAsStringRequiredTwoValueDefaultOpEnum"] = "value1", + input: Union[str, "_models.NoModelAsStringRequiredTwoValueDefaultOpEnum"] = "value1", **kwargs ) -> None: """Puts constants to the testserver. @@ -411,7 +411,7 @@ async def put_no_model_as_string_required_one_value_default( @distributed_trace_async async def put_model_as_string_no_required_two_value_no_default( self, - input: Optional[Union[str, "models.ModelAsStringNoRequiredTwoValueNoDefaultOpEnum"]] = None, + input: Optional[Union[str, "_models.ModelAsStringNoRequiredTwoValueNoDefaultOpEnum"]] = None, **kwargs ) -> None: """Puts constants to the testserver. @@ -458,7 +458,7 @@ async def put_model_as_string_no_required_two_value_no_default( @distributed_trace_async async def put_model_as_string_no_required_two_value_default( self, - input: Optional[Union[str, "models.ModelAsStringNoRequiredTwoValueDefaultOpEnum"]] = "value1", + input: Optional[Union[str, "_models.ModelAsStringNoRequiredTwoValueDefaultOpEnum"]] = "value1", **kwargs ) -> None: """Puts constants to the testserver. @@ -505,7 +505,7 @@ async def put_model_as_string_no_required_two_value_default( @distributed_trace_async async def put_model_as_string_no_required_one_value_no_default( self, - input: Optional[Union[str, "models.ModelAsStringNoRequiredOneValueNoDefaultOpEnum"]] = None, + input: Optional[Union[str, "_models.ModelAsStringNoRequiredOneValueNoDefaultOpEnum"]] = None, **kwargs ) -> None: """Puts constants to the testserver. @@ -552,7 +552,7 @@ async def put_model_as_string_no_required_one_value_no_default( @distributed_trace_async async def put_model_as_string_no_required_one_value_default( self, - input: Optional[Union[str, "models.ModelAsStringNoRequiredOneValueDefaultOpEnum"]] = "value1", + input: Optional[Union[str, "_models.ModelAsStringNoRequiredOneValueDefaultOpEnum"]] = "value1", **kwargs ) -> None: """Puts constants to the testserver. @@ -599,7 +599,7 @@ async def put_model_as_string_no_required_one_value_default( @distributed_trace_async async def put_model_as_string_required_two_value_no_default( self, - input: Union[str, "models.ModelAsStringRequiredTwoValueNoDefaultOpEnum"], + input: Union[str, "_models.ModelAsStringRequiredTwoValueNoDefaultOpEnum"], **kwargs ) -> None: """Puts constants to the testserver. @@ -645,7 +645,7 @@ async def put_model_as_string_required_two_value_no_default( @distributed_trace_async async def put_model_as_string_required_two_value_default( self, - input: Union[str, "models.ModelAsStringRequiredTwoValueDefaultOpEnum"] = "value1", + input: Union[str, "_models.ModelAsStringRequiredTwoValueDefaultOpEnum"] = "value1", **kwargs ) -> None: """Puts constants to the testserver. @@ -691,7 +691,7 @@ async def put_model_as_string_required_two_value_default( @distributed_trace_async async def put_model_as_string_required_one_value_no_default( self, - input: Union[str, "models.ModelAsStringRequiredOneValueNoDefaultOpEnum"], + input: Union[str, "_models.ModelAsStringRequiredOneValueNoDefaultOpEnum"], **kwargs ) -> None: """Puts constants to the testserver. @@ -737,7 +737,7 @@ async def put_model_as_string_required_one_value_no_default( @distributed_trace_async async def put_model_as_string_required_one_value_default( self, - input: Union[str, "models.ModelAsStringRequiredOneValueDefaultOpEnum"] = "value1", + input: Union[str, "_models.ModelAsStringRequiredOneValueDefaultOpEnum"] = "value1", **kwargs ) -> None: """Puts constants to the testserver. diff --git a/test/vanilla/Expected/AcceptanceTests/Constants/constants/operations/_contants_operations.py b/test/vanilla/Expected/AcceptanceTests/Constants/constants/operations/_contants_operations.py index 76760830ce1..73b525bb55b 100644 --- a/test/vanilla/Expected/AcceptanceTests/Constants/constants/operations/_contants_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Constants/constants/operations/_contants_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ContantsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -47,7 +47,7 @@ def __init__(self, client, config, serializer, deserializer): @distributed_trace def put_no_model_as_string_no_required_two_value_no_default( self, - input=None, # type: Optional[Union[str, "models.NoModelAsStringNoRequiredTwoValueNoDefaultOpEnum"]] + input=None, # type: Optional[Union[str, "_models.NoModelAsStringNoRequiredTwoValueNoDefaultOpEnum"]] **kwargs # type: Any ): # type: (...) -> None @@ -95,7 +95,7 @@ def put_no_model_as_string_no_required_two_value_no_default( @distributed_trace def put_no_model_as_string_no_required_two_value_default( self, - input="value1", # type: Optional[Union[str, "models.NoModelAsStringNoRequiredTwoValueDefaultOpEnum"]] + input="value1", # type: Optional[Union[str, "_models.NoModelAsStringNoRequiredTwoValueDefaultOpEnum"]] **kwargs # type: Any ): # type: (...) -> None @@ -239,7 +239,7 @@ def put_no_model_as_string_no_required_one_value_default( @distributed_trace def put_no_model_as_string_required_two_value_no_default( self, - input, # type: Union[str, "models.NoModelAsStringRequiredTwoValueNoDefaultOpEnum"] + input, # type: Union[str, "_models.NoModelAsStringRequiredTwoValueNoDefaultOpEnum"] **kwargs # type: Any ): # type: (...) -> None @@ -286,7 +286,7 @@ def put_no_model_as_string_required_two_value_no_default( @distributed_trace def put_no_model_as_string_required_two_value_default( self, - input="value1", # type: Union[str, "models.NoModelAsStringRequiredTwoValueDefaultOpEnum"] + input="value1", # type: Union[str, "_models.NoModelAsStringRequiredTwoValueDefaultOpEnum"] **kwargs # type: Any ): # type: (...) -> None @@ -423,7 +423,7 @@ def put_no_model_as_string_required_one_value_default( @distributed_trace def put_model_as_string_no_required_two_value_no_default( self, - input=None, # type: Optional[Union[str, "models.ModelAsStringNoRequiredTwoValueNoDefaultOpEnum"]] + input=None, # type: Optional[Union[str, "_models.ModelAsStringNoRequiredTwoValueNoDefaultOpEnum"]] **kwargs # type: Any ): # type: (...) -> None @@ -471,7 +471,7 @@ def put_model_as_string_no_required_two_value_no_default( @distributed_trace def put_model_as_string_no_required_two_value_default( self, - input="value1", # type: Optional[Union[str, "models.ModelAsStringNoRequiredTwoValueDefaultOpEnum"]] + input="value1", # type: Optional[Union[str, "_models.ModelAsStringNoRequiredTwoValueDefaultOpEnum"]] **kwargs # type: Any ): # type: (...) -> None @@ -519,7 +519,7 @@ def put_model_as_string_no_required_two_value_default( @distributed_trace def put_model_as_string_no_required_one_value_no_default( self, - input=None, # type: Optional[Union[str, "models.ModelAsStringNoRequiredOneValueNoDefaultOpEnum"]] + input=None, # type: Optional[Union[str, "_models.ModelAsStringNoRequiredOneValueNoDefaultOpEnum"]] **kwargs # type: Any ): # type: (...) -> None @@ -567,7 +567,7 @@ def put_model_as_string_no_required_one_value_no_default( @distributed_trace def put_model_as_string_no_required_one_value_default( self, - input="value1", # type: Optional[Union[str, "models.ModelAsStringNoRequiredOneValueDefaultOpEnum"]] + input="value1", # type: Optional[Union[str, "_models.ModelAsStringNoRequiredOneValueDefaultOpEnum"]] **kwargs # type: Any ): # type: (...) -> None @@ -615,7 +615,7 @@ def put_model_as_string_no_required_one_value_default( @distributed_trace def put_model_as_string_required_two_value_no_default( self, - input, # type: Union[str, "models.ModelAsStringRequiredTwoValueNoDefaultOpEnum"] + input, # type: Union[str, "_models.ModelAsStringRequiredTwoValueNoDefaultOpEnum"] **kwargs # type: Any ): # type: (...) -> None @@ -662,7 +662,7 @@ def put_model_as_string_required_two_value_no_default( @distributed_trace def put_model_as_string_required_two_value_default( self, - input="value1", # type: Union[str, "models.ModelAsStringRequiredTwoValueDefaultOpEnum"] + input="value1", # type: Union[str, "_models.ModelAsStringRequiredTwoValueDefaultOpEnum"] **kwargs # type: Any ): # type: (...) -> None @@ -709,7 +709,7 @@ def put_model_as_string_required_two_value_default( @distributed_trace def put_model_as_string_required_one_value_no_default( self, - input, # type: Union[str, "models.ModelAsStringRequiredOneValueNoDefaultOpEnum"] + input, # type: Union[str, "_models.ModelAsStringRequiredOneValueNoDefaultOpEnum"] **kwargs # type: Any ): # type: (...) -> None @@ -756,7 +756,7 @@ def put_model_as_string_required_one_value_no_default( @distributed_trace def put_model_as_string_required_one_value_default( self, - input="value1", # type: Union[str, "models.ModelAsStringRequiredOneValueDefaultOpEnum"] + input="value1", # type: Union[str, "_models.ModelAsStringRequiredOneValueDefaultOpEnum"] **kwargs # type: Any ): # type: (...) -> None diff --git a/test/vanilla/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/aio/operations/_paths_operations.py b/test/vanilla/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/aio/operations/_paths_operations.py index bd5c555cd2e..af03a881114 100644 --- a/test/vanilla/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/aio/operations/_paths_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/aio/operations/_paths_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class PathsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -83,7 +83,7 @@ async def get_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/operations/_paths_operations.py b/test/vanilla/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/operations/_paths_operations.py index bf19d5d7cb8..0126f0f8310 100644 --- a/test/vanilla/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/operations/_paths_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/operations/_paths_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class PathsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -88,7 +88,7 @@ def get_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/CustomBaseUriMoreOptions/custombaseurlmoreoptions/aio/operations/_paths_operations.py b/test/vanilla/Expected/AcceptanceTests/CustomBaseUriMoreOptions/custombaseurlmoreoptions/aio/operations/_paths_operations.py index 40e85251ffd..58c627fd96f 100644 --- a/test/vanilla/Expected/AcceptanceTests/CustomBaseUriMoreOptions/custombaseurlmoreoptions/aio/operations/_paths_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/CustomBaseUriMoreOptions/custombaseurlmoreoptions/aio/operations/_paths_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class PathsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -97,7 +97,7 @@ async def get_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/CustomBaseUriMoreOptions/custombaseurlmoreoptions/operations/_paths_operations.py b/test/vanilla/Expected/AcceptanceTests/CustomBaseUriMoreOptions/custombaseurlmoreoptions/operations/_paths_operations.py index f4bebf7b38f..2b7292465bf 100644 --- a/test/vanilla/Expected/AcceptanceTests/CustomBaseUriMoreOptions/custombaseurlmoreoptions/operations/_paths_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/CustomBaseUriMoreOptions/custombaseurlmoreoptions/operations/_paths_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class PathsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -102,7 +102,7 @@ def get_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/ExtensibleEnums/extensibleenumsswagger/aio/operations/_pet_operations.py b/test/vanilla/Expected/AcceptanceTests/ExtensibleEnums/extensibleenumsswagger/aio/operations/_pet_operations.py index dc21a6b9534..c2bcf9e95e6 100644 --- a/test/vanilla/Expected/AcceptanceTests/ExtensibleEnums/extensibleenumsswagger/aio/operations/_pet_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/ExtensibleEnums/extensibleenumsswagger/aio/operations/_pet_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class PetOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ async def get_by_pet_id( self, pet_id: str, **kwargs - ) -> "models.Pet": + ) -> "_models.Pet": """get pet by id. :param pet_id: Pet id. @@ -55,7 +55,7 @@ async def get_by_pet_id( :rtype: ~extensibleenumsswagger.models.Pet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Pet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Pet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,9 +95,9 @@ async def get_by_pet_id( @distributed_trace_async async def add_pet( self, - pet_param: Optional["models.Pet"] = None, + pet_param: Optional["_models.Pet"] = None, **kwargs - ) -> "models.Pet": + ) -> "_models.Pet": """add pet. :param pet_param: pet param. @@ -107,7 +107,7 @@ async def add_pet( :rtype: ~extensibleenumsswagger.models.Pet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Pet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Pet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/vanilla/Expected/AcceptanceTests/ExtensibleEnums/extensibleenumsswagger/operations/_pet_operations.py b/test/vanilla/Expected/AcceptanceTests/ExtensibleEnums/extensibleenumsswagger/operations/_pet_operations.py index a05f1856eca..dfd5d1855e6 100644 --- a/test/vanilla/Expected/AcceptanceTests/ExtensibleEnums/extensibleenumsswagger/operations/_pet_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/ExtensibleEnums/extensibleenumsswagger/operations/_pet_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class PetOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def get_by_pet_id( pet_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Pet" + # type: (...) -> "_models.Pet" """get pet by id. :param pet_id: Pet id. @@ -60,7 +60,7 @@ def get_by_pet_id( :rtype: ~extensibleenumsswagger.models.Pet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Pet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Pet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,10 +100,10 @@ def get_by_pet_id( @distributed_trace def add_pet( self, - pet_param=None, # type: Optional["models.Pet"] + pet_param=None, # type: Optional["_models.Pet"] **kwargs # type: Any ): - # type: (...) -> "models.Pet" + # type: (...) -> "_models.Pet" """add pet. :param pet_param: pet param. @@ -113,7 +113,7 @@ def add_pet( :rtype: ~extensibleenumsswagger.models.Pet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Pet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Pet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/vanilla/Expected/AcceptanceTests/Header/header/aio/operations/_header_operations.py b/test/vanilla/Expected/AcceptanceTests/Header/header/aio/operations/_header_operations.py index ceb0fd82eb8..0d4cf94c294 100644 --- a/test/vanilla/Expected/AcceptanceTests/Header/header/aio/operations/_header_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Header/header/aio/operations/_header_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class HeaderOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def param_existing_key( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -123,7 +123,7 @@ async def response_existing_key( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -173,7 +173,7 @@ async def param_protected_key( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -216,7 +216,7 @@ async def response_protected_key( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -271,7 +271,7 @@ async def param_integer( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -318,7 +318,7 @@ async def response_integer( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -373,7 +373,7 @@ async def param_long( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -420,7 +420,7 @@ async def response_long( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -475,7 +475,7 @@ async def param_float( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -522,7 +522,7 @@ async def response_float( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -577,7 +577,7 @@ async def param_double( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -624,7 +624,7 @@ async def response_double( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -679,7 +679,7 @@ async def param_bool( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -726,7 +726,7 @@ async def response_bool( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -784,7 +784,7 @@ async def param_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -832,7 +832,7 @@ async def response_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -887,7 +887,7 @@ async def param_date( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -934,7 +934,7 @@ async def response_date( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -990,7 +990,7 @@ async def param_datetime( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1037,7 +1037,7 @@ async def response_datetime( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -1094,7 +1094,7 @@ async def param_datetime_rfc1123( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1142,7 +1142,7 @@ async def response_datetime_rfc1123( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -1196,7 +1196,7 @@ async def param_duration( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1243,7 +1243,7 @@ async def response_duration( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -1297,7 +1297,7 @@ async def param_byte( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1344,7 +1344,7 @@ async def response_byte( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -1359,7 +1359,7 @@ async def response_byte( async def param_enum( self, scenario: str, - value: Optional[Union[str, "models.GreyscaleColors"]] = None, + value: Optional[Union[str, "_models.GreyscaleColors"]] = None, **kwargs ) -> None: """Send a post request with header values "scenario": "valid", "value": "GREY" or "scenario": @@ -1401,7 +1401,7 @@ async def param_enum( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1449,7 +1449,7 @@ async def response_enum( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -1496,7 +1496,7 @@ async def custom_request_id( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/Header/header/operations/_header_operations.py b/test/vanilla/Expected/AcceptanceTests/Header/header/operations/_header_operations.py index 118d5aff2e3..19b4e975a59 100644 --- a/test/vanilla/Expected/AcceptanceTests/Header/header/operations/_header_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Header/header/operations/_header_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class HeaderOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def param_existing_key( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -129,7 +129,7 @@ def response_existing_key( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -180,7 +180,7 @@ def param_protected_key( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -224,7 +224,7 @@ def response_protected_key( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -280,7 +280,7 @@ def param_integer( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -328,7 +328,7 @@ def response_integer( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -384,7 +384,7 @@ def param_long( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -432,7 +432,7 @@ def response_long( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -488,7 +488,7 @@ def param_float( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -536,7 +536,7 @@ def response_float( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -592,7 +592,7 @@ def param_double( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -640,7 +640,7 @@ def response_double( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -696,7 +696,7 @@ def param_bool( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -744,7 +744,7 @@ def response_bool( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -803,7 +803,7 @@ def param_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -852,7 +852,7 @@ def response_string( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -908,7 +908,7 @@ def param_date( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -956,7 +956,7 @@ def response_date( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -1013,7 +1013,7 @@ def param_datetime( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1061,7 +1061,7 @@ def response_datetime( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -1119,7 +1119,7 @@ def param_datetime_rfc1123( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1168,7 +1168,7 @@ def response_datetime_rfc1123( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -1223,7 +1223,7 @@ def param_duration( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1271,7 +1271,7 @@ def response_duration( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -1326,7 +1326,7 @@ def param_byte( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1374,7 +1374,7 @@ def response_byte( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -1389,7 +1389,7 @@ def response_byte( def param_enum( self, scenario, # type: str - value=None, # type: Optional[Union[str, "models.GreyscaleColors"]] + value=None, # type: Optional[Union[str, "_models.GreyscaleColors"]] **kwargs # type: Any ): # type: (...) -> None @@ -1432,7 +1432,7 @@ def param_enum( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1481,7 +1481,7 @@ def response_enum( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -1529,7 +1529,7 @@ def custom_request_id( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_client_failure_operations.py b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_client_failure_operations.py index fe4f0f46554..0205bb7296d 100644 --- a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_client_failure_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_client_failure_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class HttpClientFailureOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -75,7 +75,7 @@ async def head400( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -118,7 +118,7 @@ async def get400( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -161,7 +161,7 @@ async def options400( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -215,7 +215,7 @@ async def put400( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -269,7 +269,7 @@ async def patch400( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -323,7 +323,7 @@ async def post400( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -377,7 +377,7 @@ async def delete400( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -420,7 +420,7 @@ async def head401( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -463,7 +463,7 @@ async def get402( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -506,7 +506,7 @@ async def options403( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -549,7 +549,7 @@ async def get403( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -603,7 +603,7 @@ async def put404( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -657,7 +657,7 @@ async def patch405( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -711,7 +711,7 @@ async def post406( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -765,7 +765,7 @@ async def delete407( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -819,7 +819,7 @@ async def put409( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -862,7 +862,7 @@ async def head410( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -905,7 +905,7 @@ async def get411( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -948,7 +948,7 @@ async def options412( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -991,7 +991,7 @@ async def get412( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1045,7 +1045,7 @@ async def put413( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1099,7 +1099,7 @@ async def patch414( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1153,7 +1153,7 @@ async def post415( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1196,7 +1196,7 @@ async def get416( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1250,7 +1250,7 @@ async def delete417( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1293,7 +1293,7 @@ async def head429( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_failure_operations.py b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_failure_operations.py index e667b7c878e..32443c96bba 100644 --- a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_failure_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_failure_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class HttpFailureOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -75,7 +75,7 @@ async def get_empty_error( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bool', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_redirects_operations.py b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_redirects_operations.py index 6b6d0a2b9e1..49c9462dca4 100644 --- a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_redirects_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_redirects_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class HttpRedirectsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -75,7 +75,7 @@ async def head300( if response.status_code not in [200, 300]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -122,7 +122,7 @@ async def get300( if response.status_code not in [200, 300]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -172,7 +172,7 @@ async def head301( if response.status_code not in [200, 301]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -219,7 +219,7 @@ async def get301( if response.status_code not in [200, 301]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -278,7 +278,7 @@ async def put301( if response.status_code not in [301]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -324,7 +324,7 @@ async def head302( if response.status_code not in [200, 302]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -371,7 +371,7 @@ async def get302( if response.status_code not in [200, 302]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -430,7 +430,7 @@ async def patch302( if response.status_code not in [302]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -488,7 +488,7 @@ async def post303( if response.status_code not in [200, 303]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -535,7 +535,7 @@ async def head307( if response.status_code not in [200, 307]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -582,7 +582,7 @@ async def get307( if response.status_code not in [200, 307]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -629,7 +629,7 @@ async def options307( if response.status_code not in [200, 307]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -687,7 +687,7 @@ async def put307( if response.status_code not in [200, 307]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -745,7 +745,7 @@ async def patch307( if response.status_code not in [200, 307]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -803,7 +803,7 @@ async def post307( if response.status_code not in [200, 307]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -861,7 +861,7 @@ async def delete307( if response.status_code not in [200, 307]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} diff --git a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_retry_operations.py b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_retry_operations.py index bb45cb44e4c..874729a75b2 100644 --- a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_retry_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_retry_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class HttpRetryOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -75,7 +75,7 @@ async def head408( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -129,7 +129,7 @@ async def put500( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -183,7 +183,7 @@ async def patch500( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -226,7 +226,7 @@ async def get502( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -269,7 +269,7 @@ async def options502( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bool', pipeline_response) @@ -326,7 +326,7 @@ async def post503( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -380,7 +380,7 @@ async def delete503( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -434,7 +434,7 @@ async def put504( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -488,7 +488,7 @@ async def patch504( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_server_failure_operations.py b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_server_failure_operations.py index 2b0246bd08d..dbe324336d0 100644 --- a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_server_failure_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_server_failure_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class HttpServerFailureOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -75,7 +75,7 @@ async def head501( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -118,7 +118,7 @@ async def get501( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -172,7 +172,7 @@ async def post505( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -226,7 +226,7 @@ async def delete505( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_success_operations.py b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_success_operations.py index 7be6579d8e5..5f65fe51032 100644 --- a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_success_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_success_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class HttpSuccessOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -75,7 +75,7 @@ async def head200( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -118,7 +118,7 @@ async def get200( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bool', pipeline_response) @@ -164,7 +164,7 @@ async def options200( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bool', pipeline_response) @@ -221,7 +221,7 @@ async def put200( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -275,7 +275,7 @@ async def patch200( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -329,7 +329,7 @@ async def post200( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -383,7 +383,7 @@ async def delete200( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -437,7 +437,7 @@ async def put201( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -491,7 +491,7 @@ async def post201( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -545,7 +545,7 @@ async def put202( if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -599,7 +599,7 @@ async def patch202( if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -653,7 +653,7 @@ async def post202( if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -707,7 +707,7 @@ async def delete202( if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -750,7 +750,7 @@ async def head204( if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -804,7 +804,7 @@ async def put204( if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -858,7 +858,7 @@ async def patch204( if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -912,7 +912,7 @@ async def post204( if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -966,7 +966,7 @@ async def delete204( if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1009,7 +1009,7 @@ async def head404( if response.status_code not in [204, 404]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_multiple_responses_operations.py b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_multiple_responses_operations.py index db8c5e0e44d..450f99e963a 100644 --- a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_multiple_responses_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_multiple_responses_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class MultipleResponsesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def get200_model204_no_model_default_error200_valid( self, **kwargs - ) -> Optional["models.MyException"]: + ) -> Optional["_models.MyException"]: """Send a 200 response with valid payload: {'statusCode': '200'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ async def get200_model204_no_model_default_error200_valid( :rtype: ~httpinfrastructure.models.MyException or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.MyException"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MyException"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -75,7 +75,7 @@ async def get200_model204_no_model_default_error200_valid( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = None @@ -92,7 +92,7 @@ async def get200_model204_no_model_default_error200_valid( async def get200_model204_no_model_default_error204_valid( self, **kwargs - ) -> Optional["models.MyException"]: + ) -> Optional["_models.MyException"]: """Send a 204 response with no payload. :keyword callable cls: A custom type or function that will be passed the direct response @@ -100,7 +100,7 @@ async def get200_model204_no_model_default_error204_valid( :rtype: ~httpinfrastructure.models.MyException or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.MyException"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MyException"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -123,7 +123,7 @@ async def get200_model204_no_model_default_error204_valid( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = None @@ -140,7 +140,7 @@ async def get200_model204_no_model_default_error204_valid( async def get200_model204_no_model_default_error201_invalid( self, **kwargs - ) -> Optional["models.MyException"]: + ) -> Optional["_models.MyException"]: """Send a 201 response with valid payload: {'statusCode': '201'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -148,7 +148,7 @@ async def get200_model204_no_model_default_error201_invalid( :rtype: ~httpinfrastructure.models.MyException or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.MyException"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MyException"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -171,7 +171,7 @@ async def get200_model204_no_model_default_error201_invalid( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = None @@ -188,7 +188,7 @@ async def get200_model204_no_model_default_error201_invalid( async def get200_model204_no_model_default_error202_none( self, **kwargs - ) -> Optional["models.MyException"]: + ) -> Optional["_models.MyException"]: """Send a 202 response with no payload:. :keyword callable cls: A custom type or function that will be passed the direct response @@ -196,7 +196,7 @@ async def get200_model204_no_model_default_error202_none( :rtype: ~httpinfrastructure.models.MyException or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.MyException"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MyException"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,7 +219,7 @@ async def get200_model204_no_model_default_error202_none( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = None @@ -236,7 +236,7 @@ async def get200_model204_no_model_default_error202_none( async def get200_model204_no_model_default_error400_valid( self, **kwargs - ) -> Optional["models.MyException"]: + ) -> Optional["_models.MyException"]: """Send a 400 response with valid error payload: {'status': 400, 'message': 'client error'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -244,7 +244,7 @@ async def get200_model204_no_model_default_error400_valid( :rtype: ~httpinfrastructure.models.MyException or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.MyException"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MyException"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,7 +267,7 @@ async def get200_model204_no_model_default_error400_valid( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = None @@ -284,7 +284,7 @@ async def get200_model204_no_model_default_error400_valid( async def get200_model201_model_default_error200_valid( self, **kwargs - ) -> Union["models.MyException", "models.B"]: + ) -> Union["_models.MyException", "_models.B"]: """Send a 200 response with valid payload: {'statusCode': '200'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -292,7 +292,7 @@ async def get200_model201_model_default_error200_valid( :rtype: ~httpinfrastructure.models.MyException or ~httpinfrastructure.models.B :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Union["models.MyException", "models.B"]] + cls = kwargs.pop('cls', None) # type: ClsType[Union["_models.MyException", "_models.B"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -315,7 +315,7 @@ async def get200_model201_model_default_error200_valid( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if response.status_code == 200: @@ -334,7 +334,7 @@ async def get200_model201_model_default_error200_valid( async def get200_model201_model_default_error201_valid( self, **kwargs - ) -> Union["models.MyException", "models.B"]: + ) -> Union["_models.MyException", "_models.B"]: """Send a 201 response with valid payload: {'statusCode': '201', 'textStatusCode': 'Created'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -342,7 +342,7 @@ async def get200_model201_model_default_error201_valid( :rtype: ~httpinfrastructure.models.MyException or ~httpinfrastructure.models.B :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Union["models.MyException", "models.B"]] + cls = kwargs.pop('cls', None) # type: ClsType[Union["_models.MyException", "_models.B"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -365,7 +365,7 @@ async def get200_model201_model_default_error201_valid( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if response.status_code == 200: @@ -384,7 +384,7 @@ async def get200_model201_model_default_error201_valid( async def get200_model201_model_default_error400_valid( self, **kwargs - ) -> Union["models.MyException", "models.B"]: + ) -> Union["_models.MyException", "_models.B"]: """Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -392,7 +392,7 @@ async def get200_model201_model_default_error400_valid( :rtype: ~httpinfrastructure.models.MyException or ~httpinfrastructure.models.B :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Union["models.MyException", "models.B"]] + cls = kwargs.pop('cls', None) # type: ClsType[Union["_models.MyException", "_models.B"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -415,7 +415,7 @@ async def get200_model201_model_default_error400_valid( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if response.status_code == 200: @@ -434,7 +434,7 @@ async def get200_model201_model_default_error400_valid( async def get200_model_a201_model_c404_model_d_default_error200_valid( self, **kwargs - ) -> Union["models.MyException", "models.C", "models.D"]: + ) -> Union["_models.MyException", "_models.C", "_models.D"]: """Send a 200 response with valid payload: {'statusCode': '200'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -442,7 +442,7 @@ async def get200_model_a201_model_c404_model_d_default_error200_valid( :rtype: ~httpinfrastructure.models.MyException or ~httpinfrastructure.models.C or ~httpinfrastructure.models.D :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Union["models.MyException", "models.C", "models.D"]] + cls = kwargs.pop('cls', None) # type: ClsType[Union["_models.MyException", "_models.C", "_models.D"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -465,7 +465,7 @@ async def get200_model_a201_model_c404_model_d_default_error200_valid( if response.status_code not in [200, 201, 404]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if response.status_code == 200: @@ -487,7 +487,7 @@ async def get200_model_a201_model_c404_model_d_default_error200_valid( async def get200_model_a201_model_c404_model_d_default_error201_valid( self, **kwargs - ) -> Union["models.MyException", "models.C", "models.D"]: + ) -> Union["_models.MyException", "_models.C", "_models.D"]: """Send a 200 response with valid payload: {'httpCode': '201'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -495,7 +495,7 @@ async def get200_model_a201_model_c404_model_d_default_error201_valid( :rtype: ~httpinfrastructure.models.MyException or ~httpinfrastructure.models.C or ~httpinfrastructure.models.D :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Union["models.MyException", "models.C", "models.D"]] + cls = kwargs.pop('cls', None) # type: ClsType[Union["_models.MyException", "_models.C", "_models.D"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -518,7 +518,7 @@ async def get200_model_a201_model_c404_model_d_default_error201_valid( if response.status_code not in [200, 201, 404]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if response.status_code == 200: @@ -540,7 +540,7 @@ async def get200_model_a201_model_c404_model_d_default_error201_valid( async def get200_model_a201_model_c404_model_d_default_error404_valid( self, **kwargs - ) -> Union["models.MyException", "models.C", "models.D"]: + ) -> Union["_models.MyException", "_models.C", "_models.D"]: """Send a 200 response with valid payload: {'httpStatusCode': '404'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -548,7 +548,7 @@ async def get200_model_a201_model_c404_model_d_default_error404_valid( :rtype: ~httpinfrastructure.models.MyException or ~httpinfrastructure.models.C or ~httpinfrastructure.models.D :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Union["models.MyException", "models.C", "models.D"]] + cls = kwargs.pop('cls', None) # type: ClsType[Union["_models.MyException", "_models.C", "_models.D"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -571,7 +571,7 @@ async def get200_model_a201_model_c404_model_d_default_error404_valid( if response.status_code not in [200, 201, 404]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if response.status_code == 200: @@ -593,7 +593,7 @@ async def get200_model_a201_model_c404_model_d_default_error404_valid( async def get200_model_a201_model_c404_model_d_default_error400_valid( self, **kwargs - ) -> Union["models.MyException", "models.C", "models.D"]: + ) -> Union["_models.MyException", "_models.C", "_models.D"]: """Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -601,7 +601,7 @@ async def get200_model_a201_model_c404_model_d_default_error400_valid( :rtype: ~httpinfrastructure.models.MyException or ~httpinfrastructure.models.C or ~httpinfrastructure.models.D :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Union["models.MyException", "models.C", "models.D"]] + cls = kwargs.pop('cls', None) # type: ClsType[Union["_models.MyException", "_models.C", "_models.D"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -624,7 +624,7 @@ async def get200_model_a201_model_c404_model_d_default_error400_valid( if response.status_code not in [200, 201, 404]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if response.status_code == 200: @@ -677,7 +677,7 @@ async def get202_none204_none_default_error202_none( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -720,7 +720,7 @@ async def get202_none204_none_default_error204_none( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -763,7 +763,7 @@ async def get202_none204_none_default_error400_valid( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -935,7 +935,7 @@ async def get202_none204_none_default_none400_invalid( async def get_default_model_a200_valid( self, **kwargs - ) -> "models.MyException": + ) -> "_models.MyException": """Send a 200 response with valid payload: {'statusCode': '200'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -943,7 +943,7 @@ async def get_default_model_a200_valid( :rtype: ~httpinfrastructure.models.MyException :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MyException"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyException"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -980,7 +980,7 @@ async def get_default_model_a200_valid( async def get_default_model_a200_none( self, **kwargs - ) -> "models.MyException": + ) -> "_models.MyException": """Send a 200 response with no payload. :keyword callable cls: A custom type or function that will be passed the direct response @@ -988,7 +988,7 @@ async def get_default_model_a200_none( :rtype: ~httpinfrastructure.models.MyException :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MyException"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyException"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1056,7 +1056,7 @@ async def get_default_model_a400_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.MyException, response) + error = self._deserialize(_models.MyException, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1099,7 +1099,7 @@ async def get_default_model_a400_none( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.MyException, response) + error = self._deserialize(_models.MyException, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1271,7 +1271,7 @@ async def get_default_none400_none( async def get200_model_a200_none( self, **kwargs - ) -> "models.MyException": + ) -> "_models.MyException": """Send a 200 response with no payload, when a payload is expected - client should return a null object of thde type for model A. @@ -1280,7 +1280,7 @@ async def get200_model_a200_none( :rtype: ~httpinfrastructure.models.MyException :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MyException"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyException"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1317,7 +1317,7 @@ async def get200_model_a200_none( async def get200_model_a200_valid( self, **kwargs - ) -> "models.MyException": + ) -> "_models.MyException": """Send a 200 response with payload {'statusCode': '200'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1325,7 +1325,7 @@ async def get200_model_a200_valid( :rtype: ~httpinfrastructure.models.MyException :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MyException"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyException"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1362,7 +1362,7 @@ async def get200_model_a200_valid( async def get200_model_a200_invalid( self, **kwargs - ) -> "models.MyException": + ) -> "_models.MyException": """Send a 200 response with invalid payload {'statusCodeInvalid': '200'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1370,7 +1370,7 @@ async def get200_model_a200_invalid( :rtype: ~httpinfrastructure.models.MyException :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MyException"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyException"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1407,7 +1407,7 @@ async def get200_model_a200_invalid( async def get200_model_a400_none( self, **kwargs - ) -> "models.MyException": + ) -> "_models.MyException": """Send a 400 response with no payload client should treat as an http error with no error model. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1415,7 +1415,7 @@ async def get200_model_a400_none( :rtype: ~httpinfrastructure.models.MyException :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MyException"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyException"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1452,7 +1452,7 @@ async def get200_model_a400_none( async def get200_model_a400_valid( self, **kwargs - ) -> "models.MyException": + ) -> "_models.MyException": """Send a 200 response with payload {'statusCode': '400'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1460,7 +1460,7 @@ async def get200_model_a400_valid( :rtype: ~httpinfrastructure.models.MyException :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MyException"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyException"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1497,7 +1497,7 @@ async def get200_model_a400_valid( async def get200_model_a400_invalid( self, **kwargs - ) -> "models.MyException": + ) -> "_models.MyException": """Send a 200 response with invalid payload {'statusCodeInvalid': '400'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1505,7 +1505,7 @@ async def get200_model_a400_invalid( :rtype: ~httpinfrastructure.models.MyException :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MyException"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyException"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1542,7 +1542,7 @@ async def get200_model_a400_invalid( async def get200_model_a202_valid( self, **kwargs - ) -> "models.MyException": + ) -> "_models.MyException": """Send a 202 response with payload {'statusCode': '202'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1550,7 +1550,7 @@ async def get200_model_a202_valid( :rtype: ~httpinfrastructure.models.MyException :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MyException"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyException"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_client_failure_operations.py b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_client_failure_operations.py index b6660247fab..86e7840e93e 100644 --- a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_client_failure_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_client_failure_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class HttpClientFailureOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -80,7 +80,7 @@ def head400( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -124,7 +124,7 @@ def get400( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -168,7 +168,7 @@ def options400( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -223,7 +223,7 @@ def put400( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -278,7 +278,7 @@ def patch400( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -333,7 +333,7 @@ def post400( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -388,7 +388,7 @@ def delete400( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -432,7 +432,7 @@ def head401( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -476,7 +476,7 @@ def get402( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -520,7 +520,7 @@ def options403( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -564,7 +564,7 @@ def get403( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -619,7 +619,7 @@ def put404( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -674,7 +674,7 @@ def patch405( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -729,7 +729,7 @@ def post406( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -784,7 +784,7 @@ def delete407( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -839,7 +839,7 @@ def put409( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -883,7 +883,7 @@ def head410( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -927,7 +927,7 @@ def get411( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -971,7 +971,7 @@ def options412( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1015,7 +1015,7 @@ def get412( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1070,7 +1070,7 @@ def put413( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1125,7 +1125,7 @@ def patch414( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1180,7 +1180,7 @@ def post415( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1224,7 +1224,7 @@ def get416( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1279,7 +1279,7 @@ def delete417( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1323,7 +1323,7 @@ def head429( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_failure_operations.py b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_failure_operations.py index a641ae028fb..34fbdf80ac0 100644 --- a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_failure_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_failure_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class HttpFailureOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -80,7 +80,7 @@ def get_empty_error( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bool', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_redirects_operations.py b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_redirects_operations.py index 54f020cdae3..0e6f1355cec 100644 --- a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_redirects_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_redirects_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class HttpRedirectsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -80,7 +80,7 @@ def head300( if response.status_code not in [200, 300]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -128,7 +128,7 @@ def get300( if response.status_code not in [200, 300]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -179,7 +179,7 @@ def head301( if response.status_code not in [200, 301]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -227,7 +227,7 @@ def get301( if response.status_code not in [200, 301]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -287,7 +287,7 @@ def put301( if response.status_code not in [301]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -334,7 +334,7 @@ def head302( if response.status_code not in [200, 302]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -382,7 +382,7 @@ def get302( if response.status_code not in [200, 302]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -442,7 +442,7 @@ def patch302( if response.status_code not in [302]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -501,7 +501,7 @@ def post303( if response.status_code not in [200, 303]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -549,7 +549,7 @@ def head307( if response.status_code not in [200, 307]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -597,7 +597,7 @@ def get307( if response.status_code not in [200, 307]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -645,7 +645,7 @@ def options307( if response.status_code not in [200, 307]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -704,7 +704,7 @@ def put307( if response.status_code not in [200, 307]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -763,7 +763,7 @@ def patch307( if response.status_code not in [200, 307]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -822,7 +822,7 @@ def post307( if response.status_code not in [200, 307]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} @@ -881,7 +881,7 @@ def delete307( if response.status_code not in [200, 307]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) response_headers = {} diff --git a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_retry_operations.py b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_retry_operations.py index 7a5c5335478..ee13da91dec 100644 --- a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_retry_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_retry_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class HttpRetryOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -80,7 +80,7 @@ def head408( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -135,7 +135,7 @@ def put500( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -190,7 +190,7 @@ def patch500( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -234,7 +234,7 @@ def get502( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -278,7 +278,7 @@ def options502( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bool', pipeline_response) @@ -336,7 +336,7 @@ def post503( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -391,7 +391,7 @@ def delete503( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -446,7 +446,7 @@ def put504( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -501,7 +501,7 @@ def patch504( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_server_failure_operations.py b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_server_failure_operations.py index b3709985d89..e2ba61c2bd3 100644 --- a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_server_failure_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_server_failure_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class HttpServerFailureOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -80,7 +80,7 @@ def head501( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -124,7 +124,7 @@ def get501( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -179,7 +179,7 @@ def post505( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -234,7 +234,7 @@ def delete505( if response.status_code not in []: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_success_operations.py b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_success_operations.py index 23cab5d3f9e..452384f30c2 100644 --- a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_success_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_success_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class HttpSuccessOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -80,7 +80,7 @@ def head200( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -124,7 +124,7 @@ def get200( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bool', pipeline_response) @@ -171,7 +171,7 @@ def options200( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('bool', pipeline_response) @@ -229,7 +229,7 @@ def put200( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -284,7 +284,7 @@ def patch200( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -339,7 +339,7 @@ def post200( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -394,7 +394,7 @@ def delete200( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -449,7 +449,7 @@ def put201( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -504,7 +504,7 @@ def post201( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -559,7 +559,7 @@ def put202( if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -614,7 +614,7 @@ def patch202( if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -669,7 +669,7 @@ def post202( if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -724,7 +724,7 @@ def delete202( if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -768,7 +768,7 @@ def head204( if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -823,7 +823,7 @@ def put204( if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -878,7 +878,7 @@ def patch204( if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -933,7 +933,7 @@ def post204( if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -988,7 +988,7 @@ def delete204( if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1032,7 +1032,7 @@ def head404( if response.status_code not in [204, 404]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_multiple_responses_operations.py b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_multiple_responses_operations.py index 16894836c99..cbe17d8f14f 100644 --- a/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_multiple_responses_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_multiple_responses_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class MultipleResponsesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def get200_model204_no_model_default_error200_valid( self, **kwargs # type: Any ): - # type: (...) -> Optional["models.MyException"] + # type: (...) -> Optional["_models.MyException"] """Send a 200 response with valid payload: {'statusCode': '200'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def get200_model204_no_model_default_error200_valid( :rtype: ~httpinfrastructure.models.MyException or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.MyException"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MyException"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -80,7 +80,7 @@ def get200_model204_no_model_default_error200_valid( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = None @@ -98,7 +98,7 @@ def get200_model204_no_model_default_error204_valid( self, **kwargs # type: Any ): - # type: (...) -> Optional["models.MyException"] + # type: (...) -> Optional["_models.MyException"] """Send a 204 response with no payload. :keyword callable cls: A custom type or function that will be passed the direct response @@ -106,7 +106,7 @@ def get200_model204_no_model_default_error204_valid( :rtype: ~httpinfrastructure.models.MyException or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.MyException"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MyException"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -129,7 +129,7 @@ def get200_model204_no_model_default_error204_valid( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = None @@ -147,7 +147,7 @@ def get200_model204_no_model_default_error201_invalid( self, **kwargs # type: Any ): - # type: (...) -> Optional["models.MyException"] + # type: (...) -> Optional["_models.MyException"] """Send a 201 response with valid payload: {'statusCode': '201'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -155,7 +155,7 @@ def get200_model204_no_model_default_error201_invalid( :rtype: ~httpinfrastructure.models.MyException or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.MyException"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MyException"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -178,7 +178,7 @@ def get200_model204_no_model_default_error201_invalid( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = None @@ -196,7 +196,7 @@ def get200_model204_no_model_default_error202_none( self, **kwargs # type: Any ): - # type: (...) -> Optional["models.MyException"] + # type: (...) -> Optional["_models.MyException"] """Send a 202 response with no payload:. :keyword callable cls: A custom type or function that will be passed the direct response @@ -204,7 +204,7 @@ def get200_model204_no_model_default_error202_none( :rtype: ~httpinfrastructure.models.MyException or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.MyException"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MyException"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +227,7 @@ def get200_model204_no_model_default_error202_none( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = None @@ -245,7 +245,7 @@ def get200_model204_no_model_default_error400_valid( self, **kwargs # type: Any ): - # type: (...) -> Optional["models.MyException"] + # type: (...) -> Optional["_models.MyException"] """Send a 400 response with valid error payload: {'status': 400, 'message': 'client error'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -253,7 +253,7 @@ def get200_model204_no_model_default_error400_valid( :rtype: ~httpinfrastructure.models.MyException or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.MyException"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MyException"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -276,7 +276,7 @@ def get200_model204_no_model_default_error400_valid( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = None @@ -294,7 +294,7 @@ def get200_model201_model_default_error200_valid( self, **kwargs # type: Any ): - # type: (...) -> Union["models.MyException", "models.B"] + # type: (...) -> Union["_models.MyException", "_models.B"] """Send a 200 response with valid payload: {'statusCode': '200'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -302,7 +302,7 @@ def get200_model201_model_default_error200_valid( :rtype: ~httpinfrastructure.models.MyException or ~httpinfrastructure.models.B :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Union["models.MyException", "models.B"]] + cls = kwargs.pop('cls', None) # type: ClsType[Union["_models.MyException", "_models.B"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -325,7 +325,7 @@ def get200_model201_model_default_error200_valid( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if response.status_code == 200: @@ -345,7 +345,7 @@ def get200_model201_model_default_error201_valid( self, **kwargs # type: Any ): - # type: (...) -> Union["models.MyException", "models.B"] + # type: (...) -> Union["_models.MyException", "_models.B"] """Send a 201 response with valid payload: {'statusCode': '201', 'textStatusCode': 'Created'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -353,7 +353,7 @@ def get200_model201_model_default_error201_valid( :rtype: ~httpinfrastructure.models.MyException or ~httpinfrastructure.models.B :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Union["models.MyException", "models.B"]] + cls = kwargs.pop('cls', None) # type: ClsType[Union["_models.MyException", "_models.B"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -376,7 +376,7 @@ def get200_model201_model_default_error201_valid( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if response.status_code == 200: @@ -396,7 +396,7 @@ def get200_model201_model_default_error400_valid( self, **kwargs # type: Any ): - # type: (...) -> Union["models.MyException", "models.B"] + # type: (...) -> Union["_models.MyException", "_models.B"] """Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -404,7 +404,7 @@ def get200_model201_model_default_error400_valid( :rtype: ~httpinfrastructure.models.MyException or ~httpinfrastructure.models.B :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Union["models.MyException", "models.B"]] + cls = kwargs.pop('cls', None) # type: ClsType[Union["_models.MyException", "_models.B"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -427,7 +427,7 @@ def get200_model201_model_default_error400_valid( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if response.status_code == 200: @@ -447,7 +447,7 @@ def get200_model_a201_model_c404_model_d_default_error200_valid( self, **kwargs # type: Any ): - # type: (...) -> Union["models.MyException", "models.C", "models.D"] + # type: (...) -> Union["_models.MyException", "_models.C", "_models.D"] """Send a 200 response with valid payload: {'statusCode': '200'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -455,7 +455,7 @@ def get200_model_a201_model_c404_model_d_default_error200_valid( :rtype: ~httpinfrastructure.models.MyException or ~httpinfrastructure.models.C or ~httpinfrastructure.models.D :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Union["models.MyException", "models.C", "models.D"]] + cls = kwargs.pop('cls', None) # type: ClsType[Union["_models.MyException", "_models.C", "_models.D"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -478,7 +478,7 @@ def get200_model_a201_model_c404_model_d_default_error200_valid( if response.status_code not in [200, 201, 404]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if response.status_code == 200: @@ -501,7 +501,7 @@ def get200_model_a201_model_c404_model_d_default_error201_valid( self, **kwargs # type: Any ): - # type: (...) -> Union["models.MyException", "models.C", "models.D"] + # type: (...) -> Union["_models.MyException", "_models.C", "_models.D"] """Send a 200 response with valid payload: {'httpCode': '201'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -509,7 +509,7 @@ def get200_model_a201_model_c404_model_d_default_error201_valid( :rtype: ~httpinfrastructure.models.MyException or ~httpinfrastructure.models.C or ~httpinfrastructure.models.D :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Union["models.MyException", "models.C", "models.D"]] + cls = kwargs.pop('cls', None) # type: ClsType[Union["_models.MyException", "_models.C", "_models.D"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -532,7 +532,7 @@ def get200_model_a201_model_c404_model_d_default_error201_valid( if response.status_code not in [200, 201, 404]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if response.status_code == 200: @@ -555,7 +555,7 @@ def get200_model_a201_model_c404_model_d_default_error404_valid( self, **kwargs # type: Any ): - # type: (...) -> Union["models.MyException", "models.C", "models.D"] + # type: (...) -> Union["_models.MyException", "_models.C", "_models.D"] """Send a 200 response with valid payload: {'httpStatusCode': '404'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -563,7 +563,7 @@ def get200_model_a201_model_c404_model_d_default_error404_valid( :rtype: ~httpinfrastructure.models.MyException or ~httpinfrastructure.models.C or ~httpinfrastructure.models.D :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Union["models.MyException", "models.C", "models.D"]] + cls = kwargs.pop('cls', None) # type: ClsType[Union["_models.MyException", "_models.C", "_models.D"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -586,7 +586,7 @@ def get200_model_a201_model_c404_model_d_default_error404_valid( if response.status_code not in [200, 201, 404]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if response.status_code == 200: @@ -609,7 +609,7 @@ def get200_model_a201_model_c404_model_d_default_error400_valid( self, **kwargs # type: Any ): - # type: (...) -> Union["models.MyException", "models.C", "models.D"] + # type: (...) -> Union["_models.MyException", "_models.C", "_models.D"] """Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -617,7 +617,7 @@ def get200_model_a201_model_c404_model_d_default_error400_valid( :rtype: ~httpinfrastructure.models.MyException or ~httpinfrastructure.models.C or ~httpinfrastructure.models.D :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Union["models.MyException", "models.C", "models.D"]] + cls = kwargs.pop('cls', None) # type: ClsType[Union["_models.MyException", "_models.C", "_models.D"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -640,7 +640,7 @@ def get200_model_a201_model_c404_model_d_default_error400_valid( if response.status_code not in [200, 201, 404]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if response.status_code == 200: @@ -694,7 +694,7 @@ def get202_none204_none_default_error202_none( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -738,7 +738,7 @@ def get202_none204_none_default_error204_none( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -782,7 +782,7 @@ def get202_none204_none_default_error400_valid( if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -959,7 +959,7 @@ def get_default_model_a200_valid( self, **kwargs # type: Any ): - # type: (...) -> "models.MyException" + # type: (...) -> "_models.MyException" """Send a 200 response with valid payload: {'statusCode': '200'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -967,7 +967,7 @@ def get_default_model_a200_valid( :rtype: ~httpinfrastructure.models.MyException :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MyException"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyException"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1005,7 +1005,7 @@ def get_default_model_a200_none( self, **kwargs # type: Any ): - # type: (...) -> "models.MyException" + # type: (...) -> "_models.MyException" """Send a 200 response with no payload. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1013,7 +1013,7 @@ def get_default_model_a200_none( :rtype: ~httpinfrastructure.models.MyException :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MyException"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyException"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1082,7 +1082,7 @@ def get_default_model_a400_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.MyException, response) + error = self._deserialize(_models.MyException, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1126,7 +1126,7 @@ def get_default_model_a400_none( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.MyException, response) + error = self._deserialize(_models.MyException, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1303,7 +1303,7 @@ def get200_model_a200_none( self, **kwargs # type: Any ): - # type: (...) -> "models.MyException" + # type: (...) -> "_models.MyException" """Send a 200 response with no payload, when a payload is expected - client should return a null object of thde type for model A. @@ -1312,7 +1312,7 @@ def get200_model_a200_none( :rtype: ~httpinfrastructure.models.MyException :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MyException"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyException"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1350,7 +1350,7 @@ def get200_model_a200_valid( self, **kwargs # type: Any ): - # type: (...) -> "models.MyException" + # type: (...) -> "_models.MyException" """Send a 200 response with payload {'statusCode': '200'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1358,7 +1358,7 @@ def get200_model_a200_valid( :rtype: ~httpinfrastructure.models.MyException :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MyException"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyException"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1396,7 +1396,7 @@ def get200_model_a200_invalid( self, **kwargs # type: Any ): - # type: (...) -> "models.MyException" + # type: (...) -> "_models.MyException" """Send a 200 response with invalid payload {'statusCodeInvalid': '200'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1404,7 +1404,7 @@ def get200_model_a200_invalid( :rtype: ~httpinfrastructure.models.MyException :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MyException"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyException"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1442,7 +1442,7 @@ def get200_model_a400_none( self, **kwargs # type: Any ): - # type: (...) -> "models.MyException" + # type: (...) -> "_models.MyException" """Send a 400 response with no payload client should treat as an http error with no error model. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1450,7 +1450,7 @@ def get200_model_a400_none( :rtype: ~httpinfrastructure.models.MyException :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MyException"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyException"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1488,7 +1488,7 @@ def get200_model_a400_valid( self, **kwargs # type: Any ): - # type: (...) -> "models.MyException" + # type: (...) -> "_models.MyException" """Send a 200 response with payload {'statusCode': '400'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1496,7 +1496,7 @@ def get200_model_a400_valid( :rtype: ~httpinfrastructure.models.MyException :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MyException"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyException"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1534,7 +1534,7 @@ def get200_model_a400_invalid( self, **kwargs # type: Any ): - # type: (...) -> "models.MyException" + # type: (...) -> "_models.MyException" """Send a 200 response with invalid payload {'statusCodeInvalid': '400'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1542,7 +1542,7 @@ def get200_model_a400_invalid( :rtype: ~httpinfrastructure.models.MyException :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MyException"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyException"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1580,7 +1580,7 @@ def get200_model_a202_valid( self, **kwargs # type: Any ): - # type: (...) -> "models.MyException" + # type: (...) -> "_models.MyException" """Send a 202 response with payload {'statusCode': '202'}. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1588,7 +1588,7 @@ def get200_model_a202_valid( :rtype: ~httpinfrastructure.models.MyException :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MyException"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyException"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/vanilla/Expected/AcceptanceTests/MediaTypes/mediatypes/aio/operations/_media_types_client_operations.py b/test/vanilla/Expected/AcceptanceTests/MediaTypes/mediatypes/aio/operations/_media_types_client_operations.py index 9f0b823e570..fbc672efd94 100644 --- a/test/vanilla/Expected/AcceptanceTests/MediaTypes/mediatypes/aio/operations/_media_types_client_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/MediaTypes/mediatypes/aio/operations/_media_types_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -23,7 +23,7 @@ class MediaTypesClientOperationsMixin: @distributed_trace_async async def analyze_body( self, - input: Optional[Union[IO, "models.SourcePath"]] = None, + input: Optional[Union[IO, "_models.SourcePath"]] = None, **kwargs ) -> str: """Analyze body, that could be different media types. diff --git a/test/vanilla/Expected/AcceptanceTests/MediaTypes/mediatypes/operations/_media_types_client_operations.py b/test/vanilla/Expected/AcceptanceTests/MediaTypes/mediatypes/operations/_media_types_client_operations.py index e07062643d1..3d996652046 100644 --- a/test/vanilla/Expected/AcceptanceTests/MediaTypes/mediatypes/operations/_media_types_client_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/MediaTypes/mediatypes/operations/_media_types_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -27,7 +27,7 @@ class MediaTypesClientOperationsMixin(object): @distributed_trace def analyze_body( self, - input=None, # type: Optional[Union[IO, "models.SourcePath"]] + input=None, # type: Optional[Union[IO, "_models.SourcePath"]] **kwargs # type: Any ): # type: (...) -> str diff --git a/test/vanilla/Expected/AcceptanceTests/ModelFlattening/modelflattening/aio/operations/_auto_rest_resource_flattening_test_service_operations.py b/test/vanilla/Expected/AcceptanceTests/ModelFlattening/modelflattening/aio/operations/_auto_rest_resource_flattening_test_service_operations.py index 3da60b03657..eb33e07c7fa 100644 --- a/test/vanilla/Expected/AcceptanceTests/ModelFlattening/modelflattening/aio/operations/_auto_rest_resource_flattening_test_service_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/ModelFlattening/modelflattening/aio/operations/_auto_rest_resource_flattening_test_service_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -23,7 +23,7 @@ class AutoRestResourceFlatteningTestServiceOperationsMixin: @distributed_trace_async async def put_array( self, - resource_array: Optional[List["models.Resource"]] = None, + resource_array: Optional[List["_models.Resource"]] = None, **kwargs ) -> None: """Put External Resource as an Array. @@ -66,7 +66,7 @@ async def put_array( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -78,7 +78,7 @@ async def put_array( async def get_array( self, **kwargs - ) -> List["models.FlattenedProduct"]: + ) -> List["_models.FlattenedProduct"]: """Get External Resource as an Array. :keyword callable cls: A custom type or function that will be passed the direct response @@ -86,7 +86,7 @@ async def get_array( :rtype: list[~modelflattening.models.FlattenedProduct] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.FlattenedProduct"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.FlattenedProduct"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,7 +109,7 @@ async def get_array( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[FlattenedProduct]', pipeline_response) @@ -123,7 +123,7 @@ async def get_array( @distributed_trace_async async def put_wrapped_array( self, - resource_array: Optional[List["models.WrappedProduct"]] = None, + resource_array: Optional[List["_models.WrappedProduct"]] = None, **kwargs ) -> None: """No need to have a route in Express server for this operation. Used to verify the type flattened @@ -167,7 +167,7 @@ async def put_wrapped_array( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -179,7 +179,7 @@ async def put_wrapped_array( async def get_wrapped_array( self, **kwargs - ) -> List["models.ProductWrapper"]: + ) -> List["_models.ProductWrapper"]: """No need to have a route in Express server for this operation. Used to verify the type flattened is not removed if it's referenced in an array. @@ -188,7 +188,7 @@ async def get_wrapped_array( :rtype: list[~modelflattening.models.ProductWrapper] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.ProductWrapper"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.ProductWrapper"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -211,7 +211,7 @@ async def get_wrapped_array( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[ProductWrapper]', pipeline_response) @@ -225,7 +225,7 @@ async def get_wrapped_array( @distributed_trace_async async def put_dictionary( self, - resource_dictionary: Optional[Dict[str, "models.FlattenedProduct"]] = None, + resource_dictionary: Optional[Dict[str, "_models.FlattenedProduct"]] = None, **kwargs ) -> None: """Put External Resource as a Dictionary. @@ -268,7 +268,7 @@ async def put_dictionary( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -280,7 +280,7 @@ async def put_dictionary( async def get_dictionary( self, **kwargs - ) -> Dict[str, "models.FlattenedProduct"]: + ) -> Dict[str, "_models.FlattenedProduct"]: """Get External Resource as a Dictionary. :keyword callable cls: A custom type or function that will be passed the direct response @@ -288,7 +288,7 @@ async def get_dictionary( :rtype: dict[str, ~modelflattening.models.FlattenedProduct] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, "models.FlattenedProduct"]] + cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, "_models.FlattenedProduct"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -311,7 +311,7 @@ async def get_dictionary( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{FlattenedProduct}', pipeline_response) @@ -325,7 +325,7 @@ async def get_dictionary( @distributed_trace_async async def put_resource_collection( self, - resource_complex_object: Optional["models.ResourceCollection"] = None, + resource_complex_object: Optional["_models.ResourceCollection"] = None, **kwargs ) -> None: """Put External Resource as a ResourceCollection. @@ -368,7 +368,7 @@ async def put_resource_collection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -380,7 +380,7 @@ async def put_resource_collection( async def get_resource_collection( self, **kwargs - ) -> "models.ResourceCollection": + ) -> "_models.ResourceCollection": """Get External Resource as a ResourceCollection. :keyword callable cls: A custom type or function that will be passed the direct response @@ -388,7 +388,7 @@ async def get_resource_collection( :rtype: ~modelflattening.models.ResourceCollection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +411,7 @@ async def get_resource_collection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('ResourceCollection', pipeline_response) @@ -425,9 +425,9 @@ async def get_resource_collection( @distributed_trace_async async def put_simple_product( self, - simple_body_product: Optional["models.SimpleProduct"] = None, + simple_body_product: Optional["_models.SimpleProduct"] = None, **kwargs - ) -> "models.SimpleProduct": + ) -> "_models.SimpleProduct": """Put Simple Product with client flattening true on the model. :param simple_body_product: Simple body product to put. @@ -437,7 +437,7 @@ async def put_simple_product( :rtype: ~modelflattening.models.SimpleProduct :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SimpleProduct"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SimpleProduct"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -468,7 +468,7 @@ async def put_simple_product( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('SimpleProduct', pipeline_response) @@ -488,7 +488,7 @@ async def post_flattened_simple_product( generic_value: Optional[str] = None, odata_value: Optional[str] = None, **kwargs - ) -> "models.SimpleProduct": + ) -> "_models.SimpleProduct": """Put Flattened Simple Product with client flattening true on the parameter. :param product_id: Unique identifier representing a specific product for a given latitude & @@ -508,13 +508,13 @@ async def post_flattened_simple_product( :rtype: ~modelflattening.models.SimpleProduct :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SimpleProduct"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SimpleProduct"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - _simple_body_product = models.SimpleProduct(product_id=product_id, description=description, max_product_display_name=max_product_display_name, generic_value=generic_value, odata_value=odata_value) + _simple_body_product = _models.SimpleProduct(product_id=product_id, description=description, max_product_display_name=max_product_display_name, generic_value=generic_value, odata_value=odata_value) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -541,7 +541,7 @@ async def post_flattened_simple_product( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('SimpleProduct', pipeline_response) @@ -555,9 +555,9 @@ async def post_flattened_simple_product( @distributed_trace_async async def put_simple_product_with_grouping( self, - flatten_parameter_group: "models.FlattenParameterGroup", + flatten_parameter_group: "_models.FlattenParameterGroup", **kwargs - ) -> "models.SimpleProduct": + ) -> "_models.SimpleProduct": """Put Simple Product with client flattening true on the model. :param flatten_parameter_group: Parameter group. @@ -567,7 +567,7 @@ async def put_simple_product_with_grouping( :rtype: ~modelflattening.models.SimpleProduct :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SimpleProduct"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SimpleProduct"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -589,7 +589,7 @@ async def put_simple_product_with_grouping( _generic_value = flatten_parameter_group.generic_value _odata_value = flatten_parameter_group.odata_value - _simple_body_product = models.SimpleProduct(product_id=_product_id, description=_description, max_product_display_name=_max_product_display_name, generic_value=_generic_value, odata_value=_odata_value) + _simple_body_product = _models.SimpleProduct(product_id=_product_id, description=_description, max_product_display_name=_max_product_display_name, generic_value=_generic_value, odata_value=_odata_value) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -620,7 +620,7 @@ async def put_simple_product_with_grouping( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('SimpleProduct', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/ModelFlattening/modelflattening/operations/_auto_rest_resource_flattening_test_service_operations.py b/test/vanilla/Expected/AcceptanceTests/ModelFlattening/modelflattening/operations/_auto_rest_resource_flattening_test_service_operations.py index 018c51a5873..eae61d75ce9 100644 --- a/test/vanilla/Expected/AcceptanceTests/ModelFlattening/modelflattening/operations/_auto_rest_resource_flattening_test_service_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/ModelFlattening/modelflattening/operations/_auto_rest_resource_flattening_test_service_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -27,7 +27,7 @@ class AutoRestResourceFlatteningTestServiceOperationsMixin(object): @distributed_trace def put_array( self, - resource_array=None, # type: Optional[List["models.Resource"]] + resource_array=None, # type: Optional[List["_models.Resource"]] **kwargs # type: Any ): # type: (...) -> None @@ -71,7 +71,7 @@ def put_array( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -84,7 +84,7 @@ def get_array( self, **kwargs # type: Any ): - # type: (...) -> List["models.FlattenedProduct"] + # type: (...) -> List["_models.FlattenedProduct"] """Get External Resource as an Array. :keyword callable cls: A custom type or function that will be passed the direct response @@ -92,7 +92,7 @@ def get_array( :rtype: list[~modelflattening.models.FlattenedProduct] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.FlattenedProduct"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.FlattenedProduct"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,7 +115,7 @@ def get_array( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[FlattenedProduct]', pipeline_response) @@ -129,7 +129,7 @@ def get_array( @distributed_trace def put_wrapped_array( self, - resource_array=None, # type: Optional[List["models.WrappedProduct"]] + resource_array=None, # type: Optional[List["_models.WrappedProduct"]] **kwargs # type: Any ): # type: (...) -> None @@ -174,7 +174,7 @@ def put_wrapped_array( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -187,7 +187,7 @@ def get_wrapped_array( self, **kwargs # type: Any ): - # type: (...) -> List["models.ProductWrapper"] + # type: (...) -> List["_models.ProductWrapper"] """No need to have a route in Express server for this operation. Used to verify the type flattened is not removed if it's referenced in an array. @@ -196,7 +196,7 @@ def get_wrapped_array( :rtype: list[~modelflattening.models.ProductWrapper] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.ProductWrapper"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.ProductWrapper"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,7 +219,7 @@ def get_wrapped_array( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('[ProductWrapper]', pipeline_response) @@ -233,7 +233,7 @@ def get_wrapped_array( @distributed_trace def put_dictionary( self, - resource_dictionary=None, # type: Optional[Dict[str, "models.FlattenedProduct"]] + resource_dictionary=None, # type: Optional[Dict[str, "_models.FlattenedProduct"]] **kwargs # type: Any ): # type: (...) -> None @@ -277,7 +277,7 @@ def put_dictionary( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -290,7 +290,7 @@ def get_dictionary( self, **kwargs # type: Any ): - # type: (...) -> Dict[str, "models.FlattenedProduct"] + # type: (...) -> Dict[str, "_models.FlattenedProduct"] """Get External Resource as a Dictionary. :keyword callable cls: A custom type or function that will be passed the direct response @@ -298,7 +298,7 @@ def get_dictionary( :rtype: dict[str, ~modelflattening.models.FlattenedProduct] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, "models.FlattenedProduct"]] + cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, "_models.FlattenedProduct"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -321,7 +321,7 @@ def get_dictionary( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{FlattenedProduct}', pipeline_response) @@ -335,7 +335,7 @@ def get_dictionary( @distributed_trace def put_resource_collection( self, - resource_complex_object=None, # type: Optional["models.ResourceCollection"] + resource_complex_object=None, # type: Optional["_models.ResourceCollection"] **kwargs # type: Any ): # type: (...) -> None @@ -379,7 +379,7 @@ def put_resource_collection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -392,7 +392,7 @@ def get_resource_collection( self, **kwargs # type: Any ): - # type: (...) -> "models.ResourceCollection" + # type: (...) -> "_models.ResourceCollection" """Get External Resource as a ResourceCollection. :keyword callable cls: A custom type or function that will be passed the direct response @@ -400,7 +400,7 @@ def get_resource_collection( :rtype: ~modelflattening.models.ResourceCollection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -423,7 +423,7 @@ def get_resource_collection( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('ResourceCollection', pipeline_response) @@ -437,10 +437,10 @@ def get_resource_collection( @distributed_trace def put_simple_product( self, - simple_body_product=None, # type: Optional["models.SimpleProduct"] + simple_body_product=None, # type: Optional["_models.SimpleProduct"] **kwargs # type: Any ): - # type: (...) -> "models.SimpleProduct" + # type: (...) -> "_models.SimpleProduct" """Put Simple Product with client flattening true on the model. :param simple_body_product: Simple body product to put. @@ -450,7 +450,7 @@ def put_simple_product( :rtype: ~modelflattening.models.SimpleProduct :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SimpleProduct"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SimpleProduct"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -481,7 +481,7 @@ def put_simple_product( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('SimpleProduct', pipeline_response) @@ -502,7 +502,7 @@ def post_flattened_simple_product( odata_value=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.SimpleProduct" + # type: (...) -> "_models.SimpleProduct" """Put Flattened Simple Product with client flattening true on the parameter. :param product_id: Unique identifier representing a specific product for a given latitude & @@ -522,13 +522,13 @@ def post_flattened_simple_product( :rtype: ~modelflattening.models.SimpleProduct :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SimpleProduct"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SimpleProduct"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - _simple_body_product = models.SimpleProduct(product_id=product_id, description=description, max_product_display_name=max_product_display_name, generic_value=generic_value, odata_value=odata_value) + _simple_body_product = _models.SimpleProduct(product_id=product_id, description=description, max_product_display_name=max_product_display_name, generic_value=generic_value, odata_value=odata_value) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -555,7 +555,7 @@ def post_flattened_simple_product( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('SimpleProduct', pipeline_response) @@ -569,10 +569,10 @@ def post_flattened_simple_product( @distributed_trace def put_simple_product_with_grouping( self, - flatten_parameter_group, # type: "models.FlattenParameterGroup" + flatten_parameter_group, # type: "_models.FlattenParameterGroup" **kwargs # type: Any ): - # type: (...) -> "models.SimpleProduct" + # type: (...) -> "_models.SimpleProduct" """Put Simple Product with client flattening true on the model. :param flatten_parameter_group: Parameter group. @@ -582,7 +582,7 @@ def put_simple_product_with_grouping( :rtype: ~modelflattening.models.SimpleProduct :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SimpleProduct"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SimpleProduct"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -604,7 +604,7 @@ def put_simple_product_with_grouping( _generic_value = flatten_parameter_group.generic_value _odata_value = flatten_parameter_group.odata_value - _simple_body_product = models.SimpleProduct(product_id=_product_id, description=_description, max_product_display_name=_max_product_display_name, generic_value=_generic_value, odata_value=_odata_value) + _simple_body_product = _models.SimpleProduct(product_id=_product_id, description=_description, max_product_display_name=_max_product_display_name, generic_value=_generic_value, odata_value=_odata_value) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -635,7 +635,7 @@ def put_simple_product_with_grouping( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('SimpleProduct', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/operations/_multiple_inheritance_service_client_operations.py b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/operations/_multiple_inheritance_service_client_operations.py index ccad69f3568..4aa92b8c0b9 100644 --- a/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/operations/_multiple_inheritance_service_client_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/operations/_multiple_inheritance_service_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -24,7 +24,7 @@ class MultipleInheritanceServiceClientOperationsMixin: async def get_horse( self, **kwargs - ) -> "models.Horse": + ) -> "_models.Horse": """Get a horse with name 'Fred' and isAShowHorse true. :keyword callable cls: A custom type or function that will be passed the direct response @@ -32,7 +32,7 @@ async def get_horse( :rtype: ~multipleinheritance.models.Horse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Horse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Horse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -55,7 +55,7 @@ async def get_horse( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Horse', pipeline_response) @@ -69,7 +69,7 @@ async def get_horse( @distributed_trace_async async def put_horse( self, - horse: "models.Horse", + horse: "_models.Horse", **kwargs ) -> str: """Put a horse with name 'General' and isAShowHorse false. @@ -123,7 +123,7 @@ async def put_horse( async def get_pet( self, **kwargs - ) -> "models.Pet": + ) -> "_models.Pet": """Get a pet with name 'Peanut'. :keyword callable cls: A custom type or function that will be passed the direct response @@ -131,7 +131,7 @@ async def get_pet( :rtype: ~multipleinheritance.models.Pet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Pet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Pet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -154,7 +154,7 @@ async def get_pet( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Pet', pipeline_response) @@ -186,7 +186,7 @@ async def put_pet( } error_map.update(kwargs.pop('error_map', {})) - _pet = models.Pet(name=name) + _pet = _models.Pet(name=name) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -224,7 +224,7 @@ async def put_pet( async def get_feline( self, **kwargs - ) -> "models.Feline": + ) -> "_models.Feline": """Get a feline where meows and hisses are true. :keyword callable cls: A custom type or function that will be passed the direct response @@ -232,7 +232,7 @@ async def get_feline( :rtype: ~multipleinheritance.models.Feline :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Feline"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Feline"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -255,7 +255,7 @@ async def get_feline( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Feline', pipeline_response) @@ -269,7 +269,7 @@ async def get_feline( @distributed_trace_async async def put_feline( self, - feline: "models.Feline", + feline: "_models.Feline", **kwargs ) -> str: """Put a feline who hisses and doesn't meow. @@ -323,7 +323,7 @@ async def put_feline( async def get_cat( self, **kwargs - ) -> "models.Cat": + ) -> "_models.Cat": """Get a cat with name 'Whiskers' where likesMilk, meows, and hisses is true. :keyword callable cls: A custom type or function that will be passed the direct response @@ -331,7 +331,7 @@ async def get_cat( :rtype: ~multipleinheritance.models.Cat :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Cat"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Cat"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,7 +354,7 @@ async def get_cat( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Cat', pipeline_response) @@ -368,7 +368,7 @@ async def get_cat( @distributed_trace_async async def put_cat( self, - cat: "models.Cat", + cat: "_models.Cat", **kwargs ) -> str: """Put a cat with name 'Boots' where likesMilk and hisses is false, meows is true. @@ -422,7 +422,7 @@ async def put_cat( async def get_kitten( self, **kwargs - ) -> "models.Kitten": + ) -> "_models.Kitten": """Get a kitten with name 'Gatito' where likesMilk and meows is true, and hisses and eatsMiceYet is false. @@ -431,7 +431,7 @@ async def get_kitten( :rtype: ~multipleinheritance.models.Kitten :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Kitten"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Kitten"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -454,7 +454,7 @@ async def get_kitten( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Kitten', pipeline_response) @@ -468,7 +468,7 @@ async def get_kitten( @distributed_trace_async async def put_kitten( self, - kitten: "models.Kitten", + kitten: "_models.Kitten", **kwargs ) -> str: """Put a kitten with name 'Kitty' where likesMilk and hisses is false, meows and eatsMiceYet is diff --git a/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/operations/_multiple_inheritance_service_client_operations.py b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/operations/_multiple_inheritance_service_client_operations.py index ada9c2d7b67..b1f67709538 100644 --- a/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/operations/_multiple_inheritance_service_client_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/operations/_multiple_inheritance_service_client_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -29,7 +29,7 @@ def get_horse( self, **kwargs # type: Any ): - # type: (...) -> "models.Horse" + # type: (...) -> "_models.Horse" """Get a horse with name 'Fred' and isAShowHorse true. :keyword callable cls: A custom type or function that will be passed the direct response @@ -37,7 +37,7 @@ def get_horse( :rtype: ~multipleinheritance.models.Horse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Horse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Horse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -60,7 +60,7 @@ def get_horse( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Horse', pipeline_response) @@ -74,7 +74,7 @@ def get_horse( @distributed_trace def put_horse( self, - horse, # type: "models.Horse" + horse, # type: "_models.Horse" **kwargs # type: Any ): # type: (...) -> str @@ -130,7 +130,7 @@ def get_pet( self, **kwargs # type: Any ): - # type: (...) -> "models.Pet" + # type: (...) -> "_models.Pet" """Get a pet with name 'Peanut'. :keyword callable cls: A custom type or function that will be passed the direct response @@ -138,7 +138,7 @@ def get_pet( :rtype: ~multipleinheritance.models.Pet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Pet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Pet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -161,7 +161,7 @@ def get_pet( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Pet', pipeline_response) @@ -194,7 +194,7 @@ def put_pet( } error_map.update(kwargs.pop('error_map', {})) - _pet = models.Pet(name=name) + _pet = _models.Pet(name=name) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -233,7 +233,7 @@ def get_feline( self, **kwargs # type: Any ): - # type: (...) -> "models.Feline" + # type: (...) -> "_models.Feline" """Get a feline where meows and hisses are true. :keyword callable cls: A custom type or function that will be passed the direct response @@ -241,7 +241,7 @@ def get_feline( :rtype: ~multipleinheritance.models.Feline :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Feline"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Feline"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -264,7 +264,7 @@ def get_feline( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Feline', pipeline_response) @@ -278,7 +278,7 @@ def get_feline( @distributed_trace def put_feline( self, - feline, # type: "models.Feline" + feline, # type: "_models.Feline" **kwargs # type: Any ): # type: (...) -> str @@ -334,7 +334,7 @@ def get_cat( self, **kwargs # type: Any ): - # type: (...) -> "models.Cat" + # type: (...) -> "_models.Cat" """Get a cat with name 'Whiskers' where likesMilk, meows, and hisses is true. :keyword callable cls: A custom type or function that will be passed the direct response @@ -342,7 +342,7 @@ def get_cat( :rtype: ~multipleinheritance.models.Cat :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Cat"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Cat"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -365,7 +365,7 @@ def get_cat( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Cat', pipeline_response) @@ -379,7 +379,7 @@ def get_cat( @distributed_trace def put_cat( self, - cat, # type: "models.Cat" + cat, # type: "_models.Cat" **kwargs # type: Any ): # type: (...) -> str @@ -435,7 +435,7 @@ def get_kitten( self, **kwargs # type: Any ): - # type: (...) -> "models.Kitten" + # type: (...) -> "_models.Kitten" """Get a kitten with name 'Gatito' where likesMilk and meows is true, and hisses and eatsMiceYet is false. @@ -444,7 +444,7 @@ def get_kitten( :rtype: ~multipleinheritance.models.Kitten :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Kitten"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Kitten"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -467,7 +467,7 @@ def get_kitten( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Kitten', pipeline_response) @@ -481,7 +481,7 @@ def get_kitten( @distributed_trace def put_kitten( self, - kitten, # type: "models.Kitten" + kitten, # type: "_models.Kitten" **kwargs # type: Any ): # type: (...) -> str diff --git a/test/vanilla/Expected/AcceptanceTests/NonStringEnums/nonstringenums/aio/operations/_float_operations.py b/test/vanilla/Expected/AcceptanceTests/NonStringEnums/nonstringenums/aio/operations/_float_operations.py index cd8626e9bd9..8c1385b715a 100644 --- a/test/vanilla/Expected/AcceptanceTests/NonStringEnums/nonstringenums/aio/operations/_float_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/NonStringEnums/nonstringenums/aio/operations/_float_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -39,7 +39,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def put( self, - input: Optional[Union[float, "models.FloatEnum"]] = None, + input: Optional[Union[float, "_models.FloatEnum"]] = None, **kwargs ) -> str: """Put a float enum. @@ -96,7 +96,7 @@ async def put( async def get( self, **kwargs - ) -> Union[float, "models.FloatEnum"]: + ) -> Union[float, "_models.FloatEnum"]: """Get a float enum. :keyword callable cls: A custom type or function that will be passed the direct response @@ -104,7 +104,7 @@ async def get( :rtype: str or ~nonstringenums.models.FloatEnum :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Union[float, "models.FloatEnum"]] + cls = kwargs.pop('cls', None) # type: ClsType[Union[float, "_models.FloatEnum"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/vanilla/Expected/AcceptanceTests/NonStringEnums/nonstringenums/aio/operations/_int_operations.py b/test/vanilla/Expected/AcceptanceTests/NonStringEnums/nonstringenums/aio/operations/_int_operations.py index 6827e0a255d..d178e501d7d 100644 --- a/test/vanilla/Expected/AcceptanceTests/NonStringEnums/nonstringenums/aio/operations/_int_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/NonStringEnums/nonstringenums/aio/operations/_int_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -39,7 +39,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: @distributed_trace_async async def put( self, - input: Optional[Union[int, "models.IntEnum"]] = None, + input: Optional[Union[int, "_models.IntEnum"]] = None, **kwargs ) -> str: """Put an int enum. @@ -96,7 +96,7 @@ async def put( async def get( self, **kwargs - ) -> Union[int, "models.IntEnum"]: + ) -> Union[int, "_models.IntEnum"]: """Get an int enum. :keyword callable cls: A custom type or function that will be passed the direct response @@ -104,7 +104,7 @@ async def get( :rtype: str or ~nonstringenums.models.IntEnum :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Union[int, "models.IntEnum"]] + cls = kwargs.pop('cls', None) # type: ClsType[Union[int, "_models.IntEnum"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/vanilla/Expected/AcceptanceTests/NonStringEnums/nonstringenums/operations/_float_operations.py b/test/vanilla/Expected/AcceptanceTests/NonStringEnums/nonstringenums/operations/_float_operations.py index c21487befdd..7c8f9a9b7aa 100644 --- a/test/vanilla/Expected/AcceptanceTests/NonStringEnums/nonstringenums/operations/_float_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/NonStringEnums/nonstringenums/operations/_float_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): @distributed_trace def put( self, - input=None, # type: Optional[Union[float, "models.FloatEnum"]] + input=None, # type: Optional[Union[float, "_models.FloatEnum"]] **kwargs # type: Any ): # type: (...) -> str @@ -102,7 +102,7 @@ def get( self, **kwargs # type: Any ): - # type: (...) -> Union[float, "models.FloatEnum"] + # type: (...) -> Union[float, "_models.FloatEnum"] """Get a float enum. :keyword callable cls: A custom type or function that will be passed the direct response @@ -110,7 +110,7 @@ def get( :rtype: str or ~nonstringenums.models.FloatEnum :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Union[float, "models.FloatEnum"]] + cls = kwargs.pop('cls', None) # type: ClsType[Union[float, "_models.FloatEnum"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/vanilla/Expected/AcceptanceTests/NonStringEnums/nonstringenums/operations/_int_operations.py b/test/vanilla/Expected/AcceptanceTests/NonStringEnums/nonstringenums/operations/_int_operations.py index 0242ce22e5f..cbe7f8f12ea 100644 --- a/test/vanilla/Expected/AcceptanceTests/NonStringEnums/nonstringenums/operations/_int_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/NonStringEnums/nonstringenums/operations/_int_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): @distributed_trace def put( self, - input=None, # type: Optional[Union[int, "models.IntEnum"]] + input=None, # type: Optional[Union[int, "_models.IntEnum"]] **kwargs # type: Any ): # type: (...) -> str @@ -102,7 +102,7 @@ def get( self, **kwargs # type: Any ): - # type: (...) -> Union[int, "models.IntEnum"] + # type: (...) -> Union[int, "_models.IntEnum"] """Get an int enum. :keyword callable cls: A custom type or function that will be passed the direct response @@ -110,7 +110,7 @@ def get( :rtype: str or ~nonstringenums.models.IntEnum :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Union[int, "models.IntEnum"]] + cls = kwargs.pop('cls', None) # type: ClsType[Union[int, "_models.IntEnum"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/vanilla/Expected/AcceptanceTests/ParameterFlattening/parameterflattening/aio/operations/_availability_sets_operations.py b/test/vanilla/Expected/AcceptanceTests/ParameterFlattening/parameterflattening/aio/operations/_availability_sets_operations.py index 2a24b1fb471..f9aa037f2ef 100644 --- a/test/vanilla/Expected/AcceptanceTests/ParameterFlattening/parameterflattening/aio/operations/_availability_sets_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/ParameterFlattening/parameterflattening/aio/operations/_availability_sets_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class AvailabilitySetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -67,7 +67,7 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) - _tags = models.AvailabilitySetUpdateParameters(tags=tags) + _tags = _models.AvailabilitySetUpdateParameters(tags=tags) content_type = kwargs.pop("content_type", "application/json") # Construct URL diff --git a/test/vanilla/Expected/AcceptanceTests/ParameterFlattening/parameterflattening/operations/_availability_sets_operations.py b/test/vanilla/Expected/AcceptanceTests/ParameterFlattening/parameterflattening/operations/_availability_sets_operations.py index 54e6acfd994..4759bb9c8ee 100644 --- a/test/vanilla/Expected/AcceptanceTests/ParameterFlattening/parameterflattening/operations/_availability_sets_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/ParameterFlattening/parameterflattening/operations/_availability_sets_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class AvailabilitySetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -72,7 +72,7 @@ def update( } error_map.update(kwargs.pop('error_map', {})) - _tags = models.AvailabilitySetUpdateParameters(tags=tags) + _tags = _models.AvailabilitySetUpdateParameters(tags=tags) content_type = kwargs.pop("content_type", "application/json") # Construct URL diff --git a/test/vanilla/Expected/AcceptanceTests/Report/report/aio/operations/_auto_rest_report_service_operations.py b/test/vanilla/Expected/AcceptanceTests/Report/report/aio/operations/_auto_rest_report_service_operations.py index c2606ff13b7..8f4efc3cb07 100644 --- a/test/vanilla/Expected/AcceptanceTests/Report/report/aio/operations/_auto_rest_report_service_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Report/report/aio/operations/_auto_rest_report_service_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -62,7 +62,7 @@ async def get_report( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{int}', pipeline_response) @@ -115,7 +115,7 @@ async def get_optional_report( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{int}', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/Report/report/operations/_auto_rest_report_service_operations.py b/test/vanilla/Expected/AcceptanceTests/Report/report/operations/_auto_rest_report_service_operations.py index eddb18039c2..c03f3154065 100644 --- a/test/vanilla/Expected/AcceptanceTests/Report/report/operations/_auto_rest_report_service_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Report/report/operations/_auto_rest_report_service_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -67,7 +67,7 @@ def get_report( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{int}', pipeline_response) @@ -121,7 +121,7 @@ def get_optional_report( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('{int}', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/RequiredOptional/requiredoptional/aio/operations/_explicit_operations.py b/test/vanilla/Expected/AcceptanceTests/RequiredOptional/requiredoptional/aio/operations/_explicit_operations.py index 30dfc8218b8..21df1df69a0 100644 --- a/test/vanilla/Expected/AcceptanceTests/RequiredOptional/requiredoptional/aio/operations/_explicit_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/RequiredOptional/requiredoptional/aio/operations/_explicit_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ExplicitOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -84,7 +84,7 @@ async def post_required_integer_parameter( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -138,7 +138,7 @@ async def post_optional_integer_parameter( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -168,7 +168,7 @@ async def post_required_integer_property( } error_map.update(kwargs.pop('error_map', {})) - _body_parameter = models.IntWrapper(value=value) + _body_parameter = _models.IntWrapper(value=value) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -192,7 +192,7 @@ async def post_required_integer_property( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -221,7 +221,7 @@ async def post_optional_integer_property( } error_map.update(kwargs.pop('error_map', {})) - _body_parameter = models.IntOptionalWrapper(value=value) + _body_parameter = _models.IntOptionalWrapper(value=value) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -248,7 +248,7 @@ async def post_optional_integer_property( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -296,7 +296,7 @@ async def post_required_integer_header( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -344,7 +344,7 @@ async def post_optional_integer_header( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -396,7 +396,7 @@ async def post_required_string_parameter( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -450,7 +450,7 @@ async def post_optional_string_parameter( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -480,7 +480,7 @@ async def post_required_string_property( } error_map.update(kwargs.pop('error_map', {})) - _body_parameter = models.StringWrapper(value=value) + _body_parameter = _models.StringWrapper(value=value) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -504,7 +504,7 @@ async def post_required_string_property( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -533,7 +533,7 @@ async def post_optional_string_property( } error_map.update(kwargs.pop('error_map', {})) - _body_parameter = models.StringOptionalWrapper(value=value) + _body_parameter = _models.StringOptionalWrapper(value=value) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -560,7 +560,7 @@ async def post_optional_string_property( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -608,7 +608,7 @@ async def post_required_string_header( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -656,7 +656,7 @@ async def post_optional_string_header( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -667,7 +667,7 @@ async def post_optional_string_header( @distributed_trace_async async def post_required_class_parameter( self, - body_parameter: "models.Product", + body_parameter: "_models.Product", **kwargs ) -> None: """Test explicitly required complex object. Please put null and the client library should throw @@ -708,7 +708,7 @@ async def post_required_class_parameter( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -719,7 +719,7 @@ async def post_required_class_parameter( @distributed_trace_async async def post_optional_class_parameter( self, - body_parameter: Optional["models.Product"] = None, + body_parameter: Optional["_models.Product"] = None, **kwargs ) -> None: """Test explicitly optional complex object. Please put null. @@ -762,7 +762,7 @@ async def post_optional_class_parameter( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -773,7 +773,7 @@ async def post_optional_class_parameter( @distributed_trace_async async def post_required_class_property( self, - value: "models.Product", + value: "_models.Product", **kwargs ) -> None: """Test explicitly required complex object. Please put a valid class-wrapper with 'value' = null @@ -792,7 +792,7 @@ async def post_required_class_property( } error_map.update(kwargs.pop('error_map', {})) - _body_parameter = models.ClassWrapper(value=value) + _body_parameter = _models.ClassWrapper(value=value) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -816,7 +816,7 @@ async def post_required_class_property( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -827,7 +827,7 @@ async def post_required_class_property( @distributed_trace_async async def post_optional_class_property( self, - value: Optional["models.Product"] = None, + value: Optional["_models.Product"] = None, **kwargs ) -> None: """Test explicitly optional complex object. Please put a valid class-wrapper with 'value' = null. @@ -845,7 +845,7 @@ async def post_optional_class_property( } error_map.update(kwargs.pop('error_map', {})) - _body_parameter = models.ClassOptionalWrapper(value=value) + _body_parameter = _models.ClassOptionalWrapper(value=value) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -872,7 +872,7 @@ async def post_optional_class_property( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -924,7 +924,7 @@ async def post_required_array_parameter( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -978,7 +978,7 @@ async def post_optional_array_parameter( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1008,7 +1008,7 @@ async def post_required_array_property( } error_map.update(kwargs.pop('error_map', {})) - _body_parameter = models.ArrayWrapper(value=value) + _body_parameter = _models.ArrayWrapper(value=value) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1032,7 +1032,7 @@ async def post_required_array_property( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1061,7 +1061,7 @@ async def post_optional_array_property( } error_map.update(kwargs.pop('error_map', {})) - _body_parameter = models.ArrayOptionalWrapper(value=value) + _body_parameter = _models.ArrayOptionalWrapper(value=value) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1088,7 +1088,7 @@ async def post_optional_array_property( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1136,7 +1136,7 @@ async def post_required_array_header( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1184,7 +1184,7 @@ async def post_optional_array_header( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/RequiredOptional/requiredoptional/aio/operations/_implicit_operations.py b/test/vanilla/Expected/AcceptanceTests/RequiredOptional/requiredoptional/aio/operations/_implicit_operations.py index 69143415fa2..8361eea8b90 100644 --- a/test/vanilla/Expected/AcceptanceTests/RequiredOptional/requiredoptional/aio/operations/_implicit_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/RequiredOptional/requiredoptional/aio/operations/_implicit_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ImplicitOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -82,7 +82,7 @@ async def get_required_path( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -130,7 +130,7 @@ async def put_optional_query( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -178,7 +178,7 @@ async def put_optional_header( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -232,7 +232,7 @@ async def put_optional_body( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -279,7 +279,7 @@ async def get_required_global_path( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -323,7 +323,7 @@ async def get_required_global_query( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -368,7 +368,7 @@ async def get_optional_global_query( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/RequiredOptional/requiredoptional/operations/_explicit_operations.py b/test/vanilla/Expected/AcceptanceTests/RequiredOptional/requiredoptional/operations/_explicit_operations.py index 5d8aa063f02..71611e05211 100644 --- a/test/vanilla/Expected/AcceptanceTests/RequiredOptional/requiredoptional/operations/_explicit_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/RequiredOptional/requiredoptional/operations/_explicit_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ExplicitOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -89,7 +89,7 @@ def post_required_integer_parameter( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -144,7 +144,7 @@ def post_optional_integer_parameter( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -175,7 +175,7 @@ def post_required_integer_property( } error_map.update(kwargs.pop('error_map', {})) - _body_parameter = models.IntWrapper(value=value) + _body_parameter = _models.IntWrapper(value=value) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -199,7 +199,7 @@ def post_required_integer_property( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -229,7 +229,7 @@ def post_optional_integer_property( } error_map.update(kwargs.pop('error_map', {})) - _body_parameter = models.IntOptionalWrapper(value=value) + _body_parameter = _models.IntOptionalWrapper(value=value) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -256,7 +256,7 @@ def post_optional_integer_property( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -305,7 +305,7 @@ def post_required_integer_header( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -354,7 +354,7 @@ def post_optional_integer_header( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -407,7 +407,7 @@ def post_required_string_parameter( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -462,7 +462,7 @@ def post_optional_string_parameter( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -493,7 +493,7 @@ def post_required_string_property( } error_map.update(kwargs.pop('error_map', {})) - _body_parameter = models.StringWrapper(value=value) + _body_parameter = _models.StringWrapper(value=value) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -517,7 +517,7 @@ def post_required_string_property( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -547,7 +547,7 @@ def post_optional_string_property( } error_map.update(kwargs.pop('error_map', {})) - _body_parameter = models.StringOptionalWrapper(value=value) + _body_parameter = _models.StringOptionalWrapper(value=value) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -574,7 +574,7 @@ def post_optional_string_property( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -623,7 +623,7 @@ def post_required_string_header( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -672,7 +672,7 @@ def post_optional_string_header( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -683,7 +683,7 @@ def post_optional_string_header( @distributed_trace def post_required_class_parameter( self, - body_parameter, # type: "models.Product" + body_parameter, # type: "_models.Product" **kwargs # type: Any ): # type: (...) -> None @@ -725,7 +725,7 @@ def post_required_class_parameter( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -736,7 +736,7 @@ def post_required_class_parameter( @distributed_trace def post_optional_class_parameter( self, - body_parameter=None, # type: Optional["models.Product"] + body_parameter=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> None @@ -780,7 +780,7 @@ def post_optional_class_parameter( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -791,7 +791,7 @@ def post_optional_class_parameter( @distributed_trace def post_required_class_property( self, - value, # type: "models.Product" + value, # type: "_models.Product" **kwargs # type: Any ): # type: (...) -> None @@ -811,7 +811,7 @@ def post_required_class_property( } error_map.update(kwargs.pop('error_map', {})) - _body_parameter = models.ClassWrapper(value=value) + _body_parameter = _models.ClassWrapper(value=value) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -835,7 +835,7 @@ def post_required_class_property( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -846,7 +846,7 @@ def post_required_class_property( @distributed_trace def post_optional_class_property( self, - value=None, # type: Optional["models.Product"] + value=None, # type: Optional["_models.Product"] **kwargs # type: Any ): # type: (...) -> None @@ -865,7 +865,7 @@ def post_optional_class_property( } error_map.update(kwargs.pop('error_map', {})) - _body_parameter = models.ClassOptionalWrapper(value=value) + _body_parameter = _models.ClassOptionalWrapper(value=value) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -892,7 +892,7 @@ def post_optional_class_property( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -945,7 +945,7 @@ def post_required_array_parameter( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1000,7 +1000,7 @@ def post_optional_array_parameter( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1031,7 +1031,7 @@ def post_required_array_property( } error_map.update(kwargs.pop('error_map', {})) - _body_parameter = models.ArrayWrapper(value=value) + _body_parameter = _models.ArrayWrapper(value=value) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1055,7 +1055,7 @@ def post_required_array_property( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1085,7 +1085,7 @@ def post_optional_array_property( } error_map.update(kwargs.pop('error_map', {})) - _body_parameter = models.ArrayOptionalWrapper(value=value) + _body_parameter = _models.ArrayOptionalWrapper(value=value) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1112,7 +1112,7 @@ def post_optional_array_property( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1161,7 +1161,7 @@ def post_required_array_header( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1210,7 +1210,7 @@ def post_optional_array_header( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/RequiredOptional/requiredoptional/operations/_implicit_operations.py b/test/vanilla/Expected/AcceptanceTests/RequiredOptional/requiredoptional/operations/_implicit_operations.py index 57a61fcf212..19b6b5faf5f 100644 --- a/test/vanilla/Expected/AcceptanceTests/RequiredOptional/requiredoptional/operations/_implicit_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/RequiredOptional/requiredoptional/operations/_implicit_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ImplicitOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -87,7 +87,7 @@ def get_required_path( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -136,7 +136,7 @@ def put_optional_query( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -185,7 +185,7 @@ def put_optional_header( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -240,7 +240,7 @@ def put_optional_body( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -288,7 +288,7 @@ def get_required_global_path( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -333,7 +333,7 @@ def get_required_global_query( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -379,7 +379,7 @@ def get_optional_global_query( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/Url/url/aio/operations/_path_items_operations.py b/test/vanilla/Expected/AcceptanceTests/Url/url/aio/operations/_path_items_operations.py index b3ac3484691..d4000ea9225 100644 --- a/test/vanilla/Expected/AcceptanceTests/Url/url/aio/operations/_path_items_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Url/url/aio/operations/_path_items_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class PathItemsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -102,7 +102,7 @@ async def get_all_with_values( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -172,7 +172,7 @@ async def get_global_query_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -242,7 +242,7 @@ async def get_global_and_local_query_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -311,7 +311,7 @@ async def get_local_path_item_query_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/Url/url/aio/operations/_paths_operations.py b/test/vanilla/Expected/AcceptanceTests/Url/url/aio/operations/_paths_operations.py index a40e3d92686..ae4a2bbe57f 100644 --- a/test/vanilla/Expected/AcceptanceTests/Url/url/aio/operations/_paths_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Url/url/aio/operations/_paths_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class PathsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -81,7 +81,7 @@ async def get_boolean_true( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -129,7 +129,7 @@ async def get_boolean_false( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -177,7 +177,7 @@ async def get_int_one_million( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -225,7 +225,7 @@ async def get_int_negative_one_million( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -273,7 +273,7 @@ async def get_ten_billion( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -321,7 +321,7 @@ async def get_negative_ten_billion( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -369,7 +369,7 @@ async def float_scientific_positive( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -417,7 +417,7 @@ async def float_scientific_negative( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -465,7 +465,7 @@ async def double_decimal_positive( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -513,7 +513,7 @@ async def double_decimal_negative( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -561,7 +561,7 @@ async def string_unicode( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -609,7 +609,7 @@ async def string_url_encoded( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -659,7 +659,7 @@ async def string_url_non_encoded( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -707,7 +707,7 @@ async def string_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -757,7 +757,7 @@ async def string_null( if response.status_code not in [400]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -768,7 +768,7 @@ async def string_null( @distributed_trace_async async def enum_valid( self, - enum_path: Union[str, "models.UriColor"], + enum_path: Union[str, "_models.UriColor"], **kwargs ) -> None: """Get using uri with 'green color' in path parameter. @@ -807,7 +807,7 @@ async def enum_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -818,7 +818,7 @@ async def enum_valid( @distributed_trace_async async def enum_null( self, - enum_path: Union[str, "models.UriColor"], + enum_path: Union[str, "_models.UriColor"], **kwargs ) -> None: """Get null (should throw on the client before the request is sent on wire). @@ -857,7 +857,7 @@ async def enum_null( if response.status_code not in [400]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -907,7 +907,7 @@ async def byte_multi_byte( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -955,7 +955,7 @@ async def byte_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1005,7 +1005,7 @@ async def byte_null( if response.status_code not in [400]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1053,7 +1053,7 @@ async def date_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1104,7 +1104,7 @@ async def date_null( if response.status_code not in [400]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1152,7 +1152,7 @@ async def date_time_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1202,7 +1202,7 @@ async def date_time_null( if response.status_code not in [400]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1252,7 +1252,7 @@ async def base64_url( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1304,7 +1304,7 @@ async def array_csv_in_path( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1354,7 +1354,7 @@ async def unix_time_url( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/Url/url/aio/operations/_queries_operations.py b/test/vanilla/Expected/AcceptanceTests/Url/url/aio/operations/_queries_operations.py index 3c03e42ce22..009601021b5 100644 --- a/test/vanilla/Expected/AcceptanceTests/Url/url/aio/operations/_queries_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Url/url/aio/operations/_queries_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class QueriesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -78,7 +78,7 @@ async def get_boolean_true( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -123,7 +123,7 @@ async def get_boolean_false( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -171,7 +171,7 @@ async def get_boolean_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -216,7 +216,7 @@ async def get_int_one_million( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -261,7 +261,7 @@ async def get_int_negative_one_million( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -309,7 +309,7 @@ async def get_int_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -354,7 +354,7 @@ async def get_ten_billion( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -399,7 +399,7 @@ async def get_negative_ten_billion( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -447,7 +447,7 @@ async def get_long_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -492,7 +492,7 @@ async def float_scientific_positive( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -537,7 +537,7 @@ async def float_scientific_negative( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -585,7 +585,7 @@ async def float_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -630,7 +630,7 @@ async def double_decimal_positive( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -675,7 +675,7 @@ async def double_decimal_negative( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -723,7 +723,7 @@ async def double_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -768,7 +768,7 @@ async def string_unicode( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -813,7 +813,7 @@ async def string_url_encoded( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -858,7 +858,7 @@ async def string_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -906,7 +906,7 @@ async def string_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -917,7 +917,7 @@ async def string_null( @distributed_trace_async async def enum_valid( self, - enum_query: Optional[Union[str, "models.UriColor"]] = None, + enum_query: Optional[Union[str, "_models.UriColor"]] = None, **kwargs ) -> None: """Get using uri with query parameter 'green color'. @@ -954,7 +954,7 @@ async def enum_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -965,7 +965,7 @@ async def enum_valid( @distributed_trace_async async def enum_null( self, - enum_query: Optional[Union[str, "models.UriColor"]] = None, + enum_query: Optional[Union[str, "_models.UriColor"]] = None, **kwargs ) -> None: """Get null (no query parameter in url). @@ -1002,7 +1002,7 @@ async def enum_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1050,7 +1050,7 @@ async def byte_multi_byte( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1095,7 +1095,7 @@ async def byte_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1143,7 +1143,7 @@ async def byte_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1188,7 +1188,7 @@ async def date_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1236,7 +1236,7 @@ async def date_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1281,7 +1281,7 @@ async def date_time_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1329,7 +1329,7 @@ async def date_time_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1379,7 +1379,7 @@ async def array_string_csv_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1427,7 +1427,7 @@ async def array_string_csv_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1475,7 +1475,7 @@ async def array_string_csv_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1524,7 +1524,7 @@ async def array_string_no_collection_format_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1574,7 +1574,7 @@ async def array_string_ssv_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1624,7 +1624,7 @@ async def array_string_tsv_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1674,7 +1674,7 @@ async def array_string_pipes_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/Url/url/operations/_path_items_operations.py b/test/vanilla/Expected/AcceptanceTests/Url/url/operations/_path_items_operations.py index a7d1fbd1355..12d9bd6af7b 100644 --- a/test/vanilla/Expected/AcceptanceTests/Url/url/operations/_path_items_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Url/url/operations/_path_items_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class PathItemsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -107,7 +107,7 @@ def get_all_with_values( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -178,7 +178,7 @@ def get_global_query_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -249,7 +249,7 @@ def get_global_and_local_query_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -319,7 +319,7 @@ def get_local_path_item_query_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/Url/url/operations/_paths_operations.py b/test/vanilla/Expected/AcceptanceTests/Url/url/operations/_paths_operations.py index 4979a48d67b..363c721f75d 100644 --- a/test/vanilla/Expected/AcceptanceTests/Url/url/operations/_paths_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Url/url/operations/_paths_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class PathsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -86,7 +86,7 @@ def get_boolean_true( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -135,7 +135,7 @@ def get_boolean_false( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -184,7 +184,7 @@ def get_int_one_million( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -233,7 +233,7 @@ def get_int_negative_one_million( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -282,7 +282,7 @@ def get_ten_billion( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -331,7 +331,7 @@ def get_negative_ten_billion( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -380,7 +380,7 @@ def float_scientific_positive( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -429,7 +429,7 @@ def float_scientific_negative( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -478,7 +478,7 @@ def double_decimal_positive( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -527,7 +527,7 @@ def double_decimal_negative( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -576,7 +576,7 @@ def string_unicode( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -625,7 +625,7 @@ def string_url_encoded( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -676,7 +676,7 @@ def string_url_non_encoded( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -725,7 +725,7 @@ def string_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -776,7 +776,7 @@ def string_null( if response.status_code not in [400]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -787,7 +787,7 @@ def string_null( @distributed_trace def enum_valid( self, - enum_path, # type: Union[str, "models.UriColor"] + enum_path, # type: Union[str, "_models.UriColor"] **kwargs # type: Any ): # type: (...) -> None @@ -827,7 +827,7 @@ def enum_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -838,7 +838,7 @@ def enum_valid( @distributed_trace def enum_null( self, - enum_path, # type: Union[str, "models.UriColor"] + enum_path, # type: Union[str, "_models.UriColor"] **kwargs # type: Any ): # type: (...) -> None @@ -878,7 +878,7 @@ def enum_null( if response.status_code not in [400]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -929,7 +929,7 @@ def byte_multi_byte( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -978,7 +978,7 @@ def byte_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1029,7 +1029,7 @@ def byte_null( if response.status_code not in [400]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1078,7 +1078,7 @@ def date_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1130,7 +1130,7 @@ def date_null( if response.status_code not in [400]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1179,7 +1179,7 @@ def date_time_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1230,7 +1230,7 @@ def date_time_null( if response.status_code not in [400]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1281,7 +1281,7 @@ def base64_url( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1334,7 +1334,7 @@ def array_csv_in_path( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1385,7 +1385,7 @@ def unix_time_url( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/Url/url/operations/_queries_operations.py b/test/vanilla/Expected/AcceptanceTests/Url/url/operations/_queries_operations.py index 93f02db7489..a7cbdb04775 100644 --- a/test/vanilla/Expected/AcceptanceTests/Url/url/operations/_queries_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Url/url/operations/_queries_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class QueriesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -83,7 +83,7 @@ def get_boolean_true( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -129,7 +129,7 @@ def get_boolean_false( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -178,7 +178,7 @@ def get_boolean_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -224,7 +224,7 @@ def get_int_one_million( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -270,7 +270,7 @@ def get_int_negative_one_million( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -319,7 +319,7 @@ def get_int_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -365,7 +365,7 @@ def get_ten_billion( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -411,7 +411,7 @@ def get_negative_ten_billion( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -460,7 +460,7 @@ def get_long_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -506,7 +506,7 @@ def float_scientific_positive( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -552,7 +552,7 @@ def float_scientific_negative( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -601,7 +601,7 @@ def float_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -647,7 +647,7 @@ def double_decimal_positive( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -693,7 +693,7 @@ def double_decimal_negative( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -742,7 +742,7 @@ def double_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -788,7 +788,7 @@ def string_unicode( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -834,7 +834,7 @@ def string_url_encoded( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -880,7 +880,7 @@ def string_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -929,7 +929,7 @@ def string_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -940,7 +940,7 @@ def string_null( @distributed_trace def enum_valid( self, - enum_query=None, # type: Optional[Union[str, "models.UriColor"]] + enum_query=None, # type: Optional[Union[str, "_models.UriColor"]] **kwargs # type: Any ): # type: (...) -> None @@ -978,7 +978,7 @@ def enum_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -989,7 +989,7 @@ def enum_valid( @distributed_trace def enum_null( self, - enum_query=None, # type: Optional[Union[str, "models.UriColor"]] + enum_query=None, # type: Optional[Union[str, "_models.UriColor"]] **kwargs # type: Any ): # type: (...) -> None @@ -1027,7 +1027,7 @@ def enum_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1076,7 +1076,7 @@ def byte_multi_byte( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1122,7 +1122,7 @@ def byte_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1171,7 +1171,7 @@ def byte_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1217,7 +1217,7 @@ def date_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1266,7 +1266,7 @@ def date_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1312,7 +1312,7 @@ def date_time_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1361,7 +1361,7 @@ def date_time_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1412,7 +1412,7 @@ def array_string_csv_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1461,7 +1461,7 @@ def array_string_csv_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1510,7 +1510,7 @@ def array_string_csv_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1560,7 +1560,7 @@ def array_string_no_collection_format_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1611,7 +1611,7 @@ def array_string_ssv_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1662,7 +1662,7 @@ def array_string_tsv_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -1713,7 +1713,7 @@ def array_string_pipes_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/UrlMultiCollectionFormat/urlmulticollectionformat/aio/operations/_queries_operations.py b/test/vanilla/Expected/AcceptanceTests/UrlMultiCollectionFormat/urlmulticollectionformat/aio/operations/_queries_operations.py index 4d942ec8166..2fae7ddd6ed 100644 --- a/test/vanilla/Expected/AcceptanceTests/UrlMultiCollectionFormat/urlmulticollectionformat/aio/operations/_queries_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/UrlMultiCollectionFormat/urlmulticollectionformat/aio/operations/_queries_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class QueriesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -80,7 +80,7 @@ async def array_string_multi_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -128,7 +128,7 @@ async def array_string_multi_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -178,7 +178,7 @@ async def array_string_multi_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/UrlMultiCollectionFormat/urlmulticollectionformat/operations/_queries_operations.py b/test/vanilla/Expected/AcceptanceTests/UrlMultiCollectionFormat/urlmulticollectionformat/operations/_queries_operations.py index 3449afdda00..bf00b40f51e 100644 --- a/test/vanilla/Expected/AcceptanceTests/UrlMultiCollectionFormat/urlmulticollectionformat/operations/_queries_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/UrlMultiCollectionFormat/urlmulticollectionformat/operations/_queries_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class QueriesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -85,7 +85,7 @@ def array_string_multi_null( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -134,7 +134,7 @@ def array_string_multi_empty( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -185,7 +185,7 @@ def array_string_multi_valid( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: diff --git a/test/vanilla/Expected/AcceptanceTests/Validation/validation/aio/operations/_auto_rest_validation_test_operations.py b/test/vanilla/Expected/AcceptanceTests/Validation/validation/aio/operations/_auto_rest_validation_test_operations.py index 2b613df1d55..e016ccabec7 100644 --- a/test/vanilla/Expected/AcceptanceTests/Validation/validation/aio/operations/_auto_rest_validation_test_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Validation/validation/aio/operations/_auto_rest_validation_test_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -26,7 +26,7 @@ async def validation_of_method_parameters( resource_group_name: str, id: int, **kwargs - ) -> "models.Product": + ) -> "_models.Product": """Validates input parameters on the method. See swagger for details. :param resource_group_name: Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. @@ -38,7 +38,7 @@ async def validation_of_method_parameters( :rtype: ~validation.models.Product :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -69,7 +69,7 @@ async def validation_of_method_parameters( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Product', pipeline_response) @@ -85,9 +85,9 @@ async def validation_of_body( self, resource_group_name: str, id: int, - body: Optional["models.Product"] = None, + body: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> "_models.Product": """Validates body parameters on the method. See swagger for details. :param resource_group_name: Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. @@ -101,7 +101,7 @@ async def validation_of_body( :rtype: ~validation.models.Product :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -140,7 +140,7 @@ async def validation_of_body( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Product', pipeline_response) @@ -199,9 +199,9 @@ async def get_with_constant_in_path( @distributed_trace_async async def post_with_constant_in_body( self, - body: Optional["models.Product"] = None, + body: Optional["_models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> "_models.Product": """post_with_constant_in_body. :param body: @@ -211,7 +211,7 @@ async def post_with_constant_in_body( :rtype: ~validation.models.Product :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/vanilla/Expected/AcceptanceTests/Validation/validation/operations/_auto_rest_validation_test_operations.py b/test/vanilla/Expected/AcceptanceTests/Validation/validation/operations/_auto_rest_validation_test_operations.py index 3316d22d1b5..23ad343224b 100644 --- a/test/vanilla/Expected/AcceptanceTests/Validation/validation/operations/_auto_rest_validation_test_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Validation/validation/operations/_auto_rest_validation_test_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -31,7 +31,7 @@ def validation_of_method_parameters( id, # type: int **kwargs # type: Any ): - # type: (...) -> "models.Product" + # type: (...) -> "_models.Product" """Validates input parameters on the method. See swagger for details. :param resource_group_name: Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. @@ -43,7 +43,7 @@ def validation_of_method_parameters( :rtype: ~validation.models.Product :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -74,7 +74,7 @@ def validation_of_method_parameters( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Product', pipeline_response) @@ -90,10 +90,10 @@ def validation_of_body( self, resource_group_name, # type: str id, # type: int - body=None, # type: Optional["models.Product"] + body=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" + # type: (...) -> "_models.Product" """Validates body parameters on the method. See swagger for details. :param resource_group_name: Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. @@ -107,7 +107,7 @@ def validation_of_body( :rtype: ~validation.models.Product :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -146,7 +146,7 @@ def validation_of_body( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Product', pipeline_response) @@ -206,10 +206,10 @@ def get_with_constant_in_path( @distributed_trace def post_with_constant_in_body( self, - body=None, # type: Optional["models.Product"] + body=None, # type: Optional["_models.Product"] **kwargs # type: Any ): - # type: (...) -> "models.Product" + # type: (...) -> "_models.Product" """post_with_constant_in_body. :param body: @@ -219,7 +219,7 @@ def post_with_constant_in_body( :rtype: ~validation.models.Product :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Product"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/vanilla/Expected/AcceptanceTests/Xml/xmlservice/aio/operations/_xml_operations.py b/test/vanilla/Expected/AcceptanceTests/Xml/xmlservice/aio/operations/_xml_operations.py index f991f3bb6ef..6de835a2357 100644 --- a/test/vanilla/Expected/AcceptanceTests/Xml/xmlservice/aio/operations/_xml_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Xml/xmlservice/aio/operations/_xml_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class XmlOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def get_complex_type_ref_no_meta( self, **kwargs - ) -> "models.RootWithRefAndNoMeta": + ) -> "_models.RootWithRefAndNoMeta": """Get a complex type that has a ref to a complex type with no XML node. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ async def get_complex_type_ref_no_meta( :rtype: ~xmlservice.models.RootWithRefAndNoMeta :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RootWithRefAndNoMeta"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RootWithRefAndNoMeta"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def get_complex_type_ref_no_meta( @distributed_trace_async async def put_complex_type_ref_no_meta( self, - model: "models.RootWithRefAndNoMeta", + model: "_models.RootWithRefAndNoMeta", **kwargs ) -> None: """Puts a complex type that has a ref to a complex type with no XML node. @@ -137,7 +137,7 @@ async def put_complex_type_ref_no_meta( async def get_complex_type_ref_with_meta( self, **kwargs - ) -> "models.RootWithRefAndMeta": + ) -> "_models.RootWithRefAndMeta": """Get a complex type that has a ref to a complex type with XML node. :keyword callable cls: A custom type or function that will be passed the direct response @@ -145,7 +145,7 @@ async def get_complex_type_ref_with_meta( :rtype: ~xmlservice.models.RootWithRefAndMeta :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RootWithRefAndMeta"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RootWithRefAndMeta"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -181,7 +181,7 @@ async def get_complex_type_ref_with_meta( @distributed_trace_async async def put_complex_type_ref_with_meta( self, - model: "models.RootWithRefAndMeta", + model: "_models.RootWithRefAndMeta", **kwargs ) -> None: """Puts a complex type that has a ref to a complex type with XML node. @@ -230,7 +230,7 @@ async def put_complex_type_ref_with_meta( async def get_simple( self, **kwargs - ) -> "models.Slideshow": + ) -> "_models.Slideshow": """Get a simple XML document. :keyword callable cls: A custom type or function that will be passed the direct response @@ -238,7 +238,7 @@ async def get_simple( :rtype: ~xmlservice.models.Slideshow :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Slideshow"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Slideshow"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -261,7 +261,7 @@ async def get_simple( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Slideshow', pipeline_response) @@ -275,7 +275,7 @@ async def get_simple( @distributed_trace_async async def put_simple( self, - slideshow: "models.Slideshow", + slideshow: "_models.Slideshow", **kwargs ) -> None: """Put a simple XML document. @@ -315,7 +315,7 @@ async def put_simple( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -327,7 +327,7 @@ async def put_simple( async def get_wrapped_lists( self, **kwargs - ) -> "models.AppleBarrel": + ) -> "_models.AppleBarrel": """Get an XML document with multiple wrapped lists. :keyword callable cls: A custom type or function that will be passed the direct response @@ -335,7 +335,7 @@ async def get_wrapped_lists( :rtype: ~xmlservice.models.AppleBarrel :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AppleBarrel"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppleBarrel"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -371,7 +371,7 @@ async def get_wrapped_lists( @distributed_trace_async async def put_wrapped_lists( self, - wrapped_lists: "models.AppleBarrel", + wrapped_lists: "_models.AppleBarrel", **kwargs ) -> None: """Put an XML document with multiple wrapped lists. @@ -411,7 +411,7 @@ async def put_wrapped_lists( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -466,7 +466,7 @@ async def get_headers( async def get_empty_list( self, **kwargs - ) -> "models.Slideshow": + ) -> "_models.Slideshow": """Get an empty list. :keyword callable cls: A custom type or function that will be passed the direct response @@ -474,7 +474,7 @@ async def get_empty_list( :rtype: ~xmlservice.models.Slideshow :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Slideshow"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Slideshow"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -510,7 +510,7 @@ async def get_empty_list( @distributed_trace_async async def put_empty_list( self, - slideshow: "models.Slideshow", + slideshow: "_models.Slideshow", **kwargs ) -> None: """Puts an empty list. @@ -559,7 +559,7 @@ async def put_empty_list( async def get_empty_wrapped_lists( self, **kwargs - ) -> "models.AppleBarrel": + ) -> "_models.AppleBarrel": """Gets some empty wrapped lists. :keyword callable cls: A custom type or function that will be passed the direct response @@ -567,7 +567,7 @@ async def get_empty_wrapped_lists( :rtype: ~xmlservice.models.AppleBarrel :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AppleBarrel"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppleBarrel"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -603,7 +603,7 @@ async def get_empty_wrapped_lists( @distributed_trace_async async def put_empty_wrapped_lists( self, - apple_barrel: "models.AppleBarrel", + apple_barrel: "_models.AppleBarrel", **kwargs ) -> None: """Puts some empty wrapped lists. @@ -652,7 +652,7 @@ async def put_empty_wrapped_lists( async def get_root_list( self, **kwargs - ) -> List["models.Banana"]: + ) -> List["_models.Banana"]: """Gets a list as the root element. :keyword callable cls: A custom type or function that will be passed the direct response @@ -660,7 +660,7 @@ async def get_root_list( :rtype: list[~xmlservice.models.Banana] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Banana"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Banana"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -696,7 +696,7 @@ async def get_root_list( @distributed_trace_async async def put_root_list( self, - bananas: List["models.Banana"], + bananas: List["_models.Banana"], **kwargs ) -> None: """Puts a list as the root element. @@ -746,7 +746,7 @@ async def put_root_list( async def get_root_list_single_item( self, **kwargs - ) -> List["models.Banana"]: + ) -> List["_models.Banana"]: """Gets a list with a single item. :keyword callable cls: A custom type or function that will be passed the direct response @@ -754,7 +754,7 @@ async def get_root_list_single_item( :rtype: list[~xmlservice.models.Banana] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Banana"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Banana"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -790,7 +790,7 @@ async def get_root_list_single_item( @distributed_trace_async async def put_root_list_single_item( self, - bananas: List["models.Banana"], + bananas: List["_models.Banana"], **kwargs ) -> None: """Puts a list with a single item. @@ -840,7 +840,7 @@ async def put_root_list_single_item( async def get_empty_root_list( self, **kwargs - ) -> List["models.Banana"]: + ) -> List["_models.Banana"]: """Gets an empty list as the root element. :keyword callable cls: A custom type or function that will be passed the direct response @@ -848,7 +848,7 @@ async def get_empty_root_list( :rtype: list[~xmlservice.models.Banana] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Banana"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Banana"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -884,7 +884,7 @@ async def get_empty_root_list( @distributed_trace_async async def put_empty_root_list( self, - bananas: List["models.Banana"], + bananas: List["_models.Banana"], **kwargs ) -> None: """Puts an empty list as the root element. @@ -934,7 +934,7 @@ async def put_empty_root_list( async def get_empty_child_element( self, **kwargs - ) -> "models.Banana": + ) -> "_models.Banana": """Gets an XML document with an empty child element. :keyword callable cls: A custom type or function that will be passed the direct response @@ -942,7 +942,7 @@ async def get_empty_child_element( :rtype: ~xmlservice.models.Banana :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Banana"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Banana"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -978,7 +978,7 @@ async def get_empty_child_element( @distributed_trace_async async def put_empty_child_element( self, - banana: "models.Banana", + banana: "_models.Banana", **kwargs ) -> None: """Puts a value with an empty child element. @@ -1027,7 +1027,7 @@ async def put_empty_child_element( async def list_containers( self, **kwargs - ) -> "models.ListContainersResponse": + ) -> "_models.ListContainersResponse": """Lists containers in a storage account. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1035,7 +1035,7 @@ async def list_containers( :rtype: ~xmlservice.models.ListContainersResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListContainersResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListContainersResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1074,7 +1074,7 @@ async def list_containers( async def get_service_properties( self, **kwargs - ) -> "models.StorageServiceProperties": + ) -> "_models.StorageServiceProperties": """Gets storage service properties. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1082,7 +1082,7 @@ async def get_service_properties( :rtype: ~xmlservice.models.StorageServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1122,7 +1122,7 @@ async def get_service_properties( @distributed_trace_async async def put_service_properties( self, - properties: "models.StorageServiceProperties", + properties: "_models.StorageServiceProperties", **kwargs ) -> None: """Puts storage service properties. @@ -1175,7 +1175,7 @@ async def put_service_properties( async def get_acls( self, **kwargs - ) -> List["models.SignedIdentifier"]: + ) -> List["_models.SignedIdentifier"]: """Gets storage ACLs for a container. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1183,7 +1183,7 @@ async def get_acls( :rtype: list[~xmlservice.models.SignedIdentifier] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.SignedIdentifier"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.SignedIdentifier"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1223,7 +1223,7 @@ async def get_acls( @distributed_trace_async async def put_acls( self, - properties: List["models.SignedIdentifier"], + properties: List["_models.SignedIdentifier"], **kwargs ) -> None: """Puts storage ACLs for a container. @@ -1277,7 +1277,7 @@ async def put_acls( async def list_blobs( self, **kwargs - ) -> "models.ListBlobsResponse": + ) -> "_models.ListBlobsResponse": """Lists blobs in a storage container. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1285,7 +1285,7 @@ async def list_blobs( :rtype: ~xmlservice.models.ListBlobsResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListBlobsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListBlobsResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1344,7 +1344,7 @@ async def json_input( } error_map.update(kwargs.pop('error_map', {})) - _properties = models.JSONInput(id=id) + _properties = _models.JSONInput(id=id) content_type = kwargs.pop("content_type", "application/json") # Construct URL @@ -1377,7 +1377,7 @@ async def json_input( async def json_output( self, **kwargs - ) -> "models.JSONOutput": + ) -> "_models.JSONOutput": """A Swagger with XML that has one operation that returns JSON. ID number 42. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1385,7 +1385,7 @@ async def json_output( :rtype: ~xmlservice.models.JSONOutput :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.JSONOutput"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.JSONOutput"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1422,7 +1422,7 @@ async def json_output( async def get_xms_text( self, **kwargs - ) -> "models.ObjectWithXMsTextProperty": + ) -> "_models.ObjectWithXMsTextProperty": """Get back an XML object with an x-ms-text property, which should translate to the returned object's 'language' property being 'english' and its 'content' property being 'I am text'. @@ -1431,7 +1431,7 @@ async def get_xms_text( :rtype: ~xmlservice.models.ObjectWithXMsTextProperty :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ObjectWithXMsTextProperty"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectWithXMsTextProperty"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/vanilla/Expected/AcceptanceTests/Xml/xmlservice/operations/_xml_operations.py b/test/vanilla/Expected/AcceptanceTests/Xml/xmlservice/operations/_xml_operations.py index 667c77154ab..4b29f26b47b 100644 --- a/test/vanilla/Expected/AcceptanceTests/Xml/xmlservice/operations/_xml_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/Xml/xmlservice/operations/_xml_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class XmlOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def get_complex_type_ref_no_meta( self, **kwargs # type: Any ): - # type: (...) -> "models.RootWithRefAndNoMeta" + # type: (...) -> "_models.RootWithRefAndNoMeta" """Get a complex type that has a ref to a complex type with no XML node. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def get_complex_type_ref_no_meta( :rtype: ~xmlservice.models.RootWithRefAndNoMeta :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RootWithRefAndNoMeta"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RootWithRefAndNoMeta"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def get_complex_type_ref_no_meta( @distributed_trace def put_complex_type_ref_no_meta( self, - model, # type: "models.RootWithRefAndNoMeta" + model, # type: "_models.RootWithRefAndNoMeta" **kwargs # type: Any ): # type: (...) -> None @@ -144,7 +144,7 @@ def get_complex_type_ref_with_meta( self, **kwargs # type: Any ): - # type: (...) -> "models.RootWithRefAndMeta" + # type: (...) -> "_models.RootWithRefAndMeta" """Get a complex type that has a ref to a complex type with XML node. :keyword callable cls: A custom type or function that will be passed the direct response @@ -152,7 +152,7 @@ def get_complex_type_ref_with_meta( :rtype: ~xmlservice.models.RootWithRefAndMeta :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RootWithRefAndMeta"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RootWithRefAndMeta"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -188,7 +188,7 @@ def get_complex_type_ref_with_meta( @distributed_trace def put_complex_type_ref_with_meta( self, - model, # type: "models.RootWithRefAndMeta" + model, # type: "_models.RootWithRefAndMeta" **kwargs # type: Any ): # type: (...) -> None @@ -239,7 +239,7 @@ def get_simple( self, **kwargs # type: Any ): - # type: (...) -> "models.Slideshow" + # type: (...) -> "_models.Slideshow" """Get a simple XML document. :keyword callable cls: A custom type or function that will be passed the direct response @@ -247,7 +247,7 @@ def get_simple( :rtype: ~xmlservice.models.Slideshow :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Slideshow"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Slideshow"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,7 +270,7 @@ def get_simple( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('Slideshow', pipeline_response) @@ -284,7 +284,7 @@ def get_simple( @distributed_trace def put_simple( self, - slideshow, # type: "models.Slideshow" + slideshow, # type: "_models.Slideshow" **kwargs # type: Any ): # type: (...) -> None @@ -325,7 +325,7 @@ def put_simple( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -338,7 +338,7 @@ def get_wrapped_lists( self, **kwargs # type: Any ): - # type: (...) -> "models.AppleBarrel" + # type: (...) -> "_models.AppleBarrel" """Get an XML document with multiple wrapped lists. :keyword callable cls: A custom type or function that will be passed the direct response @@ -346,7 +346,7 @@ def get_wrapped_lists( :rtype: ~xmlservice.models.AppleBarrel :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AppleBarrel"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppleBarrel"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -382,7 +382,7 @@ def get_wrapped_lists( @distributed_trace def put_wrapped_lists( self, - wrapped_lists, # type: "models.AppleBarrel" + wrapped_lists, # type: "_models.AppleBarrel" **kwargs # type: Any ): # type: (...) -> None @@ -423,7 +423,7 @@ def put_wrapped_lists( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.Error, response) + error = self._deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error) if cls: @@ -480,7 +480,7 @@ def get_empty_list( self, **kwargs # type: Any ): - # type: (...) -> "models.Slideshow" + # type: (...) -> "_models.Slideshow" """Get an empty list. :keyword callable cls: A custom type or function that will be passed the direct response @@ -488,7 +488,7 @@ def get_empty_list( :rtype: ~xmlservice.models.Slideshow :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Slideshow"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Slideshow"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -524,7 +524,7 @@ def get_empty_list( @distributed_trace def put_empty_list( self, - slideshow, # type: "models.Slideshow" + slideshow, # type: "_models.Slideshow" **kwargs # type: Any ): # type: (...) -> None @@ -575,7 +575,7 @@ def get_empty_wrapped_lists( self, **kwargs # type: Any ): - # type: (...) -> "models.AppleBarrel" + # type: (...) -> "_models.AppleBarrel" """Gets some empty wrapped lists. :keyword callable cls: A custom type or function that will be passed the direct response @@ -583,7 +583,7 @@ def get_empty_wrapped_lists( :rtype: ~xmlservice.models.AppleBarrel :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AppleBarrel"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppleBarrel"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -619,7 +619,7 @@ def get_empty_wrapped_lists( @distributed_trace def put_empty_wrapped_lists( self, - apple_barrel, # type: "models.AppleBarrel" + apple_barrel, # type: "_models.AppleBarrel" **kwargs # type: Any ): # type: (...) -> None @@ -670,7 +670,7 @@ def get_root_list( self, **kwargs # type: Any ): - # type: (...) -> List["models.Banana"] + # type: (...) -> List["_models.Banana"] """Gets a list as the root element. :keyword callable cls: A custom type or function that will be passed the direct response @@ -678,7 +678,7 @@ def get_root_list( :rtype: list[~xmlservice.models.Banana] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Banana"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Banana"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -714,7 +714,7 @@ def get_root_list( @distributed_trace def put_root_list( self, - bananas, # type: List["models.Banana"] + bananas, # type: List["_models.Banana"] **kwargs # type: Any ): # type: (...) -> None @@ -766,7 +766,7 @@ def get_root_list_single_item( self, **kwargs # type: Any ): - # type: (...) -> List["models.Banana"] + # type: (...) -> List["_models.Banana"] """Gets a list with a single item. :keyword callable cls: A custom type or function that will be passed the direct response @@ -774,7 +774,7 @@ def get_root_list_single_item( :rtype: list[~xmlservice.models.Banana] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Banana"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Banana"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -810,7 +810,7 @@ def get_root_list_single_item( @distributed_trace def put_root_list_single_item( self, - bananas, # type: List["models.Banana"] + bananas, # type: List["_models.Banana"] **kwargs # type: Any ): # type: (...) -> None @@ -862,7 +862,7 @@ def get_empty_root_list( self, **kwargs # type: Any ): - # type: (...) -> List["models.Banana"] + # type: (...) -> List["_models.Banana"] """Gets an empty list as the root element. :keyword callable cls: A custom type or function that will be passed the direct response @@ -870,7 +870,7 @@ def get_empty_root_list( :rtype: list[~xmlservice.models.Banana] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.Banana"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Banana"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -906,7 +906,7 @@ def get_empty_root_list( @distributed_trace def put_empty_root_list( self, - bananas, # type: List["models.Banana"] + bananas, # type: List["_models.Banana"] **kwargs # type: Any ): # type: (...) -> None @@ -958,7 +958,7 @@ def get_empty_child_element( self, **kwargs # type: Any ): - # type: (...) -> "models.Banana" + # type: (...) -> "_models.Banana" """Gets an XML document with an empty child element. :keyword callable cls: A custom type or function that will be passed the direct response @@ -966,7 +966,7 @@ def get_empty_child_element( :rtype: ~xmlservice.models.Banana :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Banana"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Banana"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1002,7 +1002,7 @@ def get_empty_child_element( @distributed_trace def put_empty_child_element( self, - banana, # type: "models.Banana" + banana, # type: "_models.Banana" **kwargs # type: Any ): # type: (...) -> None @@ -1053,7 +1053,7 @@ def list_containers( self, **kwargs # type: Any ): - # type: (...) -> "models.ListContainersResponse" + # type: (...) -> "_models.ListContainersResponse" """Lists containers in a storage account. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1061,7 +1061,7 @@ def list_containers( :rtype: ~xmlservice.models.ListContainersResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListContainersResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListContainersResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1101,7 +1101,7 @@ def get_service_properties( self, **kwargs # type: Any ): - # type: (...) -> "models.StorageServiceProperties" + # type: (...) -> "_models.StorageServiceProperties" """Gets storage service properties. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1109,7 +1109,7 @@ def get_service_properties( :rtype: ~xmlservice.models.StorageServiceProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.StorageServiceProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageServiceProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1149,7 +1149,7 @@ def get_service_properties( @distributed_trace def put_service_properties( self, - properties, # type: "models.StorageServiceProperties" + properties, # type: "_models.StorageServiceProperties" **kwargs # type: Any ): # type: (...) -> None @@ -1204,7 +1204,7 @@ def get_acls( self, **kwargs # type: Any ): - # type: (...) -> List["models.SignedIdentifier"] + # type: (...) -> List["_models.SignedIdentifier"] """Gets storage ACLs for a container. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1212,7 +1212,7 @@ def get_acls( :rtype: list[~xmlservice.models.SignedIdentifier] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.SignedIdentifier"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.SignedIdentifier"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1252,7 +1252,7 @@ def get_acls( @distributed_trace def put_acls( self, - properties, # type: List["models.SignedIdentifier"] + properties, # type: List["_models.SignedIdentifier"] **kwargs # type: Any ): # type: (...) -> None @@ -1308,7 +1308,7 @@ def list_blobs( self, **kwargs # type: Any ): - # type: (...) -> "models.ListBlobsResponse" + # type: (...) -> "_models.ListBlobsResponse" """Lists blobs in a storage container. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1316,7 +1316,7 @@ def list_blobs( :rtype: ~xmlservice.models.ListBlobsResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListBlobsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListBlobsResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1376,7 +1376,7 @@ def json_input( } error_map.update(kwargs.pop('error_map', {})) - _properties = models.JSONInput(id=id) + _properties = _models.JSONInput(id=id) content_type = kwargs.pop("content_type", "application/json") # Construct URL @@ -1410,7 +1410,7 @@ def json_output( self, **kwargs # type: Any ): - # type: (...) -> "models.JSONOutput" + # type: (...) -> "_models.JSONOutput" """A Swagger with XML that has one operation that returns JSON. ID number 42. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1418,7 +1418,7 @@ def json_output( :rtype: ~xmlservice.models.JSONOutput :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.JSONOutput"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.JSONOutput"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1456,7 +1456,7 @@ def get_xms_text( self, **kwargs # type: Any ): - # type: (...) -> "models.ObjectWithXMsTextProperty" + # type: (...) -> "_models.ObjectWithXMsTextProperty" """Get back an XML object with an x-ms-text property, which should translate to the returned object's 'language' property being 'english' and its 'content' property being 'I am text'. @@ -1465,7 +1465,7 @@ def get_xms_text( :rtype: ~xmlservice.models.ObjectWithXMsTextProperty :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ObjectWithXMsTextProperty"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectWithXMsTextProperty"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/test/vanilla/Expected/AcceptanceTests/XmsErrorResponse/xmserrorresponse/aio/operations/_pet_operations.py b/test/vanilla/Expected/AcceptanceTests/XmsErrorResponse/xmserrorresponse/aio/operations/_pet_operations.py index 99d0522525d..01cea9dca27 100644 --- a/test/vanilla/Expected/AcceptanceTests/XmsErrorResponse/xmserrorresponse/aio/operations/_pet_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/XmsErrorResponse/xmserrorresponse/aio/operations/_pet_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class PetOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ async def get_pet_by_id( self, pet_id: str, **kwargs - ) -> Optional["models.Pet"]: + ) -> Optional["_models.Pet"]: """Gets pets by id. :param pet_id: pet id. @@ -55,12 +55,12 @@ async def get_pet_by_id( :rtype: ~xmserrorresponse.models.Pet or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Pet"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Pet"]] error_map = { 401: ClientAuthenticationError, 409: ResourceExistsError, 400: HttpResponseError, - 404: lambda response: ResourceNotFoundError(response=response, model=self._deserialize(models.NotFoundErrorBase, response)), + 404: lambda response: ResourceNotFoundError(response=response, model=self._deserialize(_models.NotFoundErrorBase, response)), 501: HttpResponseError, } error_map.update(kwargs.pop('error_map', {})) @@ -103,7 +103,7 @@ async def do_something( self, what_action: str, **kwargs - ) -> "models.PetAction": + ) -> "_models.PetAction": """Asks pet to do something. :param what_action: what action the pet should do. @@ -113,12 +113,12 @@ async def do_something( :rtype: ~xmserrorresponse.models.PetAction :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PetAction"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PetAction"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, - 500: lambda response: HttpResponseError(response=response, model=self._deserialize(models.PetActionError, response)), + 500: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.PetActionError, response)), } error_map.update(kwargs.pop('error_map', {})) accept = "application/json" @@ -143,7 +143,7 @@ async def do_something( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.PetActionError, response) + error = self._deserialize(_models.PetActionError, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('PetAction', pipeline_response) diff --git a/test/vanilla/Expected/AcceptanceTests/XmsErrorResponse/xmserrorresponse/operations/_pet_operations.py b/test/vanilla/Expected/AcceptanceTests/XmsErrorResponse/xmserrorresponse/operations/_pet_operations.py index 64b1ba8c3f5..21f86989bbe 100644 --- a/test/vanilla/Expected/AcceptanceTests/XmsErrorResponse/xmserrorresponse/operations/_pet_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/XmsErrorResponse/xmserrorresponse/operations/_pet_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class PetOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def get_pet_by_id( pet_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.Pet"] + # type: (...) -> Optional["_models.Pet"] """Gets pets by id. :param pet_id: pet id. @@ -60,12 +60,12 @@ def get_pet_by_id( :rtype: ~xmserrorresponse.models.Pet or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Pet"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Pet"]] error_map = { 401: ClientAuthenticationError, 409: ResourceExistsError, 400: HttpResponseError, - 404: lambda response: ResourceNotFoundError(response=response, model=self._deserialize(models.NotFoundErrorBase, response)), + 404: lambda response: ResourceNotFoundError(response=response, model=self._deserialize(_models.NotFoundErrorBase, response)), 501: HttpResponseError, } error_map.update(kwargs.pop('error_map', {})) @@ -109,7 +109,7 @@ def do_something( what_action, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PetAction" + # type: (...) -> "_models.PetAction" """Asks pet to do something. :param what_action: what action the pet should do. @@ -119,12 +119,12 @@ def do_something( :rtype: ~xmserrorresponse.models.PetAction :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PetAction"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PetAction"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, - 500: lambda response: HttpResponseError(response=response, model=self._deserialize(models.PetActionError, response)), + 500: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.PetActionError, response)), } error_map.update(kwargs.pop('error_map', {})) accept = "application/json" @@ -149,7 +149,7 @@ def do_something( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.PetActionError, response) + error = self._deserialize(_models.PetActionError, response) raise HttpResponseError(response=response, model=error) deserialized = self._deserialize('PetAction', pipeline_response)