From 57a3c1ae3ff4dbf1c27c97d255957bd246e6b23a Mon Sep 17 00:00:00 2001 From: tadelesh Date: Sun, 7 Apr 2024 16:14:10 +0800 Subject: [PATCH] fix pyright and regen --- .../autorest/codegen/models/operation.py | 10 + .../codegen/serializers/builder_serializer.py | 2 +- .../sample/aio/operations/_operations.py | 8 +- .../sample/operations/_operations.py | 8 +- .../sample/aio/operations/_operations.py | 8 +- .../basic/sample/operations/_operations.py | 8 +- .../sample/_operations/_operations.py | 4 +- .../sample/aio/_operations/_operations.py | 4 +- .../operations/_http_success_operations.py | 8 +- .../operations/_http_success_operations.py | 8 +- .../_multiapi_service_client_operations.py | 10 +- .../_operation_group_one_operations.py | 4 +- .../_multiapi_service_client_operations.py | 10 +- .../_operation_group_one_operations.py | 4 +- .../_multiapi_service_client_operations.py | 6 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_two_operations.py | 4 +- .../_multiapi_service_client_operations.py | 6 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_two_operations.py | 4 +- .../_multiapi_service_client_operations.py | 6 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_two_operations.py | 4 +- .../_multiapi_service_client_operations.py | 6 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_two_operations.py | 4 +- .../aio/operations/_duration_operations.py | 10 +- .../operations/_duration_operations.py | 10 +- .../_parameter_grouping_operations.py | 14 +- .../_parameter_grouping_operations.py | 14 +- ...est_report_service_for_azure_operations.py | 4 +- ...est_report_service_for_azure_operations.py | 4 +- .../_api_version_default_operations.py | 10 +- .../_api_version_local_operations.py | 10 +- .../aio/operations/_header_operations.py | 8 +- .../aio/operations/_odata_operations.py | 4 +- .../_skip_url_encoding_operations.py | 16 +- ..._subscription_in_credentials_operations.py | 12 +- .../_subscription_in_method_operations.py | 10 +- .../_xms_client_request_id_operations.py | 6 +- .../_api_version_default_operations.py | 10 +- .../_api_version_local_operations.py | 10 +- .../operations/_header_operations.py | 8 +- .../operations/_odata_operations.py | 4 +- .../_skip_url_encoding_operations.py | 16 +- ..._subscription_in_credentials_operations.py | 12 +- .../_subscription_in_method_operations.py | 10 +- .../_xms_client_request_id_operations.py | 6 +- .../aio/operations/_paths_operations.py | 4 +- .../operations/_paths_operations.py | 4 +- .../aio/operations/_paging_operations.py | 48 ++-- .../operations/_paging_operations.py | 48 ++-- .../aio/operations/_paging_operations.py | 6 +- .../operations/_paging_operations.py | 6 +- .../operations/_http_success_operations.py | 8 +- .../operations/_http_success_operations.py | 8 +- .../operations/_head_exception_operations.py | 8 +- .../operations/_head_exception_operations.py | 8 +- .../operations/_http_success_operations.py | 8 +- .../operations/_http_success_operations.py | 8 +- .../_lr_os_custom_header_operations.py | 8 +- .../aio/operations/_lro_retrys_operations.py | 14 +- .../lro/aio/operations/_lros_operations.py | 88 +++---- .../lro/aio/operations/_lrosads_operations.py | 52 ++-- .../_lr_os_custom_header_operations.py | 8 +- .../lro/operations/_lro_retrys_operations.py | 14 +- .../Lro/lro/operations/_lros_operations.py | 88 +++---- .../Lro/lro/operations/_lrosads_operations.py | 52 ++-- ...with_paramaterized_endpoints_operations.py | 4 +- ...with_paramaterized_endpoints_operations.py | 4 +- .../_api_version_default_operations.py | 10 +- .../_api_version_local_operations.py | 10 +- .../aio/operations/_header_operations.py | 8 +- .../operations/_http_success_operations.py | 8 +- .../aio/operations/_odata_operations.py | 4 +- .../_skip_url_encoding_operations.py | 16 +- ..._subscription_in_credentials_operations.py | 12 +- .../_subscription_in_method_operations.py | 10 +- .../_xms_client_request_id_operations.py | 6 +- .../_api_version_default_operations.py | 10 +- .../_api_version_local_operations.py | 10 +- .../operations/_header_operations.py | 8 +- .../operations/_http_success_operations.py | 8 +- .../operations/_odata_operations.py | 4 +- .../_skip_url_encoding_operations.py | 16 +- ..._subscription_in_credentials_operations.py | 12 +- .../_subscription_in_method_operations.py | 10 +- .../_xms_client_request_id_operations.py | 6 +- .../operations/_http_success_operations.py | 8 +- .../operations/_http_success_operations.py | 8 +- .../aio/operations/_paging_operations.py | 48 ++-- .../paging/operations/_paging_operations.py | 48 ++-- .../operations/_http_success_operations.py | 8 +- .../operations/_http_success_operations.py | 8 +- .../operations/_http_success_operations.py | 8 +- .../operations/_http_success_operations.py | 8 +- .../operations/_http_success_operations.py | 8 +- .../operations/_http_success_operations.py | 8 +- .../aio/operations/_paging_operations.py | 48 ++-- .../paging/operations/_paging_operations.py | 48 ++-- .../_autorest_security_aad_operations.py | 4 +- .../_autorest_security_aad_operations.py | 4 +- .../_autorest_security_key_operations.py | 4 +- .../_autorest_security_key_operations.py | 4 +- .../_storage_accounts_operations.py | 18 +- .../aio/operations/_usage_operations.py | 4 +- .../_storage_accounts_operations.py | 18 +- .../storage/operations/_usage_operations.py | 4 +- .../aio/operations/_group_operations.py | 4 +- .../operations/_group_operations.py | 4 +- .../aio/operations/_operations.py | 10 +- .../operations/_operations.py | 10 +- .../aio/operations/_operations.py | 14 +- .../operations/_operations.py | 14 +- .../_operations/_operations.py | 4 +- .../aio/_operations/_operations.py | 4 +- .../aio/operations/_operations.py | 62 ++--- .../operations/_operations.py | 62 ++--- .../aio/operations/_operations.py | 4 +- .../operations/_operations.py | 4 +- .../aio/operations/_operations.py | 48 ++-- .../operations/_operations.py | 48 ++-- .../aio/operations/_operations.py | 6 +- .../operations/_operations.py | 6 +- .../aio/operations/_operations.py | 8 +- .../operations/_operations.py | 8 +- .../aio/operations/_operations.py | 8 +- .../operations/_operations.py | 8 +- .../aio/operations/_operations.py | 6 +- .../operations/_operations.py | 6 +- .../aio/operations/_operations.py | 162 ++++++------- .../operations/_operations.py | 162 ++++++------- .../_operations/_operations.py | 4 +- .../aio/_operations/_operations.py | 4 +- .../aio/operations/_operations.py | 48 ++-- .../operations/_operations.py | 48 ++-- .../aio/operations/_operations.py | 20 +- .../operations/_operations.py | 20 +- .../aio/operations/_operations.py | 4 +- .../operations/_operations.py | 4 +- .../_operations/_operations.py | 8 +- .../aio/_operations/_operations.py | 8 +- .../_operations/_operations.py | 8 +- .../aio/_operations/_operations.py | 8 +- .../aio/operations/_operations.py | 10 +- .../operations/_operations.py | 10 +- .../aio/operations/_operations.py | 14 +- .../operations/_operations.py | 14 +- .../_operations/_operations.py | 8 +- .../aio/_operations/_operations.py | 8 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_one_operations.py | 4 +- .../_multiapi_service_client_operations.py | 10 +- .../_operation_group_one_operations.py | 4 +- .../_multiapi_service_client_operations.py | 10 +- .../_operation_group_one_operations.py | 4 +- .../_multiapi_service_client_operations.py | 6 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_two_operations.py | 4 +- .../_multiapi_service_client_operations.py | 6 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_two_operations.py | 4 +- .../_multiapi_service_client_operations.py | 6 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_two_operations.py | 4 +- .../_multiapi_service_client_operations.py | 6 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_two_operations.py | 4 +- .../_multiapi_service_client_operations.py | 10 +- .../_operation_group_one_operations.py | 4 +- .../_multiapi_service_client_operations.py | 10 +- .../_operation_group_one_operations.py | 4 +- .../_multiapi_service_client_operations.py | 6 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_two_operations.py | 4 +- .../_multiapi_service_client_operations.py | 6 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_two_operations.py | 4 +- .../_multiapi_service_client_operations.py | 6 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_two_operations.py | 4 +- .../_multiapi_service_client_operations.py | 6 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_two_operations.py | 4 +- ...stom_base_url_service_client_operations.py | 4 +- ...stom_base_url_service_client_operations.py | 4 +- ...stom_base_url_service_client_operations.py | 4 +- ...stom_base_url_service_client_operations.py | 4 +- .../_multiapi_service_client_operations.py | 10 +- .../_operation_group_one_operations.py | 4 +- .../_multiapi_service_client_operations.py | 10 +- .../_operation_group_one_operations.py | 4 +- .../_multiapi_service_client_operations.py | 6 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_two_operations.py | 4 +- .../_multiapi_service_client_operations.py | 6 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_two_operations.py | 4 +- .../_multiapi_service_client_operations.py | 6 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_two_operations.py | 4 +- .../_multiapi_service_client_operations.py | 6 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_two_operations.py | 4 +- .../_multiapi_service_client_operations.py | 10 +- .../_operation_group_one_operations.py | 4 +- .../_multiapi_service_client_operations.py | 10 +- .../_operation_group_one_operations.py | 4 +- .../_multiapi_service_client_operations.py | 6 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_two_operations.py | 4 +- .../_multiapi_service_client_operations.py | 6 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_two_operations.py | 4 +- .../_multiapi_service_client_operations.py | 6 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_two_operations.py | 4 +- .../_multiapi_service_client_operations.py | 6 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_two_operations.py | 4 +- .../_multiapi_service_client_operations.py | 10 +- .../_operation_group_one_operations.py | 4 +- .../_multiapi_service_client_operations.py | 6 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_two_operations.py | 4 +- .../_multiapi_service_client_operations.py | 6 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_two_operations.py | 4 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_one_operations.py | 4 +- .../_multiapi_service_client_operations.py | 10 +- .../_operation_group_one_operations.py | 4 +- .../_multiapi_service_client_operations.py | 10 +- .../_operation_group_one_operations.py | 4 +- .../_multiapi_service_client_operations.py | 10 +- .../_operation_group_one_operations.py | 4 +- .../_multiapi_service_client_operations.py | 10 +- .../_operation_group_one_operations.py | 4 +- .../_multiapi_service_client_operations.py | 6 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_two_operations.py | 4 +- .../_multiapi_service_client_operations.py | 6 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_two_operations.py | 4 +- .../_multiapi_service_client_operations.py | 6 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_two_operations.py | 4 +- .../_multiapi_service_client_operations.py | 6 +- .../_operation_group_one_operations.py | 4 +- .../_operation_group_two_operations.py | 4 +- .../aio/operations/_operations.py | 22 +- .../operations/_operations.py | 22 +- .../v1/aio/operations/_operations.py | 12 +- .../v1/operations/_operations.py | 12 +- .../v2/aio/operations/_operations.py | 10 +- .../v2/operations/_operations.py | 10 +- .../v3/aio/operations/_operations.py | 12 +- .../v3/operations/_operations.py | 12 +- .../aio/operations/_pets_operations.py | 12 +- .../operations/_pets_operations.py | 12 +- .../operations/_anything_client_operations.py | 14 +- .../operations/_anything_client_operations.py | 14 +- .../aio/operations/_array_operations.py | 138 +++++------ .../bodyarray/operations/_array_operations.py | 138 +++++------ .../array/aio/operations/_array_operations.py | 138 +++++------ .../array/operations/_array_operations.py | 138 +++++------ .../aio/operations/_download_operations.py | 4 +- .../aio/operations/_upload_operations.py | 6 +- .../operations/_download_operations.py | 4 +- .../operations/_upload_operations.py | 6 +- .../aio/operations/_bool_operations.py | 14 +- .../operations/_bool_operations.py | 14 +- .../aio/operations/_byte_operations.py | 12 +- .../bodybyte/operations/_byte_operations.py | 12 +- .../aio/operations/_byte_operations.py | 12 +- .../operations/_byte_operations.py | 12 +- .../aio/operations/_array_operations.py | 12 +- .../aio/operations/_basic_operations.py | 12 +- .../aio/operations/_dictionary_operations.py | 14 +- .../operations/_flattencomplex_operations.py | 4 +- .../aio/operations/_inheritance_operations.py | 4 +- .../_polymorphicrecursive_operations.py | 4 +- .../operations/_polymorphism_operations.py | 18 +- .../aio/operations/_primitive_operations.py | 44 ++-- .../_readonlyproperty_operations.py | 6 +- .../operations/_array_operations.py | 12 +- .../operations/_basic_operations.py | 12 +- .../operations/_dictionary_operations.py | 14 +- .../operations/_flattencomplex_operations.py | 4 +- .../operations/_inheritance_operations.py | 4 +- .../_polymorphicrecursive_operations.py | 4 +- .../operations/_polymorphism_operations.py | 18 +- .../operations/_primitive_operations.py | 44 ++-- .../_readonlyproperty_operations.py | 6 +- .../aio/operations/_date_operations.py | 18 +- .../bodydate/operations/_date_operations.py | 18 +- .../aio/operations/_datetime_operations.py | 46 ++-- .../operations/_datetime_operations.py | 46 ++-- .../operations/_datetimerfc1123_operations.py | 20 +- .../operations/_datetimerfc1123_operations.py | 20 +- .../aio/operations/_dictionary_operations.py | 130 +++++----- .../operations/_dictionary_operations.py | 130 +++++----- .../aio/operations/_duration_operations.py | 10 +- .../operations/_duration_operations.py | 10 +- .../aio/operations/_files_operations.py | 8 +- .../bodyfile/operations/_files_operations.py | 8 +- .../aio/operations/_formdata_operations.py | 8 +- .../operations/_formdata_operations.py | 8 +- .../_formdataurlencoded_operations.py | 4 +- .../_formdataurlencoded_operations.py | 4 +- .../operations/_int_operations_operations.py | 30 +-- .../operations/_int_operations_operations.py | 30 +-- .../aio/operations/_number_operations.py | 50 ++-- .../operations/_number_operations.py | 50 ++-- .../aio/operations/_enum_operations.py | 12 +- .../aio/operations/_string_operations.py | 28 +-- .../bodystring/operations/_enum_operations.py | 12 +- .../operations/_string_operations.py | 28 +-- .../aio/operations/_time_operations.py | 6 +- .../bodytime/operations/_time_operations.py | 6 +- .../_client_with_enum_operations.py | 4 +- .../_client_with_enum_operations.py | 2 +- .../aio/operations/_contants_operations.py | 34 +-- .../operations/_contants_operations.py | 34 +-- .../aio/operations/_paths_operations.py | 4 +- .../operations/_paths_operations.py | 4 +- .../aio/operations/_paths_operations.py | 4 +- .../operations/_paths_operations.py | 4 +- .../_error_with_secrets_operations.py | 6 +- .../_error_with_secrets_operations.py | 6 +- .../aio/operations/_pet_operations.py | 4 +- .../operations/_pet_operations.py | 4 +- .../aio/operations/_header_operations.py | 58 ++--- .../header/operations/_header_operations.py | 58 ++--- .../_http_client_failure_operations.py | 54 ++--- .../operations/_http_failure_operations.py | 8 +- .../operations/_http_redirects_operations.py | 34 +-- .../aio/operations/_http_retry_operations.py | 20 +- .../_http_server_failure_operations.py | 10 +- .../operations/_http_success_operations.py | 40 ++-- .../_multiple_responses_operations.py | 68 +++--- .../_http_client_failure_operations.py | 54 ++--- .../operations/_http_failure_operations.py | 8 +- .../operations/_http_redirects_operations.py | 34 +-- .../operations/_http_retry_operations.py | 20 +- .../_http_server_failure_operations.py | 10 +- .../operations/_http_success_operations.py | 40 ++-- .../_multiple_responses_operations.py | 68 +++--- ...correct_returned_error_model_operations.py | 4 +- ...correct_returned_error_model_operations.py | 4 +- .../_media_types_client_operations.py | 14 +- .../_media_types_client_operations.py | 14 +- .../_media_types_client_operations.py | 14 +- .../_media_types_client_operations.py | 14 +- .../_merge_patch_json_client_operations.py | 4 +- .../_merge_patch_json_client_operations.py | 4 +- ...urce_flattening_test_service_operations.py | 22 +- ...urce_flattening_test_service_operations.py | 22 +- ...e_inheritance_service_client_operations.py | 20 +- ...e_inheritance_service_client_operations.py | 20 +- .../aio/operations/_float_operations.py | 4 +- .../operations/_int_operations_operations.py | 4 +- .../operations/_float_operations.py | 4 +- .../operations/_int_operations_operations.py | 4 +- .../_object_type_client_operations.py | 6 +- .../_object_type_client_operations.py | 6 +- .../operations/_anything_client_operations.py | 14 +- .../operations/_anything_client_operations.py | 14 +- .../_availability_sets_operations.py | 4 +- .../_availability_sets_operations.py | 4 +- ...parmaterized_endpoint_client_operations.py | 4 +- ...parmaterized_endpoint_client_operations.py | 4 +- .../_auto_rest_report_service_operations.py | 6 +- .../_auto_rest_report_service_operations.py | 6 +- .../aio/operations/_explicit_operations.py | 48 ++-- .../aio/operations/_implicit_operations.py | 18 +- .../operations/_explicit_operations.py | 48 ++-- .../operations/_implicit_operations.py | 18 +- .../_import_operations_operations.py | 4 +- .../_reserved_words_client_operations.py | 12 +- .../_import_operations_operations.py | 4 +- .../_reserved_words_client_operations.py | 12 +- .../_autorest_security_aad_operations.py | 4 +- .../_autorest_security_aad_operations.py | 4 +- ..._aad_swagger_credential_flag_operations.py | 4 +- ..._aad_swagger_credential_flag_operations.py | 4 +- .../_autorest_security_key_operations.py | 4 +- .../_autorest_security_key_operations.py | 4 +- ..._key_swagger_credential_flag_operations.py | 4 +- ..._key_swagger_credential_flag_operations.py | 4 +- .../aio/operations/_path_items_operations.py | 10 +- .../url/aio/operations/_paths_operations.py | 54 ++--- .../url/aio/operations/_queries_operations.py | 70 +++--- .../url/operations/_path_items_operations.py | 10 +- .../Url/url/operations/_paths_operations.py | 54 ++--- .../Url/url/operations/_queries_operations.py | 70 +++--- .../aio/operations/_queries_operations.py | 8 +- .../operations/_queries_operations.py | 8 +- .../_auto_rest_validation_test_operations.py | 8 +- .../_auto_rest_validation_test_operations.py | 8 +- .../aio/operations/_xml_operations.py | 70 +++--- .../xmlservice/operations/_xml_operations.py | 70 +++--- .../aio/operations/_pet_operations.py | 8 +- .../operations/_pet_operations.py | 8 +- .../aio/operations/_operations.py | 12 +- .../operations/_operations.py | 12 +- .../_operations/_operations.py | 14 +- .../aio/_operations/_operations.py | 14 +- .../aio/operations/_operations.py | 138 +++++------ .../operations/_operations.py | 138 +++++------ .../aio/operations/_operations.py | 8 +- .../operations/_operations.py | 8 +- .../aio/operations/_operations.py | 14 +- .../operations/_operations.py | 14 +- .../aio/operations/_operations.py | 12 +- .../operations/_operations.py | 12 +- .../aio/operations/_operations.py | 110 ++++----- .../operations/_operations.py | 110 ++++----- .../aio/operations/_operations.py | 20 +- .../operations/_operations.py | 20 +- .../aio/operations/_operations.py | 46 ++-- .../operations/_operations.py | 46 ++-- .../aio/operations/_operations.py | 18 +- .../operations/_operations.py | 18 +- .../aio/operations/_operations.py | 130 +++++----- .../operations/_operations.py | 130 +++++----- .../aio/operations/_operations.py | 10 +- .../operations/_operations.py | 10 +- .../aio/operations/_operations.py | 8 +- .../operations/_operations.py | 8 +- .../aio/operations/_operations.py | 4 +- .../operations/_operations.py | 4 +- .../aio/operations/_operations.py | 30 +-- .../operations/_operations.py | 30 +-- .../aio/operations/_operations.py | 50 ++-- .../operations/_operations.py | 50 ++-- .../aio/operations/_operations.py | 38 +-- .../operations/_operations.py | 38 +-- .../aio/operations/_operations.py | 6 +- .../operations/_operations.py | 6 +- .../_operations/_operations.py | 2 +- .../aio/_operations/_operations.py | 4 +- .../aio/operations/_operations.py | 36 +-- .../operations/_operations.py | 36 +-- .../aio/operations/_operations.py | 4 +- .../operations/_operations.py | 4 +- .../aio/operations/_operations.py | 4 +- .../operations/_operations.py | 4 +- .../_operations/_operations.py | 6 +- .../aio/_operations/_operations.py | 6 +- .../aio/operations/_operations.py | 4 +- .../operations/_operations.py | 4 +- .../aio/operations/_operations.py | 60 ++--- .../operations/_operations.py | 60 ++--- .../aio/operations/_operations.py | 224 +++++++++--------- .../operations/_operations.py | 224 +++++++++--------- .../_operations/_operations.py | 4 +- .../aio/_operations/_operations.py | 4 +- .../_operations/_operations.py | 12 +- .../aio/_operations/_operations.py | 12 +- .../_operations/_operations.py | 4 +- .../aio/_operations/_operations.py | 4 +- .../_operations/_operations.py | 22 +- .../aio/_operations/_operations.py | 22 +- .../_operations/_operations.py | 20 +- .../aio/_operations/_operations.py | 20 +- .../_operations/_operations.py | 14 +- .../aio/_operations/_operations.py | 14 +- .../aio/operations/_operations.py | 10 +- .../operations/_operations.py | 10 +- .../_operations/_operations.py | 6 +- .../aio/_operations/_operations.py | 6 +- .../aio/operations/_operations.py | 2 +- .../operations/_operations.py | 2 +- .../_operations/_operations.py | 4 +- .../aio/_operations/_operations.py | 4 +- .../_operations/_operations.py | 6 +- .../aio/_operations/_operations.py | 6 +- .../aio/operations/_operations.py | 64 ++--- .../operations/_operations.py | 64 ++--- .../aio/operations/_operations.py | 12 +- .../operations/_operations.py | 12 +- .../_operations/_operations.py | 4 +- .../aio/_operations/_operations.py | 4 +- .../_operations/_operations.py | 4 +- .../aio/_operations/_operations.py | 4 +- .../aio/operations/_operations.py | 8 +- .../operations/_operations.py | 8 +- .../aio/operations/_operations.py | 134 +++++------ .../operations/_operations.py | 134 +++++------ .../_operations/_operations.py | 8 +- .../aio/_operations/_operations.py | 8 +- .../aio/operations/_operations.py | 68 +++--- .../operations/_operations.py | 68 +++--- .../aio/operations/_operations.py | 8 +- .../operations/_operations.py | 8 +- .../apikey/_operations/_operations.py | 6 +- .../apikey/aio/_operations/_operations.py | 6 +- .../http/custom/_operations/_operations.py | 6 +- .../custom/aio/_operations/_operations.py | 6 +- .../oauth2/_operations/_operations.py | 6 +- .../oauth2/aio/_operations/_operations.py | 6 +- .../union/_operations/_operations.py | 6 +- .../union/aio/_operations/_operations.py | 6 +- .../core/access/aio/operations/_operations.py | 20 +- .../core/access/operations/_operations.py | 20 +- .../model/flatten/_operations/_operations.py | 4 +- .../flatten/aio/_operations/_operations.py | 4 +- .../core/usage/aio/operations/_operations.py | 4 +- .../core/usage/operations/_operations.py | 4 +- .../core/basic/aio/operations/_operations.py | 22 +- .../core/basic/operations/_operations.py | 22 +- .../lro/standard/_operations/_operations.py | 6 +- .../standard/aio/_operations/_operations.py | 6 +- .../core/scalar/aio/operations/_operations.py | 10 +- .../core/scalar/operations/_operations.py | 10 +- .../core/traits/_operations/_operations.py | 4 +- .../traits/aio/_operations/_operations.py | 4 +- .../spheredpg/aio/operations/_operations.py | 88 +++---- .../mgmt/spheredpg/operations/_operations.py | 88 +++---- .../lro/rpc/_operations/_operations.py | 2 +- .../lro/rpc/aio/_operations/_operations.py | 2 +- .../rpclegacy/aio/operations/_operations.py | 4 +- .../lro/rpclegacy/operations/_operations.py | 4 +- .../naming/aio/operations/_operations.py | 22 +- .../client/naming/operations/_operations.py | 22 +- .../service/aio/operations/_operations.py | 20 +- .../service/operations/_operations.py | 20 +- .../multiclient/_operations/_operations.py | 14 +- .../aio/_operations/_operations.py | 14 +- .../aio/operations/_operations.py | 14 +- .../operations/_operations.py | 14 +- .../aio/operations/_operations.py | 14 +- .../operations/_operations.py | 14 +- .../bytes/aio/operations/_operations.py | 44 ++-- .../encode/bytes/operations/_operations.py | 44 ++-- .../datetime/aio/operations/_operations.py | 38 +-- .../encode/datetime/operations/_operations.py | 38 +-- .../duration/aio/operations/_operations.py | 30 +-- .../encode/duration/operations/_operations.py | 30 +-- .../_operations/_operations.py | 12 +- .../aio/_operations/_operations.py | 12 +- .../_operations/_operations.py | 12 +- .../aio/_operations/_operations.py | 12 +- .../aio/operations/_operations.py | 8 +- .../bodyoptionality/operations/_operations.py | 8 +- .../aio/operations/_operations.py | 14 +- .../operations/_operations.py | 14 +- .../spread/aio/operations/_operations.py | 8 +- .../spread/operations/_operations.py | 8 +- .../aio/operations/_operations.py | 10 +- .../operations/_operations.py | 10 +- .../jsonmergepatch/_operations/_operations.py | 6 +- .../aio/_operations/_operations.py | 6 +- .../mediatype/aio/operations/_operations.py | 10 +- .../mediatype/operations/_operations.py | 10 +- .../multipart/aio/operations/_operations.py | 14 +- .../multipart/operations/_operations.py | 14 +- .../pageable/_operations/_operations.py | 4 +- .../pageable/aio/_operations/_operations.py | 4 +- .../srv/driven1/_operations/_operations.py | 8 +- .../driven1/aio/_operations/_operations.py | 8 +- .../srv/driven2/_operations/_operations.py | 10 +- .../driven2/aio/_operations/_operations.py | 10 +- .../json/aio/operations/_operations.py | 4 +- .../json/operations/_operations.py | 4 +- .../notdefined/_operations/_operations.py | 4 +- .../notdefined/aio/_operations/_operations.py | 4 +- .../path/multiple/_operations/_operations.py | 6 +- .../multiple/aio/_operations/_operations.py | 6 +- .../path/single/_operations/_operations.py | 4 +- .../single/aio/_operations/_operations.py | 4 +- .../notversioned/_operations/_operations.py | 8 +- .../aio/_operations/_operations.py | 8 +- .../versioned/_operations/_operations.py | 8 +- .../versioned/aio/_operations/_operations.py | 8 +- .../_operations/_operations.py | 4 +- .../aio/_operations/_operations.py | 4 +- .../_operations/_operations.py | 6 +- .../aio/_operations/_operations.py | 6 +- .../repeatability/_operations/_operations.py | 4 +- .../aio/_operations/_operations.py | 4 +- .../aio/operations/_operations.py | 202 ++++++++-------- .../specialwords/operations/_operations.py | 202 ++++++++-------- .../array/aio/operations/_operations.py | 40 ++-- .../typetest/array/operations/_operations.py | 40 ++-- .../dictionary/aio/operations/_operations.py | 44 ++-- .../dictionary/operations/_operations.py | 44 ++-- .../extensible/aio/operations/_operations.py | 8 +- .../enum/extensible/operations/_operations.py | 8 +- .../enum/fixed/aio/operations/_operations.py | 6 +- .../enum/fixed/operations/_operations.py | 6 +- .../model/empty/_operations/_operations.py | 6 +- .../empty/aio/_operations/_operations.py | 6 +- .../_operations/_operations.py | 16 +- .../aio/_operations/_operations.py | 16 +- .../_operations/_operations.py | 12 +- .../aio/_operations/_operations.py | 12 +- .../_operations/_operations.py | 6 +- .../aio/_operations/_operations.py | 6 +- .../recursive/_operations/_operations.py | 4 +- .../recursive/aio/_operations/_operations.py | 4 +- .../_operations/_operations.py | 14 +- .../aio/_operations/_operations.py | 14 +- .../model/usage/_operations/_operations.py | 6 +- .../usage/aio/_operations/_operations.py | 6 +- .../visibility/_operations/_operations.py | 12 +- .../visibility/aio/_operations/_operations.py | 12 +- .../aio/operations/_operations.py | 56 ++--- .../operations/_operations.py | 56 ++--- .../nullable/aio/operations/_operations.py | 48 ++-- .../nullable/operations/_operations.py | 48 ++-- .../optional/aio/operations/_operations.py | 112 ++++----- .../optional/operations/_operations.py | 112 ++++----- .../valuetypes/aio/operations/_operations.py | 116 ++++----- .../valuetypes/operations/_operations.py | 116 ++++----- .../scalar/aio/operations/_operations.py | 34 +-- .../typetest/scalar/operations/_operations.py | 34 +-- .../union/aio/operations/_operations.py | 40 ++-- .../typetest/union/operations/_operations.py | 40 ++-- .../apikey/_operations/_operations.py | 6 +- .../apikey/aio/_operations/_operations.py | 6 +- .../http/custom/_operations/_operations.py | 6 +- .../custom/aio/_operations/_operations.py | 6 +- .../oauth2/_operations/_operations.py | 6 +- .../oauth2/aio/_operations/_operations.py | 6 +- .../union/_operations/_operations.py | 6 +- .../union/aio/_operations/_operations.py | 6 +- .../naming/aio/operations/_operations.py | 22 +- .../client/naming/operations/_operations.py | 22 +- .../service/aio/operations/_operations.py | 20 +- .../service/operations/_operations.py | 20 +- .../multiclient/_operations/_operations.py | 14 +- .../aio/_operations/_operations.py | 14 +- .../aio/operations/_operations.py | 14 +- .../operations/_operations.py | 14 +- .../aio/operations/_operations.py | 14 +- .../operations/_operations.py | 14 +- .../bytes/aio/operations/_operations.py | 44 ++-- .../encode/bytes/operations/_operations.py | 44 ++-- .../datetime/aio/operations/_operations.py | 38 +-- .../encode/datetime/operations/_operations.py | 38 +-- .../duration/aio/operations/_operations.py | 30 +-- .../encode/duration/operations/_operations.py | 30 +-- .../_operations/_operations.py | 12 +- .../aio/_operations/_operations.py | 12 +- .../_operations/_operations.py | 12 +- .../aio/_operations/_operations.py | 12 +- .../aio/operations/_operations.py | 8 +- .../bodyoptionality/operations/_operations.py | 8 +- .../aio/operations/_operations.py | 14 +- .../operations/_operations.py | 14 +- .../spread/aio/operations/_operations.py | 8 +- .../spread/operations/_operations.py | 8 +- .../aio/operations/_operations.py | 10 +- .../operations/_operations.py | 10 +- .../jsonmergepatch/_operations/_operations.py | 6 +- .../aio/_operations/_operations.py | 6 +- .../mediatype/aio/operations/_operations.py | 10 +- .../mediatype/operations/_operations.py | 10 +- .../multipart/aio/operations/_operations.py | 14 +- .../multipart/operations/_operations.py | 14 +- .../pageable/_operations/_operations.py | 4 +- .../pageable/aio/_operations/_operations.py | 4 +- .../srv/driven1/_operations/_operations.py | 8 +- .../driven1/aio/_operations/_operations.py | 8 +- .../srv/driven2/_operations/_operations.py | 10 +- .../driven2/aio/_operations/_operations.py | 10 +- .../json/aio/operations/_operations.py | 4 +- .../json/operations/_operations.py | 4 +- .../notdefined/_operations/_operations.py | 4 +- .../notdefined/aio/_operations/_operations.py | 4 +- .../path/multiple/_operations/_operations.py | 6 +- .../multiple/aio/_operations/_operations.py | 6 +- .../path/single/_operations/_operations.py | 4 +- .../single/aio/_operations/_operations.py | 4 +- .../notversioned/_operations/_operations.py | 8 +- .../aio/_operations/_operations.py | 8 +- .../versioned/_operations/_operations.py | 8 +- .../versioned/aio/_operations/_operations.py | 8 +- .../_operations/_operations.py | 6 +- .../aio/_operations/_operations.py | 6 +- .../repeatability/_operations/_operations.py | 4 +- .../aio/_operations/_operations.py | 4 +- .../aio/operations/_operations.py | 202 ++++++++-------- .../specialwords/operations/_operations.py | 202 ++++++++-------- .../array/aio/operations/_operations.py | 40 ++-- .../typetest/array/operations/_operations.py | 40 ++-- .../dictionary/aio/operations/_operations.py | 44 ++-- .../dictionary/operations/_operations.py | 44 ++-- .../extensible/aio/operations/_operations.py | 8 +- .../enum/extensible/operations/_operations.py | 8 +- .../enum/fixed/aio/operations/_operations.py | 6 +- .../enum/fixed/operations/_operations.py | 6 +- .../model/empty/_operations/_operations.py | 6 +- .../empty/aio/_operations/_operations.py | 6 +- .../_operations/_operations.py | 16 +- .../aio/_operations/_operations.py | 16 +- .../_operations/_operations.py | 12 +- .../aio/_operations/_operations.py | 12 +- .../_operations/_operations.py | 6 +- .../aio/_operations/_operations.py | 6 +- .../recursive/_operations/_operations.py | 4 +- .../recursive/aio/_operations/_operations.py | 4 +- .../_operations/_operations.py | 14 +- .../aio/_operations/_operations.py | 14 +- .../model/usage/_operations/_operations.py | 6 +- .../usage/aio/_operations/_operations.py | 6 +- .../visibility/_operations/_operations.py | 12 +- .../visibility/aio/_operations/_operations.py | 12 +- .../aio/operations/_operations.py | 56 ++--- .../operations/_operations.py | 56 ++--- .../nullable/aio/operations/_operations.py | 48 ++-- .../nullable/operations/_operations.py | 48 ++-- .../optional/aio/operations/_operations.py | 112 ++++----- .../optional/operations/_operations.py | 112 ++++----- .../valuetypes/aio/operations/_operations.py | 116 ++++----- .../valuetypes/operations/_operations.py | 116 ++++----- .../scalar/aio/operations/_operations.py | 34 +-- .../typetest/scalar/operations/_operations.py | 34 +-- .../union/aio/operations/_operations.py | 40 ++-- .../typetest/union/operations/_operations.py | 40 ++-- 722 files changed, 6998 insertions(+), 6988 deletions(-) diff --git a/packages/autorest.python/autorest/codegen/models/operation.py b/packages/autorest.python/autorest/codegen/models/operation.py index ea472d87cb9..7706386f433 100644 --- a/packages/autorest.python/autorest/codegen/models/operation.py +++ b/packages/autorest.python/autorest/codegen/models/operation.py @@ -394,6 +394,16 @@ def imports( # pylint: disable=too-many-branches, disable=too-many-statements "Type", ImportType.STDLIB, ) + file_import.add_submodule_import( + "typing", + "Callable", + ImportType.STDLIB, + ) + file_import.add_submodule_import( + "typing", + "Union", + ImportType.STDLIB, + ) file_import.add_mutable_mapping_import() if self.non_default_error_status_codes: file_import.add_submodule_import( diff --git a/packages/autorest.python/autorest/codegen/serializers/builder_serializer.py b/packages/autorest.python/autorest/codegen/serializers/builder_serializer.py index 28cdf29d54b..3141e6df728 100644 --- a/packages/autorest.python/autorest/codegen/serializers/builder_serializer.py +++ b/packages/autorest.python/autorest/codegen/serializers/builder_serializer.py @@ -1281,7 +1281,7 @@ def handle_response(self, builder: OperationType) -> List[str]: return retval def error_map(self, builder: OperationType) -> List[str]: - retval = ["error_map: MutableMapping[int, Type[HttpResponseError]] = {"] + retval = ["error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = {"] if builder.non_default_errors: if not 401 in builder.non_default_error_status_codes: retval.append(" 401: ClientAuthenticationError,") diff --git a/packages/autorest.python/samples/specification/azure_key_credential/generated/azure/key/credential/sample/aio/operations/_operations.py b/packages/autorest.python/samples/specification/azure_key_credential/generated/azure/key/credential/sample/aio/operations/_operations.py index 95dea1fd1f8..e6c9997bf75 100644 --- a/packages/autorest.python/samples/specification/azure_key_credential/generated/azure/key/credential/sample/aio/operations/_operations.py +++ b/packages/autorest.python/samples/specification/azure_key_credential/generated/azure/key/credential/sample/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -60,7 +60,7 @@ async def head200(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -103,7 +103,7 @@ async def head204(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -146,7 +146,7 @@ async def head404(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/samples/specification/azure_key_credential/generated/azure/key/credential/sample/operations/_operations.py b/packages/autorest.python/samples/specification/azure_key_credential/generated/azure/key/credential/sample/operations/_operations.py index 15b8dd6ceb8..06ded4ffa1f 100644 --- a/packages/autorest.python/samples/specification/azure_key_credential/generated/azure/key/credential/sample/operations/_operations.py +++ b/packages/autorest.python/samples/specification/azure_key_credential/generated/azure/key/credential/sample/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -80,7 +80,7 @@ def head200(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -123,7 +123,7 @@ def head204(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -166,7 +166,7 @@ def head404(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/samples/specification/basic/generated/azure/basic/sample/aio/operations/_operations.py b/packages/autorest.python/samples/specification/basic/generated/azure/basic/sample/aio/operations/_operations.py index dfc2e217633..828f4028cf1 100644 --- a/packages/autorest.python/samples/specification/basic/generated/azure/basic/sample/aio/operations/_operations.py +++ b/packages/autorest.python/samples/specification/basic/generated/azure/basic/sample/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -60,7 +60,7 @@ async def head200(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -103,7 +103,7 @@ async def head204(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -146,7 +146,7 @@ async def head404(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/samples/specification/basic/generated/azure/basic/sample/operations/_operations.py b/packages/autorest.python/samples/specification/basic/generated/azure/basic/sample/operations/_operations.py index 4438956a3f3..d05c9d05247 100644 --- a/packages/autorest.python/samples/specification/basic/generated/azure/basic/sample/operations/_operations.py +++ b/packages/autorest.python/samples/specification/basic/generated/azure/basic/sample/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -80,7 +80,7 @@ def head200(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -123,7 +123,7 @@ def head204(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -166,7 +166,7 @@ def head404(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/samples/specification/directives/generated/azure/directives/sample/_operations/_operations.py b/packages/autorest.python/samples/specification/directives/generated/azure/directives/sample/_operations/_operations.py index 8d54bcaafe1..c709d6f6274 100644 --- a/packages/autorest.python/samples/specification/directives/generated/azure/directives/sample/_operations/_operations.py +++ b/packages/autorest.python/samples/specification/directives/generated/azure/directives/sample/_operations/_operations.py @@ -74,7 +74,7 @@ def build_polling_paging_example_basic_paging_request(**kwargs: Any) -> HttpRequ class PollingPagingExampleOperationsMixin(PollingPagingExampleMixinABC): def _basic_polling_initial(self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any) -> Optional[JSON]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -295,7 +295,7 @@ def basic_paging(self, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/samples/specification/directives/generated/azure/directives/sample/aio/_operations/_operations.py b/packages/autorest.python/samples/specification/directives/generated/azure/directives/sample/aio/_operations/_operations.py index 71253813252..7f84f7332fe 100644 --- a/packages/autorest.python/samples/specification/directives/generated/azure/directives/sample/aio/_operations/_operations.py +++ b/packages/autorest.python/samples/specification/directives/generated/azure/directives/sample/aio/_operations/_operations.py @@ -47,7 +47,7 @@ class PollingPagingExampleOperationsMixin(PollingPagingExampleMixinABC): async def _basic_polling_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> Optional[JSON]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -272,7 +272,7 @@ def basic_paging(self, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/samples/specification/management/generated/azure/mgmt/sample/aio/operations/_http_success_operations.py b/packages/autorest.python/samples/specification/management/generated/azure/mgmt/sample/aio/operations/_http_success_operations.py index ee0912a5af5..09bb92797da 100644 --- a/packages/autorest.python/samples/specification/management/generated/azure/mgmt/sample/aio/operations/_http_success_operations.py +++ b/packages/autorest.python/samples/specification/management/generated/azure/mgmt/sample/aio/operations/_http_success_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -59,7 +59,7 @@ async def head200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -102,7 +102,7 @@ async def head204(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -145,7 +145,7 @@ async def head404(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/samples/specification/management/generated/azure/mgmt/sample/operations/_http_success_operations.py b/packages/autorest.python/samples/specification/management/generated/azure/mgmt/sample/operations/_http_success_operations.py index 8d073da10e7..ee38ace2bbb 100644 --- a/packages/autorest.python/samples/specification/management/generated/azure/mgmt/sample/operations/_http_success_operations.py +++ b/packages/autorest.python/samples/specification/management/generated/azure/mgmt/sample/operations/_http_success_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -83,7 +83,7 @@ def head200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -126,7 +126,7 @@ def head204(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +169,7 @@ def head404(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/aio/operations/_multiapi_service_client_operations.py index 4be9f4faa37..cda55e23333 100644 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/aio/operations/_multiapi_service_client_operations.py @@ -69,7 +69,7 @@ async def test_one( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -113,7 +113,7 @@ async def test_one( # pylint: disable=inconsistent-return-statements async def _test_lro_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -265,7 +265,7 @@ async def _test_lro_and_paging_initial( test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any ) -> _models.PagingResult: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -337,7 +337,7 @@ async def begin_test_lro_and_paging( cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -454,7 +454,7 @@ async def test_different_calls( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/aio/operations/_operation_group_one_operations.py b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/aio/operations/_operation_group_one_operations.py index 690f2856ffb..f46efe8a5c1 100644 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/aio/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/aio/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -65,7 +65,7 @@ async def test_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/operations/_multiapi_service_client_operations.py b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/operations/_multiapi_service_client_operations.py index f8c3e856901..b1ec8ec5ef5 100644 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/operations/_multiapi_service_client_operations.py @@ -146,7 +146,7 @@ def test_one( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -190,7 +190,7 @@ def test_one( # pylint: disable=inconsistent-return-statements def _test_lro_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -339,7 +339,7 @@ def _test_lro_and_paging_initial( test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any ) -> _models.PagingResult: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -411,7 +411,7 @@ def begin_test_lro_and_paging( cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -528,7 +528,7 @@ def test_different_calls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/operations/_operation_group_one_operations.py b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/operations/_operation_group_one_operations.py index 9a1698f1e80..c592f866ad7 100644 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -86,7 +86,7 @@ def test_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/aio/operations/_multiapi_service_client_operations.py index 5a0be7edf6a..e26fd935b95 100644 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/aio/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -56,7 +56,7 @@ async def test_one(self, id: int, message: Optional[str] = None, **kwargs: Any) :rtype: ~azure.multiapi.sample.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -115,7 +115,7 @@ async def test_different_calls( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/aio/operations/_operation_group_one_operations.py b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/aio/operations/_operation_group_one_operations.py index 60a12c78568..15f66ca7436 100644 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/aio/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/aio/operations/_operation_group_one_operations.py @@ -103,7 +103,7 @@ async def test_two( :rtype: ~azure.multiapi.sample.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -167,7 +167,7 @@ async def test_three(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/aio/operations/_operation_group_two_operations.py b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/aio/operations/_operation_group_two_operations.py index 4319a9592b6..5b507fbaefc 100644 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/aio/operations/_operation_group_two_operations.py +++ b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/aio/operations/_operation_group_two_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -69,7 +69,7 @@ async def test_four( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/operations/_multiapi_service_client_operations.py b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/operations/_multiapi_service_client_operations.py index c5eb192672d..2d2a5fd0963 100644 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -104,7 +104,7 @@ def test_one(self, id: int, message: Optional[str] = None, **kwargs: Any) -> _mo :rtype: ~azure.multiapi.sample.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -163,7 +163,7 @@ def test_different_calls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/operations/_operation_group_one_operations.py b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/operations/_operation_group_one_operations.py index 966f69141c4..1526f898572 100644 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/operations/_operation_group_one_operations.py @@ -146,7 +146,7 @@ def test_two( :rtype: ~azure.multiapi.sample.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -210,7 +210,7 @@ def test_three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/operations/_operation_group_two_operations.py b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/operations/_operation_group_two_operations.py index b6b3ebd461a..af80d5e5b7d 100644 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/operations/_operation_group_two_operations.py +++ b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v2/operations/_operation_group_two_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -89,7 +89,7 @@ def test_four(self, parameter_one: bool, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/aio/operations/_multiapi_service_client_operations.py index 3607f228970..1db99346f32 100644 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/aio/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar, Union import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -63,7 +63,7 @@ def test_paging(self, **kwargs: Any) -> AsyncIterable["_models.ModelThree"]: cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +143,7 @@ async def test_different_calls( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/aio/operations/_operation_group_one_operations.py b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/aio/operations/_operation_group_one_operations.py index 3c1c3e5b565..0cc037172a8 100644 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/aio/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/aio/operations/_operation_group_one_operations.py @@ -77,7 +77,7 @@ def test_operation_group_paging(self, **kwargs: Any) -> AsyncIterable["_models.M cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -186,7 +186,7 @@ async def test_two( :rtype: ~azure.multiapi.sample.v3.models.ModelThree :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/aio/operations/_operation_group_two_operations.py b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/aio/operations/_operation_group_two_operations.py index ffaf7a29d00..59d2a0afa68 100644 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/aio/operations/_operation_group_two_operations.py +++ b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/aio/operations/_operation_group_two_operations.py @@ -104,7 +104,7 @@ async def test_four( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -164,7 +164,7 @@ async def test_five(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/operations/_multiapi_service_client_operations.py b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/operations/_multiapi_service_client_operations.py index 573fcbb01a2..a57b18175ed 100644 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar, Union import urllib.parse from azure.core.exceptions import ( @@ -105,7 +105,7 @@ def test_paging(self, **kwargs: Any) -> Iterable["_models.ModelThree"]: cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -185,7 +185,7 @@ def test_different_calls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/operations/_operation_group_one_operations.py b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/operations/_operation_group_one_operations.py index 6be2c244390..92d2b9694d3 100644 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/operations/_operation_group_one_operations.py @@ -111,7 +111,7 @@ def test_operation_group_paging(self, **kwargs: Any) -> Iterable["_models.ModelT cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +220,7 @@ def test_two( :rtype: ~azure.multiapi.sample.v3.models.ModelThree :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/operations/_operation_group_two_operations.py b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/operations/_operation_group_two_operations.py index dc2e7f1a577..efb983bb5c0 100644 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/operations/_operation_group_two_operations.py +++ b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/operations/_operation_group_two_operations.py @@ -147,7 +147,7 @@ def test_four( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -207,7 +207,7 @@ def test_five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureBodyDuration/bodyduration/aio/operations/_duration_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureBodyDuration/bodyduration/aio/operations/_duration_operations.py index 5a6fdc953fd..e1c3159f3f3 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureBodyDuration/bodyduration/aio/operations/_duration_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureBodyDuration/bodyduration/aio/operations/_duration_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -68,7 +68,7 @@ async def get_null(self, **kwargs: Any) -> Optional[datetime.timedelta]: :rtype: ~datetime.timedelta or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -119,7 +119,7 @@ async def put_positive_duration( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -167,7 +167,7 @@ async def get_positive_duration(self, **kwargs: Any) -> datetime.timedelta: :rtype: ~datetime.timedelta :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -214,7 +214,7 @@ async def get_invalid(self, **kwargs: Any) -> datetime.timedelta: :rtype: ~datetime.timedelta :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureBodyDuration/bodyduration/operations/_duration_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureBodyDuration/bodyduration/operations/_duration_operations.py index 97fec1d0745..3856c5f6441 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureBodyDuration/bodyduration/operations/_duration_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureBodyDuration/bodyduration/operations/_duration_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -125,7 +125,7 @@ def get_null(self, **kwargs: Any) -> Optional[datetime.timedelta]: :rtype: ~datetime.timedelta or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -176,7 +176,7 @@ def put_positive_duration( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -224,7 +224,7 @@ def get_positive_duration(self, **kwargs: Any) -> datetime.timedelta: :rtype: ~datetime.timedelta :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -271,7 +271,7 @@ def get_invalid(self, **kwargs: Any) -> datetime.timedelta: :rtype: ~datetime.timedelta :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureParameterGrouping/azureparametergrouping/aio/operations/_parameter_grouping_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureParameterGrouping/azureparametergrouping/aio/operations/_parameter_grouping_operations.py index db72dc2daf6..c4d1ddcf051 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureParameterGrouping/azureparametergrouping/aio/operations/_parameter_grouping_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureParameterGrouping/azureparametergrouping/aio/operations/_parameter_grouping_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -76,7 +76,7 @@ async def post_required( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +143,7 @@ async def post_optional( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -204,7 +204,7 @@ async def post_reserved_words( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -268,7 +268,7 @@ async def post_multi_param_groups( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -330,7 +330,7 @@ async def post_shared_parameter_group_object( # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +386,7 @@ async def group_with_constant( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureParameterGrouping/azureparametergrouping/operations/_parameter_grouping_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureParameterGrouping/azureparametergrouping/operations/_parameter_grouping_operations.py index 7fdc047cb9f..c74445caa2d 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureParameterGrouping/azureparametergrouping/operations/_parameter_grouping_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureParameterGrouping/azureparametergrouping/operations/_parameter_grouping_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from msrest import Serializer @@ -222,7 +222,7 @@ def post_required( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -289,7 +289,7 @@ def post_optional( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -350,7 +350,7 @@ def post_reserved_words( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -414,7 +414,7 @@ def post_multi_param_groups( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -476,7 +476,7 @@ def post_shared_parameter_group_object( # pylint: disable=inconsistent-return-s :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -532,7 +532,7 @@ def group_with_constant( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureReport/azurereport/aio/operations/_auto_rest_report_service_for_azure_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureReport/azurereport/aio/operations/_auto_rest_report_service_for_azure_operations.py index e45d0fccf60..b548c1f3ef9 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureReport/azurereport/aio/operations/_auto_rest_report_service_for_azure_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureReport/azurereport/aio/operations/_auto_rest_report_service_for_azure_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -50,7 +50,7 @@ async def get_report(self, qualifier: Optional[str] = None, **kwargs: Any) -> Di :rtype: dict[str, int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureReport/azurereport/operations/_auto_rest_report_service_for_azure_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureReport/azurereport/operations/_auto_rest_report_service_for_azure_operations.py index e8c3b400d90..82513a82e2a 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureReport/azurereport/operations/_auto_rest_report_service_for_azure_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureReport/azurereport/operations/_auto_rest_report_service_for_azure_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -72,7 +72,7 @@ def get_report(self, qualifier: Optional[str] = None, **kwargs: Any) -> Dict[str :rtype: dict[str, int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_api_version_default_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_api_version_default_operations.py index a0d06bbb4af..c50bb0be65d 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_api_version_default_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_api_version_default_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -68,7 +68,7 @@ async def get_method_global_valid(self, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -115,7 +115,7 @@ async def get_method_global_not_provided_valid( # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -160,7 +160,7 @@ async def get_path_global_valid(self, **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -205,7 +205,7 @@ async def get_swagger_global_valid(self, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_api_version_local_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_api_version_local_operations.py index 986313069c4..3fc7a04fb42 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_api_version_local_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_api_version_local_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -68,7 +68,7 @@ async def get_method_local_valid(self, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -118,7 +118,7 @@ async def get_method_local_null( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -162,7 +162,7 @@ async def get_path_local_valid(self, **kwargs: Any) -> None: # pylint: disable= :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -207,7 +207,7 @@ async def get_swagger_local_valid(self, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_header_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_header_operations.py index 999f39840b4..7ed51a72ff1 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_header_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_header_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -70,7 +70,7 @@ async def custom_named_request_id( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -125,7 +125,7 @@ async def custom_named_request_id_param_grouping( # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -178,7 +178,7 @@ async def custom_named_request_id_head(self, foo_client_request_id: str, **kwarg :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_odata_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_odata_operations.py index 1ba19532d36..1bc2a2e03a3 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_odata_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_odata_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -71,7 +71,7 @@ async def get_with_filter( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_skip_url_encoding_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_skip_url_encoding_operations.py index 0e7e7aaa732..df4a123ce02 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_skip_url_encoding_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_skip_url_encoding_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -75,7 +75,7 @@ async def get_method_path_valid( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -123,7 +123,7 @@ async def get_path_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -167,7 +167,7 @@ async def get_swagger_path_valid(self, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -216,7 +216,7 @@ async def get_method_query_valid( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -264,7 +264,7 @@ async def get_method_query_null( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -312,7 +312,7 @@ async def get_path_query_valid( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -356,7 +356,7 @@ async def get_swagger_query_valid(self, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_subscription_in_credentials_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_subscription_in_credentials_operations.py index 218d4209d13..8e3e0ed8a53 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_subscription_in_credentials_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_subscription_in_credentials_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -70,7 +70,7 @@ async def post_method_global_valid(self, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -115,7 +115,7 @@ async def post_method_global_null(self, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -162,7 +162,7 @@ async def post_method_global_not_provided_valid( # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -209,7 +209,7 @@ async def post_path_global_valid(self, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -254,7 +254,7 @@ async def post_swagger_global_valid(self, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_subscription_in_method_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_subscription_in_method_operations.py index 362238e6721..54c8a431304 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_subscription_in_method_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_subscription_in_method_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -73,7 +73,7 @@ async def post_method_local_valid( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -123,7 +123,7 @@ async def post_method_local_null( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -173,7 +173,7 @@ async def post_path_local_valid( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -223,7 +223,7 @@ async def post_swagger_local_valid( # pylint: disable=inconsistent-return-state :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_xms_client_request_id_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_xms_client_request_id_operations.py index 949fd5feee5..40c5fa77511 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_xms_client_request_id_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/aio/operations/_xms_client_request_id_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -63,7 +63,7 @@ async def get(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -111,7 +111,7 @@ async def param_get( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_api_version_default_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_api_version_default_operations.py index b4d6d1b7813..da66006795d 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_api_version_default_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_api_version_default_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from msrest import Serializer @@ -144,7 +144,7 @@ def get_method_global_valid(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -191,7 +191,7 @@ def get_method_global_not_provided_valid( # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -236,7 +236,7 @@ def get_path_global_valid(self, **kwargs: Any) -> None: # pylint: disable=incon :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -281,7 +281,7 @@ def get_swagger_global_valid(self, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_api_version_local_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_api_version_local_operations.py index cac5ebb2995..3162009a2e6 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_api_version_local_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_api_version_local_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from msrest import Serializer @@ -142,7 +142,7 @@ def get_method_local_valid(self, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -192,7 +192,7 @@ def get_method_local_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -236,7 +236,7 @@ def get_path_local_valid(self, **kwargs: Any) -> None: # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -281,7 +281,7 @@ def get_swagger_local_valid(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_header_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_header_operations.py index 3f4da7ff52a..279de76aa40 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_header_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_header_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from msrest import Serializer @@ -119,7 +119,7 @@ def custom_named_request_id( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -174,7 +174,7 @@ def custom_named_request_id_param_grouping( # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -227,7 +227,7 @@ def custom_named_request_id_head(self, foo_client_request_id: str, **kwargs: Any :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_odata_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_odata_operations.py index 13a8ca41309..6535b2db047 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_odata_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_odata_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from msrest import Serializer @@ -100,7 +100,7 @@ def get_with_filter( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_skip_url_encoding_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_skip_url_encoding_operations.py index 85f1ca15ff0..c7159e92d9d 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_skip_url_encoding_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_skip_url_encoding_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from msrest import Serializer @@ -202,7 +202,7 @@ def get_method_path_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -250,7 +250,7 @@ def get_path_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -294,7 +294,7 @@ def get_swagger_path_valid(self, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -341,7 +341,7 @@ def get_method_query_valid(self, q1: str, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -389,7 +389,7 @@ def get_method_query_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -435,7 +435,7 @@ def get_path_query_valid(self, q1: str, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -479,7 +479,7 @@ def get_swagger_query_valid(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_subscription_in_credentials_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_subscription_in_credentials_operations.py index dd010c7a06a..26fa85c8eea 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_subscription_in_credentials_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_subscription_in_credentials_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from msrest import Serializer @@ -183,7 +183,7 @@ def post_method_global_valid(self, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -228,7 +228,7 @@ def post_method_global_null(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -275,7 +275,7 @@ def post_method_global_not_provided_valid( # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +322,7 @@ def post_path_global_valid(self, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -367,7 +367,7 @@ def post_swagger_global_valid(self, **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_subscription_in_method_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_subscription_in_method_operations.py index 9805b798275..54e0c45228d 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_subscription_in_method_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_subscription_in_method_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from msrest import Serializer @@ -158,7 +158,7 @@ def post_method_local_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -208,7 +208,7 @@ def post_method_local_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -258,7 +258,7 @@ def post_path_local_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -308,7 +308,7 @@ def post_swagger_local_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_xms_client_request_id_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_xms_client_request_id_operations.py index 21ffcb7dd60..eb1d68a7af6 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_xms_client_request_id_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/AzureSpecials/azurespecialproperties/operations/_xms_client_request_id_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from msrest import Serializer @@ -89,7 +89,7 @@ def get(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -137,7 +137,7 @@ def param_get( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/aio/operations/_paths_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/aio/operations/_paths_operations.py index 9bc8bf896e1..a87023f8309 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/aio/operations/_paths_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/aio/operations/_paths_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -65,7 +65,7 @@ async def get_empty( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/operations/_paths_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/operations/_paths_operations.py index 470325040a6..266e536d967 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/operations/_paths_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/operations/_paths_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from msrest import Serializer @@ -81,7 +81,7 @@ def get_empty(self, account_name: str, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomPollerPager/custompollerpager/aio/operations/_paging_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomPollerPager/custompollerpager/aio/operations/_paging_operations.py index 0e84264ad4f..0f11bcc2ad6 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomPollerPager/custompollerpager/aio/operations/_paging_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomPollerPager/custompollerpager/aio/operations/_paging_operations.py @@ -102,7 +102,7 @@ def get_no_item_name_pages(self, **kwargs: Any) -> AsyncIterable["_models.Produc cls: ClsType[_models.ProductResultValue] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -175,7 +175,7 @@ def get_empty_next_link_name_pages(self, **kwargs: Any) -> AsyncIterable["_model cls: ClsType[_models.ProductResultValue] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -248,7 +248,7 @@ def get_null_next_link_name_pages(self, **kwargs: Any) -> AsyncIterable["_models cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -321,7 +321,7 @@ def get_single_pages(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -399,7 +399,7 @@ def get_single_pages_with_body_params( content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -477,7 +477,7 @@ def first_response_empty(self, **kwargs: Any) -> AsyncIterable["_models.Product" cls: ClsType[_models.ProductResultValue] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -560,7 +560,7 @@ def get_multiple_pages( cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -646,7 +646,7 @@ def get_with_query_params(self, required_query_parameter: int, **kwargs: Any) -> query_constant: Literal[True] = kwargs.pop("query_constant", _params.pop("queryConstant", True)) cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -719,7 +719,7 @@ def duplicate_params(self, filter: Optional[str] = None, **kwargs: Any) -> Async cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -798,7 +798,7 @@ def page_with_max_page_size( cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -882,7 +882,7 @@ def get_odata_multiple_pages( cls: ClsType[_models.OdataProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -973,7 +973,7 @@ def get_multiple_pages_with_offset( cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1058,7 +1058,7 @@ def get_multiple_pages_retry_first(self, **kwargs: Any) -> AsyncIterable["_model cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1132,7 +1132,7 @@ def get_multiple_pages_retry_second(self, **kwargs: Any) -> AsyncIterable["_mode cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1205,7 +1205,7 @@ def get_single_pages_failure(self, **kwargs: Any) -> AsyncIterable["_models.Prod cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1278,7 +1278,7 @@ def get_multiple_pages_failure(self, **kwargs: Any) -> AsyncIterable["_models.Pr cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1351,7 +1351,7 @@ def get_multiple_pages_failure_uri(self, **kwargs: Any) -> AsyncIterable["_model cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1430,7 +1430,7 @@ def get_multiple_pages_fragment_next_link( cls: ClsType[_models.OdataProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1505,7 +1505,7 @@ def get_multiple_pages_fragment_with_grouping_next_link( # pylint: disable=name cls: ClsType[_models.OdataProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1579,7 +1579,7 @@ async def _get_multiple_pages_lro_initial( paging_get_multiple_pages_lro_options: Optional[_models.PagingGetMultiplePagesLroOptions] = None, **kwargs: Any ) -> _models.ProductResult: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1652,7 +1652,7 @@ async def begin_get_multiple_pages_lro( cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1772,7 +1772,7 @@ def append_api_version(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1848,7 +1848,7 @@ def replace_api_version(self, **kwargs: Any) -> AsyncIterable["_models.Product"] api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1925,7 +1925,7 @@ def get_paging_model_with_item_name_with_xms_client_name( # pylint: disable=nam cls: ClsType[_models.ProductResultValueWithXMSClientName] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomPollerPager/custompollerpager/operations/_paging_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomPollerPager/custompollerpager/operations/_paging_operations.py index 8d7a3989cc1..cb0356dd2e4 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomPollerPager/custompollerpager/operations/_paging_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomPollerPager/custompollerpager/operations/_paging_operations.py @@ -563,7 +563,7 @@ def get_no_item_name_pages(self, **kwargs: Any) -> Iterable["_models.Product"]: cls: ClsType[_models.ProductResultValue] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -636,7 +636,7 @@ def get_empty_next_link_name_pages(self, **kwargs: Any) -> Iterable["_models.Pro cls: ClsType[_models.ProductResultValue] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -709,7 +709,7 @@ def get_null_next_link_name_pages(self, **kwargs: Any) -> Iterable["_models.Prod cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -782,7 +782,7 @@ def get_single_pages(self, **kwargs: Any) -> Iterable["_models.Product"]: cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -860,7 +860,7 @@ def get_single_pages_with_body_params( content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -938,7 +938,7 @@ def first_response_empty(self, **kwargs: Any) -> Iterable["_models.Product"]: cls: ClsType[_models.ProductResultValue] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1021,7 +1021,7 @@ def get_multiple_pages( cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1107,7 +1107,7 @@ def get_with_query_params(self, required_query_parameter: int, **kwargs: Any) -> query_constant: Literal[True] = kwargs.pop("query_constant", _params.pop("queryConstant", True)) cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1180,7 +1180,7 @@ def duplicate_params(self, filter: Optional[str] = None, **kwargs: Any) -> Itera cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1257,7 +1257,7 @@ def page_with_max_page_size(self, maxpagesize: Literal["5"] = "5", **kwargs: Any cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1341,7 +1341,7 @@ def get_odata_multiple_pages( cls: ClsType[_models.OdataProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1432,7 +1432,7 @@ def get_multiple_pages_with_offset( cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1517,7 +1517,7 @@ def get_multiple_pages_retry_first(self, **kwargs: Any) -> Iterable["_models.Pro cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1591,7 +1591,7 @@ def get_multiple_pages_retry_second(self, **kwargs: Any) -> Iterable["_models.Pr cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1664,7 +1664,7 @@ def get_single_pages_failure(self, **kwargs: Any) -> Iterable["_models.Product"] cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1737,7 +1737,7 @@ def get_multiple_pages_failure(self, **kwargs: Any) -> Iterable["_models.Product cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1810,7 +1810,7 @@ def get_multiple_pages_failure_uri(self, **kwargs: Any) -> Iterable["_models.Pro cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1889,7 +1889,7 @@ def get_multiple_pages_fragment_next_link( cls: ClsType[_models.OdataProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1964,7 +1964,7 @@ def get_multiple_pages_fragment_with_grouping_next_link( # pylint: disable=name cls: ClsType[_models.OdataProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2038,7 +2038,7 @@ def _get_multiple_pages_lro_initial( paging_get_multiple_pages_lro_options: Optional[_models.PagingGetMultiplePagesLroOptions] = None, **kwargs: Any, ) -> _models.ProductResult: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2111,7 +2111,7 @@ def begin_get_multiple_pages_lro( cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2231,7 +2231,7 @@ def append_api_version(self, **kwargs: Any) -> Iterable["_models.Product"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2307,7 +2307,7 @@ def replace_api_version(self, **kwargs: Any) -> Iterable["_models.Product"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2384,7 +2384,7 @@ def get_paging_model_with_item_name_with_xms_client_name( # pylint: disable=nam cls: ClsType[_models.ProductResultValueWithXMSClientName] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/aio/operations/_paging_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/aio/operations/_paging_operations.py index 71dae3aa12e..db6b0047f02 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/aio/operations/_paging_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/aio/operations/_paging_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -74,7 +74,7 @@ def get_pages_partial_url(self, account_name: str, **kwargs: Any) -> AsyncIterab cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -146,7 +146,7 @@ def get_pages_partial_url_operation(self, account_name: str, **kwargs: Any) -> A cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/operations/_paging_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/operations/_paging_operations.py index bc025caaffa..503648a3aca 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/operations/_paging_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/operations/_paging_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -123,7 +123,7 @@ def get_pages_partial_url(self, account_name: str, **kwargs: Any) -> Iterable["_ cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -195,7 +195,7 @@ def get_pages_partial_url_operation(self, account_name: str, **kwargs: Any) -> I cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Head/head/aio/operations/_http_success_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Head/head/aio/operations/_http_success_operations.py index 94925145ff3..6b45daf9705 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Head/head/aio/operations/_http_success_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Head/head/aio/operations/_http_success_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -59,7 +59,7 @@ async def head200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -102,7 +102,7 @@ async def head204(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -145,7 +145,7 @@ async def head404(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Head/head/operations/_http_success_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Head/head/operations/_http_success_operations.py index 98be09f4ec4..a75fc030b3d 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Head/head/operations/_http_success_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Head/head/operations/_http_success_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -83,7 +83,7 @@ def head200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -126,7 +126,7 @@ def head204(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +169,7 @@ def head404(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/HeadExceptions/headexceptions/aio/operations/_head_exception_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/HeadExceptions/headexceptions/aio/operations/_head_exception_operations.py index 46fbb451345..3c9472e7fa9 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/HeadExceptions/headexceptions/aio/operations/_head_exception_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/HeadExceptions/headexceptions/aio/operations/_head_exception_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -59,7 +59,7 @@ async def head200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -102,7 +102,7 @@ async def head204(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -145,7 +145,7 @@ async def head404(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/HeadExceptions/headexceptions/operations/_head_exception_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/HeadExceptions/headexceptions/operations/_head_exception_operations.py index 7f00fc61a4f..069840f2baf 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/HeadExceptions/headexceptions/operations/_head_exception_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/HeadExceptions/headexceptions/operations/_head_exception_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -83,7 +83,7 @@ def head200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -126,7 +126,7 @@ def head204(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +169,7 @@ def head404(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/HeadWithAzureKeyCredentialPolicy/headwithazurekeycredentialpolicy/aio/operations/_http_success_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/HeadWithAzureKeyCredentialPolicy/headwithazurekeycredentialpolicy/aio/operations/_http_success_operations.py index 89fb466a342..3a1624b6ad3 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/HeadWithAzureKeyCredentialPolicy/headwithazurekeycredentialpolicy/aio/operations/_http_success_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/HeadWithAzureKeyCredentialPolicy/headwithazurekeycredentialpolicy/aio/operations/_http_success_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -59,7 +59,7 @@ async def head200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -102,7 +102,7 @@ async def head204(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -145,7 +145,7 @@ async def head404(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/HeadWithAzureKeyCredentialPolicy/headwithazurekeycredentialpolicy/operations/_http_success_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/HeadWithAzureKeyCredentialPolicy/headwithazurekeycredentialpolicy/operations/_http_success_operations.py index 62e1f00a3a3..743b4dd7a1e 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/HeadWithAzureKeyCredentialPolicy/headwithazurekeycredentialpolicy/operations/_http_success_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/HeadWithAzureKeyCredentialPolicy/headwithazurekeycredentialpolicy/operations/_http_success_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -83,7 +83,7 @@ def head200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -126,7 +126,7 @@ def head204(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +169,7 @@ def head404(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/aio/operations/_lr_os_custom_header_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/aio/operations/_lr_os_custom_header_operations.py index 04b650bb614..20c86e56baa 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/aio/operations/_lr_os_custom_header_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/aio/operations/_lr_os_custom_header_operations.py @@ -66,7 +66,7 @@ def __init__(self, *args, **kwargs) -> None: async def _put_async_retry_succeeded_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -236,7 +236,7 @@ def get_long_running_output(pipeline_response): async def _put201_creating_succeeded200_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -395,7 +395,7 @@ def get_long_running_output(pipeline_response): async def _post202_retry200_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -540,7 +540,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _post_async_retry_succeeded_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/aio/operations/_lro_retrys_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/aio/operations/_lro_retrys_operations.py index c475f62b94e..da029141e9e 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/aio/operations/_lro_retrys_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/aio/operations/_lro_retrys_operations.py @@ -69,7 +69,7 @@ def __init__(self, *args, **kwargs) -> None: async def _put201_creating_succeeded200_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -225,7 +225,7 @@ def get_long_running_output(pipeline_response): async def _put_async_relative_retry_succeeded_initial( # pylint: disable=name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -392,7 +392,7 @@ def get_long_running_output(pipeline_response): async def _delete_provisioning202_accepted200_succeeded_initial( # pylint: disable=name-too-long self, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -490,7 +490,7 @@ def get_long_running_output(pipeline_response): async def _delete202_retry200_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -572,7 +572,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _delete_async_relative_retry_succeeded_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -659,7 +659,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _post202_retry200_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -801,7 +801,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _post_async_relative_retry_succeeded_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/aio/operations/_lros_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/aio/operations/_lros_operations.py index 74fbde0894b..eaadd4c3208 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/aio/operations/_lros_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/aio/operations/_lros_operations.py @@ -106,7 +106,7 @@ def __init__(self, *args, **kwargs) -> None: async def _put200_succeeded_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -257,7 +257,7 @@ def get_long_running_output(pipeline_response): async def _patch200_succeeded_ignore_headers_initial( # pylint: disable=name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -417,7 +417,7 @@ def get_long_running_output(pipeline_response): async def _patch201_retry_with_async_header_initial( # pylint: disable=name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +575,7 @@ def get_long_running_output(pipeline_response): async def _patch202_retry_with_async_and_location_header_initial( # pylint: disable=name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -734,7 +734,7 @@ def get_long_running_output(pipeline_response): async def _put201_succeeded_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -881,7 +881,7 @@ def get_long_running_output(pipeline_response): ) async def _post202_list_initial(self, **kwargs: Any) -> Optional[List[_models.Product]]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -977,7 +977,7 @@ def get_long_running_output(pipeline_response): async def _put200_succeeded_no_state_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1126,7 +1126,7 @@ def get_long_running_output(pipeline_response): async def _put202_retry200_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1278,7 +1278,7 @@ def get_long_running_output(pipeline_response): async def _put201_creating_succeeded200_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1434,7 +1434,7 @@ def get_long_running_output(pipeline_response): async def _put200_updating_succeeded204_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1586,7 +1586,7 @@ def get_long_running_output(pipeline_response): async def _put201_creating_failed200_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1742,7 +1742,7 @@ def get_long_running_output(pipeline_response): async def _put200_acceptedcanceled200_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1894,7 +1894,7 @@ def get_long_running_output(pipeline_response): async def _put_no_header_in_retry_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2050,7 +2050,7 @@ def get_long_running_output(pipeline_response): async def _put_async_retry_succeeded_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2217,7 +2217,7 @@ def get_long_running_output(pipeline_response): async def _put_async_no_retry_succeeded_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2382,7 +2382,7 @@ def get_long_running_output(pipeline_response): async def _put_async_retry_failed_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2549,7 +2549,7 @@ def get_long_running_output(pipeline_response): async def _put_async_no_retrycanceled_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2714,7 +2714,7 @@ def get_long_running_output(pipeline_response): async def _put_async_no_header_in_retry_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2877,7 +2877,7 @@ def get_long_running_output(pipeline_response): async def _put_non_resource_initial( self, sku: Optional[Union[_models.Sku, IO[bytes]]] = None, **kwargs: Any ) -> _models.Sku: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3014,7 +3014,7 @@ def get_long_running_output(pipeline_response): async def _put_async_non_resource_initial( self, sku: Optional[Union[_models.Sku, IO[bytes]]] = None, **kwargs: Any ) -> _models.Sku: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3151,7 +3151,7 @@ def get_long_running_output(pipeline_response): async def _put_sub_resource_initial( self, provisioning_state: Optional[str] = None, **kwargs: Any ) -> _models.SubProduct: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3256,7 +3256,7 @@ def get_long_running_output(pipeline_response): async def _put_async_sub_resource_initial( self, provisioning_state: Optional[str] = None, **kwargs: Any ) -> _models.SubProduct: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3361,7 +3361,7 @@ def get_long_running_output(pipeline_response): async def _delete_provisioning202_accepted200_succeeded_initial( # pylint: disable=name-too-long self, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3459,7 +3459,7 @@ def get_long_running_output(pipeline_response): async def _delete_provisioning202_deleting_failed200_initial( # pylint: disable=name-too-long self, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3557,7 +3557,7 @@ def get_long_running_output(pipeline_response): async def _delete_provisioning202_deletingcanceled200_initial( # pylint: disable=name-too-long self, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3655,7 +3655,7 @@ def get_long_running_output(pipeline_response): async def _delete204_succeeded_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3730,7 +3730,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _delete202_retry200_initial(self, **kwargs: Any) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3822,7 +3822,7 @@ def get_long_running_output(pipeline_response): ) async def _delete202_no_retry204_initial(self, **kwargs: Any) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3916,7 +3916,7 @@ def get_long_running_output(pipeline_response): async def _delete_no_header_in_retry_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3998,7 +3998,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _delete_async_no_header_in_retry_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4080,7 +4080,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _delete_async_retry_succeeded_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4165,7 +4165,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _delete_async_no_retry_succeeded_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4250,7 +4250,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _delete_async_retry_failed_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4335,7 +4335,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _delete_async_retrycanceled_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4418,7 +4418,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _post200_with_payload_initial(self, **kwargs: Any) -> _models.Sku: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4508,7 +4508,7 @@ def get_long_running_output(pipeline_response): async def _post202_retry200_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4650,7 +4650,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _post202_no_retry204_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4808,7 +4808,7 @@ def get_long_running_output(pipeline_response): async def _post_double_headers_final_location_get_initial( # pylint: disable=name-too-long self, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4900,7 +4900,7 @@ def get_long_running_output(pipeline_response): async def _post_double_headers_final_azure_header_get_initial( # pylint: disable=name-too-long self, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4993,7 +4993,7 @@ def get_long_running_output(pipeline_response): async def _post_double_headers_final_azure_header_get_default_initial( # pylint: disable=name-too-long self, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5083,7 +5083,7 @@ def get_long_running_output(pipeline_response): async def _post_async_retry_succeeded_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5245,7 +5245,7 @@ def get_long_running_output(pipeline_response): async def _post_async_no_retry_succeeded_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5407,7 +5407,7 @@ def get_long_running_output(pipeline_response): async def _post_async_retry_failed_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5555,7 +5555,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _post_async_retrycanceled_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/aio/operations/_lrosads_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/aio/operations/_lrosads_operations.py index 775cd7fd02e..2c62c2d42a1 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/aio/operations/_lrosads_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/aio/operations/_lrosads_operations.py @@ -88,7 +88,7 @@ def __init__(self, *args, **kwargs) -> None: async def _put_non_retry400_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -238,7 +238,7 @@ def get_long_running_output(pipeline_response): async def _put_non_retry201_creating400_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -391,7 +391,7 @@ def get_long_running_output(pipeline_response): async def _put_non_retry201_creating400_invalid_json_initial( # pylint: disable=name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -544,7 +544,7 @@ def get_long_running_output(pipeline_response): async def _put_async_relative_retry400_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -708,7 +708,7 @@ def get_long_running_output(pipeline_response): async def _delete_non_retry400_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -789,7 +789,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _delete202_non_retry400_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -870,7 +870,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _delete_async_relative_retry400_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -955,7 +955,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _post_non_retry400_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1094,7 +1094,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _post202_non_retry400_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1233,7 +1233,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _post_async_relative_retry400_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1378,7 +1378,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _put_error201_no_provisioning_state_payload_initial( # pylint: disable=name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1528,7 +1528,7 @@ def get_long_running_output(pipeline_response): async def _put_async_relative_retry_no_status_initial( # pylint: disable=name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1695,7 +1695,7 @@ def get_long_running_output(pipeline_response): async def _put_async_relative_retry_no_status_payload_initial( # pylint: disable=name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1862,7 +1862,7 @@ def get_long_running_output(pipeline_response): async def _delete204_succeeded_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1939,7 +1939,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _delete_async_relative_retry_no_status_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2026,7 +2026,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _post202_no_location_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2168,7 +2168,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _post_async_relative_retry_no_payload_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2316,7 +2316,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _put200_invalid_json_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2467,7 +2467,7 @@ def get_long_running_output(pipeline_response): async def _put_async_relative_retry_invalid_header_initial( # pylint: disable=name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2634,7 +2634,7 @@ def get_long_running_output(pipeline_response): async def _put_async_relative_retry_invalid_json_polling_initial( # pylint: disable=name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2801,7 +2801,7 @@ def get_long_running_output(pipeline_response): async def _delete202_retry_invalid_header_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2883,7 +2883,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _delete_async_relative_retry_invalid_header_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2970,7 +2970,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _delete_async_relative_retry_invalid_json_polling_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3057,7 +3057,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _post202_retry_invalid_header_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3199,7 +3199,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _post_async_relative_retry_invalid_header_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3347,7 +3347,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _post_async_relative_retry_invalid_json_polling_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py index 2dbe4d19c52..5164fd756fe 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py @@ -132,7 +132,7 @@ def __init__(self, *args, **kwargs): def _put_async_retry_succeeded_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -299,7 +299,7 @@ def get_long_running_output(pipeline_response): def _put201_creating_succeeded200_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -455,7 +455,7 @@ def get_long_running_output(pipeline_response): def _post202_retry200_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -600,7 +600,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _post_async_retry_succeeded_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py index b859de72de2..a2ad5a4a3de 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py @@ -176,7 +176,7 @@ def __init__(self, *args, **kwargs): def _put201_creating_succeeded200_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -329,7 +329,7 @@ def get_long_running_output(pipeline_response): def _put_async_relative_retry_succeeded_initial( # pylint: disable=name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -493,7 +493,7 @@ def get_long_running_output(pipeline_response): def _delete_provisioning202_accepted200_succeeded_initial( # pylint: disable=name-too-long self, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +588,7 @@ def get_long_running_output(pipeline_response): ) def _delete202_retry200_initial(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -670,7 +670,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _delete_async_relative_retry_succeeded_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -757,7 +757,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _post202_retry200_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -899,7 +899,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _post_async_relative_retry_succeeded_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py index 7919b651f09..c27eff922e5 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py @@ -773,7 +773,7 @@ def __init__(self, *args, **kwargs): def _put200_succeeded_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -921,7 +921,7 @@ def get_long_running_output(pipeline_response): def _patch200_succeeded_ignore_headers_initial( # pylint: disable=name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1078,7 +1078,7 @@ def get_long_running_output(pipeline_response): def _patch201_retry_with_async_header_initial( # pylint: disable=name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1232,7 +1232,7 @@ def get_long_running_output(pipeline_response): def _patch202_retry_with_async_and_location_header_initial( # pylint: disable=name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1388,7 +1388,7 @@ def get_long_running_output(pipeline_response): def _put201_succeeded_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1532,7 +1532,7 @@ def get_long_running_output(pipeline_response): ) def _post202_list_initial(self, **kwargs: Any) -> Optional[List[_models.Product]]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1626,7 +1626,7 @@ def get_long_running_output(pipeline_response): def _put200_succeeded_no_state_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1772,7 +1772,7 @@ def get_long_running_output(pipeline_response): def _put202_retry200_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1921,7 +1921,7 @@ def get_long_running_output(pipeline_response): def _put201_creating_succeeded200_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2074,7 +2074,7 @@ def get_long_running_output(pipeline_response): def _put200_updating_succeeded204_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2223,7 +2223,7 @@ def get_long_running_output(pipeline_response): def _put201_creating_failed200_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2376,7 +2376,7 @@ def get_long_running_output(pipeline_response): def _put200_acceptedcanceled200_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2525,7 +2525,7 @@ def get_long_running_output(pipeline_response): def _put_no_header_in_retry_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2678,7 +2678,7 @@ def get_long_running_output(pipeline_response): def _put_async_retry_succeeded_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2842,7 +2842,7 @@ def get_long_running_output(pipeline_response): def _put_async_no_retry_succeeded_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3004,7 +3004,7 @@ def get_long_running_output(pipeline_response): def _put_async_retry_failed_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3168,7 +3168,7 @@ def get_long_running_output(pipeline_response): def _put_async_no_retrycanceled_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3330,7 +3330,7 @@ def get_long_running_output(pipeline_response): def _put_async_no_header_in_retry_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3490,7 +3490,7 @@ def get_long_running_output(pipeline_response): def _put_non_resource_initial( self, sku: Optional[Union[_models.Sku, IO[bytes]]] = None, **kwargs: Any ) -> _models.Sku: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3625,7 +3625,7 @@ def get_long_running_output(pipeline_response): def _put_async_non_resource_initial( self, sku: Optional[Union[_models.Sku, IO[bytes]]] = None, **kwargs: Any ) -> _models.Sku: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3758,7 +3758,7 @@ def get_long_running_output(pipeline_response): return LROPoller[_models.Sku](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _put_sub_resource_initial(self, provisioning_state: Optional[str] = None, **kwargs: Any) -> _models.SubProduct: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3862,7 +3862,7 @@ def get_long_running_output(pipeline_response): def _put_async_sub_resource_initial( self, provisioning_state: Optional[str] = None, **kwargs: Any ) -> _models.SubProduct: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3966,7 +3966,7 @@ def get_long_running_output(pipeline_response): def _delete_provisioning202_accepted200_succeeded_initial( # pylint: disable=name-too-long self, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4063,7 +4063,7 @@ def get_long_running_output(pipeline_response): def _delete_provisioning202_deleting_failed200_initial( # pylint: disable=name-too-long self, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4160,7 +4160,7 @@ def get_long_running_output(pipeline_response): def _delete_provisioning202_deletingcanceled200_initial( # pylint: disable=name-too-long self, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4255,7 +4255,7 @@ def get_long_running_output(pipeline_response): ) def _delete204_succeeded_initial(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4330,7 +4330,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _delete202_retry200_initial(self, **kwargs: Any) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4421,7 +4421,7 @@ def get_long_running_output(pipeline_response): ) def _delete202_no_retry204_initial(self, **kwargs: Any) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4514,7 +4514,7 @@ def get_long_running_output(pipeline_response): def _delete_no_header_in_retry_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4596,7 +4596,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _delete_async_no_header_in_retry_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4678,7 +4678,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _delete_async_retry_succeeded_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4763,7 +4763,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _delete_async_no_retry_succeeded_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4848,7 +4848,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _delete_async_retry_failed_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4933,7 +4933,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _delete_async_retrycanceled_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5016,7 +5016,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _post200_with_payload_initial(self, **kwargs: Any) -> _models.Sku: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5104,7 +5104,7 @@ def get_long_running_output(pipeline_response): def _post202_retry200_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5246,7 +5246,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _post202_no_retry204_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5401,7 +5401,7 @@ def get_long_running_output(pipeline_response): def _post_double_headers_final_location_get_initial( # pylint: disable=name-too-long self, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5492,7 +5492,7 @@ def get_long_running_output(pipeline_response): def _post_double_headers_final_azure_header_get_initial( # pylint: disable=name-too-long self, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5583,7 +5583,7 @@ def get_long_running_output(pipeline_response): def _post_double_headers_final_azure_header_get_default_initial( # pylint: disable=name-too-long self, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5672,7 +5672,7 @@ def get_long_running_output(pipeline_response): def _post_async_retry_succeeded_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5831,7 +5831,7 @@ def get_long_running_output(pipeline_response): def _post_async_no_retry_succeeded_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5990,7 +5990,7 @@ def get_long_running_output(pipeline_response): def _post_async_retry_failed_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6138,7 +6138,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _post_async_retrycanceled_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py index b650cbd4233..0276239f4c5 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py @@ -500,7 +500,7 @@ def __init__(self, *args, **kwargs): def _put_non_retry400_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -647,7 +647,7 @@ def get_long_running_output(pipeline_response): def _put_non_retry201_creating400_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -797,7 +797,7 @@ def get_long_running_output(pipeline_response): def _put_non_retry201_creating400_invalid_json_initial( # pylint: disable=name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -947,7 +947,7 @@ def get_long_running_output(pipeline_response): def _put_async_relative_retry400_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1106,7 +1106,7 @@ def get_long_running_output(pipeline_response): ) def _delete_non_retry400_initial(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1185,7 +1185,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _delete202_non_retry400_initial(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1266,7 +1266,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _delete_async_relative_retry400_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1351,7 +1351,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _post_non_retry400_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1490,7 +1490,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _post202_non_retry400_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1629,7 +1629,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _post_async_relative_retry400_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1774,7 +1774,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _put_error201_no_provisioning_state_payload_initial( # pylint: disable=name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1921,7 +1921,7 @@ def get_long_running_output(pipeline_response): def _put_async_relative_retry_no_status_initial( # pylint: disable=name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2085,7 +2085,7 @@ def get_long_running_output(pipeline_response): def _put_async_relative_retry_no_status_payload_initial( # pylint: disable=name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2247,7 +2247,7 @@ def get_long_running_output(pipeline_response): ) def _delete204_succeeded_initial(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2324,7 +2324,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _delete_async_relative_retry_no_status_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2411,7 +2411,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _post202_no_location_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2553,7 +2553,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _post_async_relative_retry_no_payload_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2701,7 +2701,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _put200_invalid_json_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2849,7 +2849,7 @@ def get_long_running_output(pipeline_response): def _put_async_relative_retry_invalid_header_initial( # pylint: disable=name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3013,7 +3013,7 @@ def get_long_running_output(pipeline_response): def _put_async_relative_retry_invalid_json_polling_initial( # pylint: disable=name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> _models.Product: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3177,7 +3177,7 @@ def get_long_running_output(pipeline_response): def _delete202_retry_invalid_header_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3259,7 +3259,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _delete_async_relative_retry_invalid_header_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3346,7 +3346,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _delete_async_relative_retry_invalid_json_polling_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3433,7 +3433,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _post202_retry_invalid_header_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3575,7 +3575,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _post_async_relative_retry_invalid_header_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3723,7 +3723,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _post_async_relative_retry_invalid_json_polling_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/LroWithParameterizedEndpoints/lrowithparameterizedendpoints/aio/operations/_lro_with_paramaterized_endpoints_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/LroWithParameterizedEndpoints/lrowithparameterizedendpoints/aio/operations/_lro_with_paramaterized_endpoints_operations.py index 9246f97979a..4a9fe6c3b51 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/LroWithParameterizedEndpoints/lrowithparameterizedendpoints/aio/operations/_lro_with_paramaterized_endpoints_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/LroWithParameterizedEndpoints/lrowithparameterizedendpoints/aio/operations/_lro_with_paramaterized_endpoints_operations.py @@ -46,7 +46,7 @@ class LROWithParamaterizedEndpointsOperationsMixin( # pylint: disable=name-too- async def _poll_with_parameterized_endpoints_initial( # pylint: disable=name-too-long self, account_name: str, **kwargs: Any ) -> Optional[str]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -155,7 +155,7 @@ def get_long_running_output(pipeline_response): async def _poll_with_constant_parameterized_endpoints_initial( # pylint: disable=name-too-long self, account_name: str, **kwargs: Any ) -> Optional[str]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/LroWithParameterizedEndpoints/lrowithparameterizedendpoints/operations/_lro_with_paramaterized_endpoints_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/LroWithParameterizedEndpoints/lrowithparameterizedendpoints/operations/_lro_with_paramaterized_endpoints_operations.py index 50f2b3ae1f1..610df0d980f 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/LroWithParameterizedEndpoints/lrowithparameterizedendpoints/operations/_lro_with_paramaterized_endpoints_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/LroWithParameterizedEndpoints/lrowithparameterizedendpoints/operations/_lro_with_paramaterized_endpoints_operations.py @@ -82,7 +82,7 @@ class LROWithParamaterizedEndpointsOperationsMixin( # pylint: disable=name-too- def _poll_with_parameterized_endpoints_initial( # pylint: disable=name-too-long self, account_name: str, **kwargs: Any ) -> Optional[str]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -191,7 +191,7 @@ def get_long_running_output(pipeline_response): def _poll_with_constant_parameterized_endpoints_initial( # pylint: disable=name-too-long self, account_name: str, **kwargs: Any ) -> Optional[str]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_api_version_default_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_api_version_default_operations.py index 3f9a9d2e839..18c1375017c 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_api_version_default_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_api_version_default_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -67,7 +67,7 @@ async def get_method_global_valid(self, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -114,7 +114,7 @@ async def get_method_global_not_provided_valid( # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -159,7 +159,7 @@ async def get_path_global_valid(self, **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -204,7 +204,7 @@ async def get_swagger_global_valid(self, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_api_version_local_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_api_version_local_operations.py index 2beb2f5ce0b..0fde5063c11 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_api_version_local_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_api_version_local_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -67,7 +67,7 @@ async def get_method_local_valid(self, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -117,7 +117,7 @@ async def get_method_local_null( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +161,7 @@ async def get_path_local_valid(self, **kwargs: Any) -> None: # pylint: disable= :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -206,7 +206,7 @@ async def get_swagger_local_valid(self, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_header_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_header_operations.py index 528f936a3ae..df4faff08a4 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_header_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_header_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -69,7 +69,7 @@ async def custom_named_request_id( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -124,7 +124,7 @@ async def custom_named_request_id_param_grouping( # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -179,7 +179,7 @@ async def custom_named_request_id_head( # pylint: disable=inconsistent-return-s :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_http_success_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_http_success_operations.py index 2808803f711..d7f60f2c8f6 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_http_success_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_http_success_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -61,7 +61,7 @@ async def head200(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -103,7 +103,7 @@ async def head204(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -145,7 +145,7 @@ async def head404(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_odata_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_odata_operations.py index 53c0cd26163..d3fd4ad77b8 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_odata_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_odata_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -70,7 +70,7 @@ async def get_with_filter( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_skip_url_encoding_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_skip_url_encoding_operations.py index 4dcb37af03f..375d0a269f4 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_skip_url_encoding_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_skip_url_encoding_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -74,7 +74,7 @@ async def get_method_path_valid( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -122,7 +122,7 @@ async def get_path_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -166,7 +166,7 @@ async def get_swagger_path_valid(self, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -215,7 +215,7 @@ async def get_method_query_valid( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -263,7 +263,7 @@ async def get_method_query_null( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -311,7 +311,7 @@ async def get_path_query_valid( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -355,7 +355,7 @@ async def get_swagger_query_valid(self, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_subscription_in_credentials_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_subscription_in_credentials_operations.py index 9c10b057d99..71cf20f20c6 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_subscription_in_credentials_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_subscription_in_credentials_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -69,7 +69,7 @@ async def post_method_global_valid(self, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -114,7 +114,7 @@ async def post_method_global_null(self, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +161,7 @@ async def post_method_global_not_provided_valid( # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -208,7 +208,7 @@ async def post_path_global_valid(self, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -253,7 +253,7 @@ async def post_swagger_global_valid(self, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_subscription_in_method_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_subscription_in_method_operations.py index 7857393831f..24217f975c3 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_subscription_in_method_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_subscription_in_method_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -72,7 +72,7 @@ async def post_method_local_valid( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -122,7 +122,7 @@ async def post_method_local_null( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +172,7 @@ async def post_path_local_valid( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -222,7 +222,7 @@ async def post_swagger_local_valid( # pylint: disable=inconsistent-return-state :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_xms_client_request_id_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_xms_client_request_id_operations.py index 81f18ab37d4..f1578497a44 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_xms_client_request_id_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/aio/operations/_xms_client_request_id_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -62,7 +62,7 @@ async def get(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -110,7 +110,7 @@ async def param_get( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_api_version_default_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_api_version_default_operations.py index 1d077ad1916..1d6ec3e013d 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_api_version_default_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_api_version_default_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -143,7 +143,7 @@ def get_method_global_valid(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -190,7 +190,7 @@ def get_method_global_not_provided_valid( # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -235,7 +235,7 @@ def get_path_global_valid(self, **kwargs: Any) -> None: # pylint: disable=incon :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -280,7 +280,7 @@ def get_swagger_global_valid(self, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_api_version_local_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_api_version_local_operations.py index 54a597fa090..720966b85ae 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_api_version_local_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_api_version_local_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -141,7 +141,7 @@ def get_method_local_valid(self, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -191,7 +191,7 @@ def get_method_local_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -235,7 +235,7 @@ def get_path_local_valid(self, **kwargs: Any) -> None: # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -280,7 +280,7 @@ def get_swagger_local_valid(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_header_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_header_operations.py index 2034a1fc6bb..1923aa0b5cc 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_header_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_header_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -118,7 +118,7 @@ def custom_named_request_id( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -173,7 +173,7 @@ def custom_named_request_id_param_grouping( # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -228,7 +228,7 @@ def custom_named_request_id_head( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_http_success_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_http_success_operations.py index 6070dfedbff..ffb94b444ff 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_http_success_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_http_success_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -85,7 +85,7 @@ def head200(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -127,7 +127,7 @@ def head204(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +169,7 @@ def head404(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_odata_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_odata_operations.py index da80e8d4734..131049f32c7 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_odata_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_odata_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -99,7 +99,7 @@ def get_with_filter( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_skip_url_encoding_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_skip_url_encoding_operations.py index 166265cf45e..e1d2952e90b 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_skip_url_encoding_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_skip_url_encoding_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -201,7 +201,7 @@ def get_method_path_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -249,7 +249,7 @@ def get_path_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -293,7 +293,7 @@ def get_swagger_path_valid(self, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -340,7 +340,7 @@ def get_method_query_valid(self, q1: str, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -388,7 +388,7 @@ def get_method_query_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -434,7 +434,7 @@ def get_path_query_valid(self, q1: str, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -478,7 +478,7 @@ def get_swagger_query_valid(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_subscription_in_credentials_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_subscription_in_credentials_operations.py index 41712bb5cb3..4f7854a2aca 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_subscription_in_credentials_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_subscription_in_credentials_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -182,7 +182,7 @@ def post_method_global_valid(self, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -227,7 +227,7 @@ def post_method_global_null(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -274,7 +274,7 @@ def post_method_global_not_provided_valid( # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -321,7 +321,7 @@ def post_path_global_valid(self, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -366,7 +366,7 @@ def post_swagger_global_valid(self, **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_subscription_in_method_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_subscription_in_method_operations.py index b22920040f2..ab138ae4374 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_subscription_in_method_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_subscription_in_method_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -157,7 +157,7 @@ def post_method_local_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -207,7 +207,7 @@ def post_method_local_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -257,7 +257,7 @@ def post_path_local_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -307,7 +307,7 @@ def post_swagger_local_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_xms_client_request_id_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_xms_client_request_id_operations.py index 5df3f7f5ef3..42ff8ed27b8 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_xms_client_request_id_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/MixedApiVersion/mixedapiversion/operations/_xms_client_request_id_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -88,7 +88,7 @@ def get(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -136,7 +136,7 @@ def param_get( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/azure/packagemode/batch/head/aio/operations/_http_success_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/azure/packagemode/batch/head/aio/operations/_http_success_operations.py index e03dacc816a..0a902dfce93 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/azure/packagemode/batch/head/aio/operations/_http_success_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/azure/packagemode/batch/head/aio/operations/_http_success_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -59,7 +59,7 @@ async def head200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -102,7 +102,7 @@ async def head204(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -145,7 +145,7 @@ async def head404(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/azure/packagemode/batch/head/operations/_http_success_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/azure/packagemode/batch/head/operations/_http_success_operations.py index 9fbfa6fa61d..a72990bcc20 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/azure/packagemode/batch/head/operations/_http_success_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/azure/packagemode/batch/head/operations/_http_success_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -83,7 +83,7 @@ def head200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -126,7 +126,7 @@ def head204(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +169,7 @@ def head404(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/azure/packagemode/batch/paging/aio/operations/_paging_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/azure/packagemode/batch/paging/aio/operations/_paging_operations.py index cd3af171811..d871aaf664e 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/azure/packagemode/batch/paging/aio/operations/_paging_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/azure/packagemode/batch/paging/aio/operations/_paging_operations.py @@ -100,7 +100,7 @@ def get_no_item_name_pages(self, **kwargs: Any) -> AsyncIterable["_models.Produc cls: ClsType[_models.ProductResultValue] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -173,7 +173,7 @@ def get_empty_next_link_name_pages(self, **kwargs: Any) -> AsyncIterable["_model cls: ClsType[_models.ProductResultValue] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -246,7 +246,7 @@ def get_null_next_link_name_pages(self, **kwargs: Any) -> AsyncIterable["_models cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -319,7 +319,7 @@ def get_single_pages(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -397,7 +397,7 @@ def get_single_pages_with_body_params( content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -475,7 +475,7 @@ def first_response_empty(self, **kwargs: Any) -> AsyncIterable["_models.Product" cls: ClsType[_models.ProductResultValue] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -558,7 +558,7 @@ def get_multiple_pages( cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -644,7 +644,7 @@ def get_with_query_params(self, required_query_parameter: int, **kwargs: Any) -> query_constant: Literal[True] = kwargs.pop("query_constant", _params.pop("queryConstant", True)) cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -717,7 +717,7 @@ def duplicate_params(self, filter: Optional[str] = None, **kwargs: Any) -> Async cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -796,7 +796,7 @@ def page_with_max_page_size( cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -880,7 +880,7 @@ def get_odata_multiple_pages( cls: ClsType[_models.OdataProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -971,7 +971,7 @@ def get_multiple_pages_with_offset( cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1056,7 +1056,7 @@ def get_multiple_pages_retry_first(self, **kwargs: Any) -> AsyncIterable["_model cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1130,7 +1130,7 @@ def get_multiple_pages_retry_second(self, **kwargs: Any) -> AsyncIterable["_mode cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1203,7 +1203,7 @@ def get_single_pages_failure(self, **kwargs: Any) -> AsyncIterable["_models.Prod cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1276,7 +1276,7 @@ def get_multiple_pages_failure(self, **kwargs: Any) -> AsyncIterable["_models.Pr cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1349,7 +1349,7 @@ def get_multiple_pages_failure_uri(self, **kwargs: Any) -> AsyncIterable["_model cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1428,7 +1428,7 @@ def get_multiple_pages_fragment_next_link( cls: ClsType[_models.OdataProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1503,7 +1503,7 @@ def get_multiple_pages_fragment_with_grouping_next_link( # pylint: disable=name cls: ClsType[_models.OdataProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1577,7 +1577,7 @@ async def _get_multiple_pages_lro_initial( paging_get_multiple_pages_lro_options: Optional[_models.PagingGetMultiplePagesLroOptions] = None, **kwargs: Any ) -> _models.ProductResult: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1650,7 +1650,7 @@ async def begin_get_multiple_pages_lro( cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1770,7 +1770,7 @@ def append_api_version(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1846,7 +1846,7 @@ def replace_api_version(self, **kwargs: Any) -> AsyncIterable["_models.Product"] api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1923,7 +1923,7 @@ def get_paging_model_with_item_name_with_xms_client_name( # pylint: disable=nam cls: ClsType[_models.ProductResultValueWithXMSClientName] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/azure/packagemode/batch/paging/operations/_paging_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/azure/packagemode/batch/paging/operations/_paging_operations.py index 35da9c7b5e8..355b32ad166 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/azure/packagemode/batch/paging/operations/_paging_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/azure/packagemode/batch/paging/operations/_paging_operations.py @@ -561,7 +561,7 @@ def get_no_item_name_pages(self, **kwargs: Any) -> Iterable["_models.Product"]: cls: ClsType[_models.ProductResultValue] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -634,7 +634,7 @@ def get_empty_next_link_name_pages(self, **kwargs: Any) -> Iterable["_models.Pro cls: ClsType[_models.ProductResultValue] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -707,7 +707,7 @@ def get_null_next_link_name_pages(self, **kwargs: Any) -> Iterable["_models.Prod cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -780,7 +780,7 @@ def get_single_pages(self, **kwargs: Any) -> Iterable["_models.Product"]: cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -858,7 +858,7 @@ def get_single_pages_with_body_params( content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -936,7 +936,7 @@ def first_response_empty(self, **kwargs: Any) -> Iterable["_models.Product"]: cls: ClsType[_models.ProductResultValue] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1019,7 +1019,7 @@ def get_multiple_pages( cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1105,7 +1105,7 @@ def get_with_query_params(self, required_query_parameter: int, **kwargs: Any) -> query_constant: Literal[True] = kwargs.pop("query_constant", _params.pop("queryConstant", True)) cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1178,7 +1178,7 @@ def duplicate_params(self, filter: Optional[str] = None, **kwargs: Any) -> Itera cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1255,7 +1255,7 @@ def page_with_max_page_size(self, maxpagesize: Literal["5"] = "5", **kwargs: Any cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1339,7 +1339,7 @@ def get_odata_multiple_pages( cls: ClsType[_models.OdataProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1430,7 +1430,7 @@ def get_multiple_pages_with_offset( cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1515,7 +1515,7 @@ def get_multiple_pages_retry_first(self, **kwargs: Any) -> Iterable["_models.Pro cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1589,7 +1589,7 @@ def get_multiple_pages_retry_second(self, **kwargs: Any) -> Iterable["_models.Pr cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1662,7 +1662,7 @@ def get_single_pages_failure(self, **kwargs: Any) -> Iterable["_models.Product"] cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1735,7 +1735,7 @@ def get_multiple_pages_failure(self, **kwargs: Any) -> Iterable["_models.Product cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1808,7 +1808,7 @@ def get_multiple_pages_failure_uri(self, **kwargs: Any) -> Iterable["_models.Pro cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1887,7 +1887,7 @@ def get_multiple_pages_fragment_next_link( cls: ClsType[_models.OdataProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1962,7 +1962,7 @@ def get_multiple_pages_fragment_with_grouping_next_link( # pylint: disable=name cls: ClsType[_models.OdataProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2036,7 +2036,7 @@ def _get_multiple_pages_lro_initial( paging_get_multiple_pages_lro_options: Optional[_models.PagingGetMultiplePagesLroOptions] = None, **kwargs: Any, ) -> _models.ProductResult: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2109,7 +2109,7 @@ def begin_get_multiple_pages_lro( cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2229,7 +2229,7 @@ def append_api_version(self, **kwargs: Any) -> Iterable["_models.Product"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2305,7 +2305,7 @@ def replace_api_version(self, **kwargs: Any) -> Iterable["_models.Product"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2382,7 +2382,7 @@ def get_paging_model_with_item_name_with_xms_client_name( # pylint: disable=nam cls: ClsType[_models.ProductResultValueWithXMSClientName] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeCustomize/azure/packagemode/customize/aio/operations/_http_success_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeCustomize/azure/packagemode/customize/aio/operations/_http_success_operations.py index 3a7ef30639c..bf318a6cc61 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeCustomize/azure/packagemode/customize/aio/operations/_http_success_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeCustomize/azure/packagemode/customize/aio/operations/_http_success_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -59,7 +59,7 @@ async def head200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -102,7 +102,7 @@ async def head204(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -145,7 +145,7 @@ async def head404(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeCustomize/azure/packagemode/customize/operations/_http_success_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeCustomize/azure/packagemode/customize/operations/_http_success_operations.py index 0b647071971..57b45055e0a 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeCustomize/azure/packagemode/customize/operations/_http_success_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeCustomize/azure/packagemode/customize/operations/_http_success_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -83,7 +83,7 @@ def head200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -126,7 +126,7 @@ def head204(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +169,7 @@ def head404(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeDataPlane/azure/packagemode/dataplane/aio/operations/_http_success_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeDataPlane/azure/packagemode/dataplane/aio/operations/_http_success_operations.py index ea673e144aa..c14f6190089 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeDataPlane/azure/packagemode/dataplane/aio/operations/_http_success_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeDataPlane/azure/packagemode/dataplane/aio/operations/_http_success_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -59,7 +59,7 @@ async def head200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -102,7 +102,7 @@ async def head204(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -145,7 +145,7 @@ async def head404(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeDataPlane/azure/packagemode/dataplane/operations/_http_success_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeDataPlane/azure/packagemode/dataplane/operations/_http_success_operations.py index 7b831170305..5093bff127c 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeDataPlane/azure/packagemode/dataplane/operations/_http_success_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeDataPlane/azure/packagemode/dataplane/operations/_http_success_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -83,7 +83,7 @@ def head200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -126,7 +126,7 @@ def head204(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +169,7 @@ def head404(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeMgmtPlane/azure/package/mode/aio/operations/_http_success_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeMgmtPlane/azure/package/mode/aio/operations/_http_success_operations.py index 7345730f265..b520a878214 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeMgmtPlane/azure/package/mode/aio/operations/_http_success_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeMgmtPlane/azure/package/mode/aio/operations/_http_success_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -59,7 +59,7 @@ async def head200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -102,7 +102,7 @@ async def head204(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -145,7 +145,7 @@ async def head404(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeMgmtPlane/azure/package/mode/operations/_http_success_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeMgmtPlane/azure/package/mode/operations/_http_success_operations.py index 4d659f5cbfc..288d8b8d4c2 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeMgmtPlane/azure/package/mode/operations/_http_success_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeMgmtPlane/azure/package/mode/operations/_http_success_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -83,7 +83,7 @@ def head200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -126,7 +126,7 @@ def head204(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +169,7 @@ def head404(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Paging/paging/aio/operations/_paging_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Paging/paging/aio/operations/_paging_operations.py index e8585ae3b2e..dd8d3c680ac 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Paging/paging/aio/operations/_paging_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Paging/paging/aio/operations/_paging_operations.py @@ -99,7 +99,7 @@ def get_no_item_name_pages(self, **kwargs: Any) -> AsyncIterable["_models.Produc cls: ClsType[_models.ProductResultValue] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +172,7 @@ def get_empty_next_link_name_pages(self, **kwargs: Any) -> AsyncIterable["_model cls: ClsType[_models.ProductResultValue] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -245,7 +245,7 @@ def get_null_next_link_name_pages(self, **kwargs: Any) -> AsyncIterable["_models cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -318,7 +318,7 @@ def get_single_pages(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -396,7 +396,7 @@ def get_single_pages_with_body_params( content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -474,7 +474,7 @@ def first_response_empty(self, **kwargs: Any) -> AsyncIterable["_models.Product" cls: ClsType[_models.ProductResultValue] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -556,7 +556,7 @@ def get_multiple_pages( cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -642,7 +642,7 @@ def get_with_query_params(self, required_query_parameter: int, **kwargs: Any) -> query_constant: Literal[True] = kwargs.pop("query_constant", _params.pop("queryConstant", True)) cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -715,7 +715,7 @@ def duplicate_params(self, filter: Optional[str] = None, **kwargs: Any) -> Async cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -794,7 +794,7 @@ def page_with_max_page_size( cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -878,7 +878,7 @@ def get_odata_multiple_pages( cls: ClsType[_models.OdataProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -969,7 +969,7 @@ def get_multiple_pages_with_offset( cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1054,7 +1054,7 @@ def get_multiple_pages_retry_first(self, **kwargs: Any) -> AsyncIterable["_model cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1128,7 +1128,7 @@ def get_multiple_pages_retry_second(self, **kwargs: Any) -> AsyncIterable["_mode cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1201,7 +1201,7 @@ def get_single_pages_failure(self, **kwargs: Any) -> AsyncIterable["_models.Prod cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1274,7 +1274,7 @@ def get_multiple_pages_failure(self, **kwargs: Any) -> AsyncIterable["_models.Pr cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1347,7 +1347,7 @@ def get_multiple_pages_failure_uri(self, **kwargs: Any) -> AsyncIterable["_model cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1426,7 +1426,7 @@ def get_multiple_pages_fragment_next_link( cls: ClsType[_models.OdataProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1501,7 +1501,7 @@ def get_multiple_pages_fragment_with_grouping_next_link( # pylint: disable=name cls: ClsType[_models.OdataProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1575,7 +1575,7 @@ async def _get_multiple_pages_lro_initial( paging_get_multiple_pages_lro_options: Optional[_models.PagingGetMultiplePagesLroOptions] = None, **kwargs: Any ) -> _models.ProductResult: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1647,7 +1647,7 @@ async def begin_get_multiple_pages_lro( cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1767,7 +1767,7 @@ def append_api_version(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1843,7 +1843,7 @@ def replace_api_version(self, **kwargs: Any) -> AsyncIterable["_models.Product"] api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1920,7 +1920,7 @@ def get_paging_model_with_item_name_with_xms_client_name( # pylint: disable=nam cls: ClsType[_models.ProductResultValueWithXMSClientName] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py index c8ff50015b0..3ec35c26d99 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py @@ -560,7 +560,7 @@ def get_no_item_name_pages(self, **kwargs: Any) -> Iterable["_models.Product"]: cls: ClsType[_models.ProductResultValue] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -633,7 +633,7 @@ def get_empty_next_link_name_pages(self, **kwargs: Any) -> Iterable["_models.Pro cls: ClsType[_models.ProductResultValue] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -706,7 +706,7 @@ def get_null_next_link_name_pages(self, **kwargs: Any) -> Iterable["_models.Prod cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -779,7 +779,7 @@ def get_single_pages(self, **kwargs: Any) -> Iterable["_models.Product"]: cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -857,7 +857,7 @@ def get_single_pages_with_body_params( content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -935,7 +935,7 @@ def first_response_empty(self, **kwargs: Any) -> Iterable["_models.Product"]: cls: ClsType[_models.ProductResultValue] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1017,7 +1017,7 @@ def get_multiple_pages( cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1103,7 +1103,7 @@ def get_with_query_params(self, required_query_parameter: int, **kwargs: Any) -> query_constant: Literal[True] = kwargs.pop("query_constant", _params.pop("queryConstant", True)) cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1176,7 +1176,7 @@ def duplicate_params(self, filter: Optional[str] = None, **kwargs: Any) -> Itera cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1253,7 +1253,7 @@ def page_with_max_page_size(self, maxpagesize: Literal["5"] = "5", **kwargs: Any cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1337,7 +1337,7 @@ def get_odata_multiple_pages( cls: ClsType[_models.OdataProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1428,7 +1428,7 @@ def get_multiple_pages_with_offset( cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1513,7 +1513,7 @@ def get_multiple_pages_retry_first(self, **kwargs: Any) -> Iterable["_models.Pro cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1587,7 +1587,7 @@ def get_multiple_pages_retry_second(self, **kwargs: Any) -> Iterable["_models.Pr cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1660,7 +1660,7 @@ def get_single_pages_failure(self, **kwargs: Any) -> Iterable["_models.Product"] cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1733,7 +1733,7 @@ def get_multiple_pages_failure(self, **kwargs: Any) -> Iterable["_models.Product cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1806,7 +1806,7 @@ def get_multiple_pages_failure_uri(self, **kwargs: Any) -> Iterable["_models.Pro cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1885,7 +1885,7 @@ def get_multiple_pages_fragment_next_link( cls: ClsType[_models.OdataProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1960,7 +1960,7 @@ def get_multiple_pages_fragment_with_grouping_next_link( # pylint: disable=name cls: ClsType[_models.OdataProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2034,7 +2034,7 @@ def _get_multiple_pages_lro_initial( paging_get_multiple_pages_lro_options: Optional[_models.PagingGetMultiplePagesLroOptions] = None, **kwargs: Any, ) -> _models.ProductResult: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2105,7 +2105,7 @@ def begin_get_multiple_pages_lro( cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2225,7 +2225,7 @@ def append_api_version(self, **kwargs: Any) -> Iterable["_models.Product"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2301,7 +2301,7 @@ def replace_api_version(self, **kwargs: Any) -> Iterable["_models.Product"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ProductResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2378,7 +2378,7 @@ def get_paging_model_with_item_name_with_xms_client_name( # pylint: disable=nam cls: ClsType[_models.ProductResultValueWithXMSClientName] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SecurityAadSwagger/securityaadswagger/aio/operations/_autorest_security_aad_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SecurityAadSwagger/securityaadswagger/aio/operations/_autorest_security_aad_operations.py index 92c20a9e065..71d8e38328a 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SecurityAadSwagger/securityaadswagger/aio/operations/_autorest_security_aad_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SecurityAadSwagger/securityaadswagger/aio/operations/_autorest_security_aad_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -44,7 +44,7 @@ async def head(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SecurityAadSwagger/securityaadswagger/operations/_autorest_security_aad_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SecurityAadSwagger/securityaadswagger/operations/_autorest_security_aad_operations.py index bfd0c0adc28..5054ad7d923 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SecurityAadSwagger/securityaadswagger/operations/_autorest_security_aad_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SecurityAadSwagger/securityaadswagger/operations/_autorest_security_aad_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -53,7 +53,7 @@ def head(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SecurityKeySwagger/securitykeyswagger/aio/operations/_autorest_security_key_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SecurityKeySwagger/securitykeyswagger/aio/operations/_autorest_security_key_operations.py index 26729e1fd25..dca9c40c332 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SecurityKeySwagger/securitykeyswagger/aio/operations/_autorest_security_key_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SecurityKeySwagger/securitykeyswagger/aio/operations/_autorest_security_key_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -44,7 +44,7 @@ async def head(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SecurityKeySwagger/securitykeyswagger/operations/_autorest_security_key_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SecurityKeySwagger/securitykeyswagger/operations/_autorest_security_key_operations.py index b3bde172271..2b72d365cd9 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SecurityKeySwagger/securitykeyswagger/operations/_autorest_security_key_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SecurityKeySwagger/securitykeyswagger/operations/_autorest_security_key_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -53,7 +53,7 @@ def head(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations/_storage_accounts_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations/_storage_accounts_operations.py index 4b3b57c7890..66fd7283049 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations/_storage_accounts_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations/_storage_accounts_operations.py @@ -126,7 +126,7 @@ async def check_name_availability( :rtype: ~storage.models.CheckNameAvailabilityResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -186,7 +186,7 @@ async def _create_initial( parameters: Union[_models.StorageAccountCreateParameters, IO[bytes]], **kwargs: Any ) -> Optional[_models.StorageAccount]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -400,7 +400,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +458,7 @@ async def get_properties( :rtype: ~storage.models.StorageAccount :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -604,7 +604,7 @@ async def update( :rtype: ~storage.models.StorageAccount :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -672,7 +672,7 @@ async def list_keys(self, resource_group_name: str, account_name: str, **kwargs: :rtype: ~storage.models.StorageAccountKeys :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -730,7 +730,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.StorageAccount"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.StorageAccountListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -812,7 +812,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.StorageAccountListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -898,7 +898,7 @@ async def regenerate_key( :rtype: ~storage.models.StorageAccountKeys :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations/_usage_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations/_usage_operations.py index 986b796cd9e..37b93dded15 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations/_usage_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations/_usage_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -63,7 +63,7 @@ async def list(self, **kwargs: Any) -> _models.UsageListResult: :rtype: ~storage.models.UsageListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_storage_accounts_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_storage_accounts_operations.py index 466733ac72b..38153d5b49e 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_storage_accounts_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_storage_accounts_operations.py @@ -388,7 +388,7 @@ def check_name_availability( :rtype: ~storage.models.CheckNameAvailabilityResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -448,7 +448,7 @@ def _create_initial( parameters: Union[_models.StorageAccountCreateParameters, IO[bytes]], **kwargs: Any ) -> Optional[_models.StorageAccount]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -662,7 +662,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -718,7 +718,7 @@ def get_properties(self, resource_group_name: str, account_name: str, **kwargs: :rtype: ~storage.models.StorageAccount :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -864,7 +864,7 @@ def update( :rtype: ~storage.models.StorageAccount :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -932,7 +932,7 @@ def list_keys(self, resource_group_name: str, account_name: str, **kwargs: Any) :rtype: ~storage.models.StorageAccountKeys :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -990,7 +990,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.StorageAccount"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.StorageAccountListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1070,7 +1070,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.StorageAccountListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1156,7 +1156,7 @@ def regenerate_key( :rtype: ~storage.models.StorageAccountKeys :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_usage_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_usage_operations.py index 68e1a8cc7b7..6f4fba00699 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_usage_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_usage_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -90,7 +90,7 @@ def list(self, **kwargs: Any) -> _models.UsageListResult: :rtype: ~storage.models.UsageListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SubscriptionIdApiVersion/subscriptionidapiversion/aio/operations/_group_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SubscriptionIdApiVersion/subscriptionidapiversion/aio/operations/_group_operations.py index e533d6035a9..b7ea143c3c1 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SubscriptionIdApiVersion/subscriptionidapiversion/aio/operations/_group_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SubscriptionIdApiVersion/subscriptionidapiversion/aio/operations/_group_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -65,7 +65,7 @@ async def get_sample_resource_group(self, resource_group_name: str, **kwargs: An :rtype: ~subscriptionidapiversion.models.SampleResourceGroup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SubscriptionIdApiVersion/subscriptionidapiversion/operations/_group_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SubscriptionIdApiVersion/subscriptionidapiversion/operations/_group_operations.py index 5648a2b2d1a..4c4836bc630 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SubscriptionIdApiVersion/subscriptionidapiversion/operations/_group_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/SubscriptionIdApiVersion/subscriptionidapiversion/operations/_group_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -95,7 +95,7 @@ def get_sample_resource_group(self, resource_group_name: str, **kwargs: Any) -> :rtype: ~subscriptionidapiversion.models.SampleResourceGroup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureBodyDurationVersionTolerant/bodydurationversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureBodyDurationVersionTolerant/bodydurationversiontolerant/aio/operations/_operations.py index d83541e2e02..b09d2393546 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureBodyDurationVersionTolerant/bodydurationversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureBodyDurationVersionTolerant/bodydurationversiontolerant/aio/operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -63,7 +63,7 @@ async def get_null(self, **kwargs: Any) -> Optional[datetime.timedelta]: :rtype: ~datetime.timedelta or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -117,7 +117,7 @@ async def put_positive_duration( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +165,7 @@ async def get_positive_duration(self, **kwargs: Any) -> datetime.timedelta: :rtype: ~datetime.timedelta :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -215,7 +215,7 @@ async def get_invalid(self, **kwargs: Any) -> datetime.timedelta: :rtype: ~datetime.timedelta :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureBodyDurationVersionTolerant/bodydurationversiontolerant/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureBodyDurationVersionTolerant/bodydurationversiontolerant/operations/_operations.py index 50e1d1adc5d..721a011698b 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureBodyDurationVersionTolerant/bodydurationversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureBodyDurationVersionTolerant/bodydurationversiontolerant/operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -122,7 +122,7 @@ def get_null(self, **kwargs: Any) -> Optional[datetime.timedelta]: :rtype: ~datetime.timedelta or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -176,7 +176,7 @@ def put_positive_duration( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -224,7 +224,7 @@ def get_positive_duration(self, **kwargs: Any) -> datetime.timedelta: :rtype: ~datetime.timedelta :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -274,7 +274,7 @@ def get_invalid(self, **kwargs: Any) -> datetime.timedelta: :rtype: ~datetime.timedelta :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureParameterGroupingVersionTolerant/azureparametergroupingversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureParameterGroupingVersionTolerant/azureparametergroupingversiontolerant/aio/operations/_operations.py index eb1b86f8e63..dd0e66297f8 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureParameterGroupingVersionTolerant/azureparametergroupingversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureParameterGroupingVersionTolerant/azureparametergroupingversiontolerant/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -74,7 +74,7 @@ async def post_required( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -131,7 +131,7 @@ async def post_optional( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -184,7 +184,7 @@ async def post_reserved_words( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -245,7 +245,7 @@ async def post_multi_param_groups( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -298,7 +298,7 @@ async def post_shared_parameter_group_object( # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -356,7 +356,7 @@ async def group_with_constant( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureParameterGroupingVersionTolerant/azureparametergroupingversiontolerant/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureParameterGroupingVersionTolerant/azureparametergroupingversiontolerant/operations/_operations.py index 55bc152f6f4..e1fb881442b 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureParameterGroupingVersionTolerant/azureparametergroupingversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureParameterGroupingVersionTolerant/azureparametergroupingversiontolerant/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -216,7 +216,7 @@ def post_required( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -273,7 +273,7 @@ def post_optional( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -326,7 +326,7 @@ def post_reserved_words( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -387,7 +387,7 @@ def post_multi_param_groups( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -440,7 +440,7 @@ def post_shared_parameter_group_object( # pylint: disable=inconsistent-return-s :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -498,7 +498,7 @@ def group_with_constant( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureReportVersionTolerant/azurereportversiontolerant/_operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureReportVersionTolerant/azurereportversiontolerant/_operations/_operations.py index 07138767872..b86fe97533b 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureReportVersionTolerant/azurereportversiontolerant/_operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureReportVersionTolerant/azurereportversiontolerant/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -80,7 +80,7 @@ def get_report(self, *, qualifier: Optional[str] = None, **kwargs: Any) -> Dict[ "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureReportVersionTolerant/azurereportversiontolerant/aio/_operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureReportVersionTolerant/azurereportversiontolerant/aio/_operations/_operations.py index 070e13c9c75..64a46960010 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureReportVersionTolerant/azurereportversiontolerant/aio/_operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureReportVersionTolerant/azurereportversiontolerant/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -55,7 +55,7 @@ async def get_report(self, *, qualifier: Optional[str] = None, **kwargs: Any) -> "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureSpecialsVersionTolerant/azurespecialpropertiesversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureSpecialsVersionTolerant/azurespecialpropertiesversiontolerant/aio/operations/_operations.py index a098ecfa90c..ee005be97e9 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureSpecialsVersionTolerant/azurespecialpropertiesversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureSpecialsVersionTolerant/azurespecialpropertiesversiontolerant/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -90,7 +90,7 @@ async def get(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -134,7 +134,7 @@ async def param_get(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -196,7 +196,7 @@ async def post_method_global_valid(self, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -241,7 +241,7 @@ async def post_method_global_null(self, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -288,7 +288,7 @@ async def post_method_global_not_provided_valid( # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -334,7 +334,7 @@ async def post_path_global_valid(self, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -379,7 +379,7 @@ async def post_swagger_global_valid(self, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -447,7 +447,7 @@ async def post_method_local_valid( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -497,7 +497,7 @@ async def post_method_local_null( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -547,7 +547,7 @@ async def post_path_local_valid( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -597,7 +597,7 @@ async def post_swagger_local_valid( # pylint: disable=inconsistent-return-state :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -659,7 +659,7 @@ async def get_method_global_valid(self, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -705,7 +705,7 @@ async def get_method_global_not_provided_valid( # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -749,7 +749,7 @@ async def get_path_global_valid(self, **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -793,7 +793,7 @@ async def get_swagger_global_valid(self, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -855,7 +855,7 @@ async def get_method_local_valid(self, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -905,7 +905,7 @@ async def get_method_local_null( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -949,7 +949,7 @@ async def get_path_local_valid(self, **kwargs: Any) -> None: # pylint: disable= :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -994,7 +994,7 @@ async def get_swagger_local_valid(self, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1061,7 +1061,7 @@ async def get_method_path_valid( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1109,7 +1109,7 @@ async def get_path_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1153,7 +1153,7 @@ async def get_swagger_path_valid(self, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1202,7 +1202,7 @@ async def get_method_query_valid( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1250,7 +1250,7 @@ async def get_method_query_null( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1298,7 +1298,7 @@ async def get_path_query_valid( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1342,7 +1342,7 @@ async def get_swagger_query_valid(self, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1414,7 +1414,7 @@ async def get_with_filter( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1482,7 +1482,7 @@ async def custom_named_request_id( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1534,7 +1534,7 @@ async def custom_named_request_id_param_grouping( # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1583,7 +1583,7 @@ async def custom_named_request_id_head(self, *, foo_client_request_id: str, **kw :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureSpecialsVersionTolerant/azurespecialpropertiesversiontolerant/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureSpecialsVersionTolerant/azurespecialpropertiesversiontolerant/operations/_operations.py index fa4bd0f7291..ccef56a1275 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureSpecialsVersionTolerant/azurespecialpropertiesversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/AzureSpecialsVersionTolerant/azurespecialpropertiesversiontolerant/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -667,7 +667,7 @@ def get(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -711,7 +711,7 @@ def param_get(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -773,7 +773,7 @@ def post_method_global_valid(self, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -818,7 +818,7 @@ def post_method_global_null(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -865,7 +865,7 @@ def post_method_global_not_provided_valid( # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -911,7 +911,7 @@ def post_path_global_valid(self, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -956,7 +956,7 @@ def post_swagger_global_valid(self, **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1024,7 +1024,7 @@ def post_method_local_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1074,7 +1074,7 @@ def post_method_local_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1124,7 +1124,7 @@ def post_path_local_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1174,7 +1174,7 @@ def post_swagger_local_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1236,7 +1236,7 @@ def get_method_global_valid(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1282,7 +1282,7 @@ def get_method_global_not_provided_valid( # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1326,7 +1326,7 @@ def get_path_global_valid(self, **kwargs: Any) -> None: # pylint: disable=incon :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1370,7 +1370,7 @@ def get_swagger_global_valid(self, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1432,7 +1432,7 @@ def get_method_local_valid(self, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1482,7 +1482,7 @@ def get_method_local_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1526,7 +1526,7 @@ def get_path_local_valid(self, **kwargs: Any) -> None: # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1571,7 +1571,7 @@ def get_swagger_local_valid(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1638,7 +1638,7 @@ def get_method_path_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1686,7 +1686,7 @@ def get_path_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1730,7 +1730,7 @@ def get_swagger_path_valid(self, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1779,7 +1779,7 @@ def get_method_query_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1827,7 +1827,7 @@ def get_method_query_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1873,7 +1873,7 @@ def get_path_query_valid(self, *, q1: str, **kwargs: Any) -> None: # pylint: di :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1917,7 +1917,7 @@ def get_swagger_query_valid(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1989,7 +1989,7 @@ def get_with_filter( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2057,7 +2057,7 @@ def custom_named_request_id( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2109,7 +2109,7 @@ def custom_named_request_id_param_grouping( # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2158,7 +2158,7 @@ def custom_named_request_id_head(self, *, foo_client_request_id: str, **kwargs: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomBaseUriVersionTolerant/custombaseurlversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomBaseUriVersionTolerant/custombaseurlversiontolerant/aio/operations/_operations.py index 37d9c210da9..8b0d932290e 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomBaseUriVersionTolerant/custombaseurlversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomBaseUriVersionTolerant/custombaseurlversiontolerant/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -60,7 +60,7 @@ async def get_empty( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomBaseUriVersionTolerant/custombaseurlversiontolerant/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomBaseUriVersionTolerant/custombaseurlversiontolerant/operations/_operations.py index c70f52c14d4..c76a4254912 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomBaseUriVersionTolerant/custombaseurlversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomBaseUriVersionTolerant/custombaseurlversiontolerant/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -76,7 +76,7 @@ def get_empty(self, account_name: str, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/custompollerpagerversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/custompollerpagerversiontolerant/aio/operations/_operations.py index b37c8ce9c0a..b1ff20f05ae 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/custompollerpagerversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/custompollerpagerversiontolerant/aio/operations/_operations.py @@ -110,7 +110,7 @@ def get_no_item_name_pages(self, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -194,7 +194,7 @@ def get_empty_next_link_name_pages(self, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -278,7 +278,7 @@ def get_null_next_link_name_pages(self, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -362,7 +362,7 @@ def get_single_pages(self, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -516,7 +516,7 @@ def get_single_pages_with_body_params( content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -611,7 +611,7 @@ def first_response_empty(self, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -703,7 +703,7 @@ def get_multiple_pages( cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -794,7 +794,7 @@ def get_with_query_params(self, *, required_query_parameter: int, **kwargs: Any) query_constant: Literal[True] = kwargs.pop("query_constant", _params.pop("queryConstant", True)) cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -878,7 +878,7 @@ def duplicate_params(self, *, filter: Optional[str] = None, **kwargs: Any) -> As cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -964,7 +964,7 @@ def page_with_max_page_size(self, **kwargs: Any) -> AsyncIterable[JSON]: maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1057,7 +1057,7 @@ def get_odata_multiple_pages( cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1153,7 +1153,7 @@ def get_multiple_pages_with_offset( cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1241,7 +1241,7 @@ def get_multiple_pages_retry_first(self, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1326,7 +1326,7 @@ def get_multiple_pages_retry_second(self, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1410,7 +1410,7 @@ def get_single_pages_failure(self, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1494,7 +1494,7 @@ def get_multiple_pages_failure(self, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1578,7 +1578,7 @@ def get_multiple_pages_failure_uri(self, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1668,7 +1668,7 @@ def get_multiple_pages_fragment_next_link( cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1756,7 +1756,7 @@ def get_multiple_pages_fragment_with_grouping_next_link( # pylint: disable=name cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1817,7 +1817,7 @@ async def get_next(next_link=None): async def _get_multiple_pages_lro_initial( self, *, maxresults: Optional[int] = None, timeout: int = 30, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1895,7 +1895,7 @@ async def begin_get_multiple_pages_lro( cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2019,7 +2019,7 @@ def append_api_version(self, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2105,7 +2105,7 @@ def replace_api_version(self, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2193,7 +2193,7 @@ def get_paging_model_with_item_name_with_xms_client_name( # pylint: disable=nam cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/custompollerpagerversiontolerant/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/custompollerpagerversiontolerant/operations/_operations.py index be8fa89b982..d242f0e9650 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/custompollerpagerversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/custompollerpagerversiontolerant/operations/_operations.py @@ -566,7 +566,7 @@ def get_no_item_name_pages(self, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -650,7 +650,7 @@ def get_empty_next_link_name_pages(self, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -734,7 +734,7 @@ def get_null_next_link_name_pages(self, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -818,7 +818,7 @@ def get_single_pages(self, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -970,7 +970,7 @@ def get_single_pages_with_body_params(self, parameters: Union[JSON, IO[bytes]], content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1065,7 +1065,7 @@ def first_response_empty(self, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1157,7 +1157,7 @@ def get_multiple_pages( cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1248,7 +1248,7 @@ def get_with_query_params(self, *, required_query_parameter: int, **kwargs: Any) query_constant: Literal[True] = kwargs.pop("query_constant", _params.pop("queryConstant", True)) cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1332,7 +1332,7 @@ def duplicate_params(self, *, filter: Optional[str] = None, **kwargs: Any) -> It cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1418,7 +1418,7 @@ def page_with_max_page_size(self, **kwargs: Any) -> Iterable[JSON]: maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1511,7 +1511,7 @@ def get_odata_multiple_pages( cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1607,7 +1607,7 @@ def get_multiple_pages_with_offset( cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1695,7 +1695,7 @@ def get_multiple_pages_retry_first(self, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1780,7 +1780,7 @@ def get_multiple_pages_retry_second(self, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1864,7 +1864,7 @@ def get_single_pages_failure(self, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1948,7 +1948,7 @@ def get_multiple_pages_failure(self, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2032,7 +2032,7 @@ def get_multiple_pages_failure_uri(self, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2120,7 +2120,7 @@ def get_multiple_pages_fragment_next_link(self, tenant: str, *, api_version: str cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2208,7 +2208,7 @@ def get_multiple_pages_fragment_with_grouping_next_link( # pylint: disable=name cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2269,7 +2269,7 @@ def get_next(next_link=None): def _get_multiple_pages_lro_initial( self, *, maxresults: Optional[int] = None, timeout: int = 30, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2346,7 +2346,7 @@ def begin_get_multiple_pages_lro( cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2470,7 +2470,7 @@ def append_api_version(self, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2556,7 +2556,7 @@ def replace_api_version(self, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2644,7 +2644,7 @@ def get_paging_model_with_item_name_with_xms_client_name( # pylint: disable=nam cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/custombaseurlpagingversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/custombaseurlpagingversiontolerant/aio/operations/_operations.py index 17bc33b2505..61291ed02e9 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/custombaseurlpagingversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/custombaseurlpagingversiontolerant/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -81,7 +81,7 @@ def get_pages_partial_url(self, account_name: str, **kwargs: Any) -> AsyncIterab cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -164,7 +164,7 @@ def get_pages_partial_url_operation(self, account_name: str, **kwargs: Any) -> A cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/custombaseurlpagingversiontolerant/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/custombaseurlpagingversiontolerant/operations/_operations.py index c66c6ae9529..6fe756923cc 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/custombaseurlpagingversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/custombaseurlpagingversiontolerant/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -130,7 +130,7 @@ def get_pages_partial_url(self, account_name: str, **kwargs: Any) -> Iterable[JS cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -213,7 +213,7 @@ def get_pages_partial_url_operation(self, account_name: str, **kwargs: Any) -> I cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/HeadExceptionsVersionTolerant/headexceptionsversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/HeadExceptionsVersionTolerant/headexceptionsversiontolerant/aio/operations/_operations.py index e72f2fb00c2..841fb48e48d 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/HeadExceptionsVersionTolerant/headexceptionsversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/HeadExceptionsVersionTolerant/headexceptionsversiontolerant/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -61,7 +61,7 @@ async def head200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -105,7 +105,7 @@ async def head204(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -149,7 +149,7 @@ async def head404(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/HeadExceptionsVersionTolerant/headexceptionsversiontolerant/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/HeadExceptionsVersionTolerant/headexceptionsversiontolerant/operations/_operations.py index c7c6d4f860b..f005a1fee31 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/HeadExceptionsVersionTolerant/headexceptionsversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/HeadExceptionsVersionTolerant/headexceptionsversiontolerant/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -81,7 +81,7 @@ def head200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -125,7 +125,7 @@ def head204(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +169,7 @@ def head404(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/HeadVersionTolerant/headversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/HeadVersionTolerant/headversiontolerant/aio/operations/_operations.py index 292294369cd..db18050b78d 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/HeadVersionTolerant/headversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/HeadVersionTolerant/headversiontolerant/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -61,7 +61,7 @@ async def head200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -105,7 +105,7 @@ async def head204(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -149,7 +149,7 @@ async def head404(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/HeadVersionTolerant/headversiontolerant/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/HeadVersionTolerant/headversiontolerant/operations/_operations.py index 6cc2b767b51..abfcec2a787 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/HeadVersionTolerant/headversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/HeadVersionTolerant/headversiontolerant/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -81,7 +81,7 @@ def head200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -125,7 +125,7 @@ def head204(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +169,7 @@ def head404(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroPagingVersionTolerant/lropagingversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroPagingVersionTolerant/lropagingversiontolerant/aio/operations/_operations.py index ed88685e517..8d43212b2df 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroPagingVersionTolerant/lropagingversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroPagingVersionTolerant/lropagingversiontolerant/aio/operations/_operations.py @@ -188,7 +188,7 @@ def get_qnas( maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -257,7 +257,7 @@ async def get_next(next_link=None): async def _update_qnas_initial( self, project_name: str, body: Union[List[JSON], IO[bytes]], **kwargs: Any ) -> Optional[JSON]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -730,7 +730,7 @@ async def begin_update_qnas( content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroPagingVersionTolerant/lropagingversiontolerant/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroPagingVersionTolerant/lropagingversiontolerant/operations/_operations.py index 26c4767ca14..421e9c38c43 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroPagingVersionTolerant/lropagingversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroPagingVersionTolerant/lropagingversiontolerant/operations/_operations.py @@ -256,7 +256,7 @@ def get_qnas( maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +325,7 @@ def get_next(next_link=None): def _update_qnas_initial( self, project_name: str, body: Union[List[JSON], IO[bytes]], **kwargs: Any ) -> Optional[JSON]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -798,7 +798,7 @@ def begin_update_qnas( content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroVersionTolerant/lroversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroVersionTolerant/lroversiontolerant/aio/operations/_operations.py index 3c9ec1d3274..d2f4b07afdb 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroVersionTolerant/lroversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroVersionTolerant/lroversiontolerant/aio/operations/_operations.py @@ -139,7 +139,7 @@ def __init__(self, *args, **kwargs) -> None: async def _put200_succeeded_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> Optional[JSON]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -390,7 +390,7 @@ def get_long_running_output(pipeline_response): async def _patch200_succeeded_ignore_headers_initial( # pylint: disable=name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -649,7 +649,7 @@ def get_long_running_output(pipeline_response): async def _patch201_retry_with_async_header_initial( # pylint: disable=name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -910,7 +910,7 @@ def get_long_running_output(pipeline_response): async def _patch202_retry_with_async_and_location_header_initial( # pylint: disable=name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1170,7 +1170,7 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller[JSON](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _put201_succeeded_initial(self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1417,7 +1417,7 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller[JSON](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _post202_list_initial(self, **kwargs: Any) -> Optional[List[JSON]]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1543,7 +1543,7 @@ def get_long_running_output(pipeline_response): async def _put200_succeeded_no_state_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1790,7 +1790,7 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller[JSON](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _put202_retry200_initial(self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2042,7 +2042,7 @@ def get_long_running_output(pipeline_response): async def _put201_creating_succeeded200_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2301,7 +2301,7 @@ def get_long_running_output(pipeline_response): async def _put200_updating_succeeded204_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2553,7 +2553,7 @@ def get_long_running_output(pipeline_response): async def _put201_creating_failed200_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2812,7 +2812,7 @@ def get_long_running_output(pipeline_response): async def _put200_acceptedcanceled200_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3064,7 +3064,7 @@ def get_long_running_output(pipeline_response): async def _put_no_header_in_retry_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3319,7 +3319,7 @@ def get_long_running_output(pipeline_response): async def _put_async_retry_succeeded_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3585,7 +3585,7 @@ def get_long_running_output(pipeline_response): async def _put_async_no_retry_succeeded_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3849,7 +3849,7 @@ def get_long_running_output(pipeline_response): async def _put_async_retry_failed_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4115,7 +4115,7 @@ def get_long_running_output(pipeline_response): async def _put_async_no_retrycanceled_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4379,7 +4379,7 @@ def get_long_running_output(pipeline_response): async def _put_async_no_header_in_retry_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4639,7 +4639,7 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller[JSON](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _put_non_resource_initial(self, sku: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4821,7 +4821,7 @@ def get_long_running_output(pipeline_response): async def _put_async_non_resource_initial( self, sku: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5001,7 +5001,7 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller[JSON](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _put_sub_resource_initial(self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5217,7 +5217,7 @@ def get_long_running_output(pipeline_response): async def _put_async_sub_resource_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5433,7 +5433,7 @@ def get_long_running_output(pipeline_response): async def _delete_provisioning202_accepted200_succeeded_initial( # pylint: disable=name-too-long self, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5560,7 +5560,7 @@ def get_long_running_output(pipeline_response): async def _delete_provisioning202_deleting_failed200_initial( # pylint: disable=name-too-long self, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5687,7 +5687,7 @@ def get_long_running_output(pipeline_response): async def _delete_provisioning202_deletingcanceled200_initial( # pylint: disable=name-too-long self, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5814,7 +5814,7 @@ def get_long_running_output(pipeline_response): async def _delete204_succeeded_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5890,7 +5890,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _delete202_retry200_initial(self, **kwargs: Any) -> Optional[JSON]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6008,7 +6008,7 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller[JSON](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _delete202_no_retry204_initial(self, **kwargs: Any) -> Optional[JSON]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6128,7 +6128,7 @@ def get_long_running_output(pipeline_response): async def _delete_no_header_in_retry_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6211,7 +6211,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _delete_async_no_header_in_retry_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6294,7 +6294,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _delete_async_retry_succeeded_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6380,7 +6380,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _delete_async_no_retry_succeeded_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6466,7 +6466,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _delete_async_retry_failed_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6552,7 +6552,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _delete_async_retrycanceled_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6636,7 +6636,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _post200_with_payload_initial(self, **kwargs: Any) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6744,7 +6744,7 @@ def get_long_running_output(pipeline_response): async def _post202_retry200_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6929,7 +6929,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _post202_no_retry204_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7186,7 +7186,7 @@ def get_long_running_output(pipeline_response): async def _post_double_headers_final_location_get_initial( # pylint: disable=name-too-long self, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7304,7 +7304,7 @@ def get_long_running_output(pipeline_response): async def _post_double_headers_final_azure_header_get_initial( # pylint: disable=name-too-long self, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7423,7 +7423,7 @@ def get_long_running_output(pipeline_response): async def _post_double_headers_final_azure_header_get_default_initial( # pylint: disable=name-too-long self, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7539,7 +7539,7 @@ def get_long_running_output(pipeline_response): async def _post_async_retry_succeeded_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> Optional[JSON]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7801,7 +7801,7 @@ def get_long_running_output(pipeline_response): async def _post_async_no_retry_succeeded_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> Optional[JSON]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8063,7 +8063,7 @@ def get_long_running_output(pipeline_response): async def _post_async_retry_failed_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8254,7 +8254,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _post_async_retrycanceled_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8463,7 +8463,7 @@ def __init__(self, *args, **kwargs) -> None: async def _put201_creating_succeeded200_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8722,7 +8722,7 @@ def get_long_running_output(pipeline_response): async def _put_async_relative_retry_succeeded_initial( # pylint: disable=name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8988,7 +8988,7 @@ def get_long_running_output(pipeline_response): async def _delete_provisioning202_accepted200_succeeded_initial( # pylint: disable=name-too-long self, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -9115,7 +9115,7 @@ def get_long_running_output(pipeline_response): async def _delete202_retry200_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -9198,7 +9198,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _delete_async_relative_retry_succeeded_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -9286,7 +9286,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _post202_retry200_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -9471,7 +9471,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _post_async_relative_retry_succeeded_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -9678,7 +9678,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") async def _put_non_retry400_initial(self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -9931,7 +9931,7 @@ def get_long_running_output(pipeline_response): async def _put_non_retry201_creating400_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -10187,7 +10187,7 @@ def get_long_running_output(pipeline_response): async def _put_non_retry201_creating400_invalid_json_initial( # pylint: disable=name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -10443,7 +10443,7 @@ def get_long_running_output(pipeline_response): async def _put_async_relative_retry400_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -10706,7 +10706,7 @@ def get_long_running_output(pipeline_response): async def _delete_non_retry400_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -10788,7 +10788,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _delete202_non_retry400_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -10870,7 +10870,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _delete_async_relative_retry400_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -10956,7 +10956,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _post_non_retry400_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -11138,7 +11138,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _post202_non_retry400_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -11320,7 +11320,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _post_async_relative_retry400_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -11508,7 +11508,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _put_error201_no_provisioning_state_payload_initial( # pylint: disable=name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -11761,7 +11761,7 @@ def get_long_running_output(pipeline_response): async def _put_async_relative_retry_no_status_initial( # pylint: disable=name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -12027,7 +12027,7 @@ def get_long_running_output(pipeline_response): async def _put_async_relative_retry_no_status_payload_initial( # pylint: disable=name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -12293,7 +12293,7 @@ def get_long_running_output(pipeline_response): async def _delete204_succeeded_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -12371,7 +12371,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _delete_async_relative_retry_no_status_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -12459,7 +12459,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _post202_no_location_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -12644,7 +12644,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _post_async_relative_retry_no_payload_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -12835,7 +12835,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _put200_invalid_json_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> Optional[JSON]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -13086,7 +13086,7 @@ def get_long_running_output(pipeline_response): async def _put_async_relative_retry_invalid_header_initial( # pylint: disable=name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -13352,7 +13352,7 @@ def get_long_running_output(pipeline_response): async def _put_async_relative_retry_invalid_json_polling_initial( # pylint: disable=name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -13618,7 +13618,7 @@ def get_long_running_output(pipeline_response): async def _delete202_retry_invalid_header_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -13701,7 +13701,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _delete_async_relative_retry_invalid_header_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -13789,7 +13789,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _delete_async_relative_retry_invalid_json_polling_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -13877,7 +13877,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _post202_retry_invalid_header_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -14062,7 +14062,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _post_async_relative_retry_invalid_header_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -14253,7 +14253,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _post_async_relative_retry_invalid_json_polling_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -14462,7 +14462,7 @@ def __init__(self, *args, **kwargs) -> None: async def _put_async_retry_succeeded_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -14731,7 +14731,7 @@ def get_long_running_output(pipeline_response): async def _put201_creating_succeeded200_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -14993,7 +14993,7 @@ def get_long_running_output(pipeline_response): async def _post202_retry200_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -15181,7 +15181,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _post_async_retry_succeeded_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroVersionTolerant/lroversiontolerant/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroVersionTolerant/lroversiontolerant/operations/_operations.py index fb74dd2a254..d20f95ee849 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroVersionTolerant/lroversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroVersionTolerant/lroversiontolerant/operations/_operations.py @@ -1407,7 +1407,7 @@ def __init__(self, *args, **kwargs): def _put200_succeeded_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> Optional[JSON]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1658,7 +1658,7 @@ def get_long_running_output(pipeline_response): def _patch200_succeeded_ignore_headers_initial( # pylint: disable=name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1917,7 +1917,7 @@ def get_long_running_output(pipeline_response): def _patch201_retry_with_async_header_initial( # pylint: disable=name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2177,7 +2177,7 @@ def get_long_running_output(pipeline_response): def _patch202_retry_with_async_and_location_header_initial( # pylint: disable=name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2437,7 +2437,7 @@ def get_long_running_output(pipeline_response): return LROPoller[JSON](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _put201_succeeded_initial(self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2684,7 +2684,7 @@ def get_long_running_output(pipeline_response): return LROPoller[JSON](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _post202_list_initial(self, **kwargs: Any) -> Optional[List[JSON]]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2806,7 +2806,7 @@ def get_long_running_output(pipeline_response): def _put200_succeeded_no_state_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3053,7 +3053,7 @@ def get_long_running_output(pipeline_response): return LROPoller[JSON](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _put202_retry200_initial(self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3303,7 +3303,7 @@ def get_long_running_output(pipeline_response): def _put201_creating_succeeded200_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3562,7 +3562,7 @@ def get_long_running_output(pipeline_response): def _put200_updating_succeeded204_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3814,7 +3814,7 @@ def get_long_running_output(pipeline_response): def _put201_creating_failed200_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4073,7 +4073,7 @@ def get_long_running_output(pipeline_response): def _put200_acceptedcanceled200_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4323,7 +4323,7 @@ def get_long_running_output(pipeline_response): return LROPoller[JSON](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _put_no_header_in_retry_initial(self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4578,7 +4578,7 @@ def get_long_running_output(pipeline_response): def _put_async_retry_succeeded_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4844,7 +4844,7 @@ def get_long_running_output(pipeline_response): def _put_async_no_retry_succeeded_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5106,7 +5106,7 @@ def get_long_running_output(pipeline_response): return LROPoller[JSON](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _put_async_retry_failed_initial(self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5372,7 +5372,7 @@ def get_long_running_output(pipeline_response): def _put_async_no_retrycanceled_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5636,7 +5636,7 @@ def get_long_running_output(pipeline_response): def _put_async_no_header_in_retry_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5896,7 +5896,7 @@ def get_long_running_output(pipeline_response): return LROPoller[JSON](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _put_non_resource_initial(self, sku: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6074,7 +6074,7 @@ def get_long_running_output(pipeline_response): return LROPoller[JSON](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _put_async_non_resource_initial(self, sku: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6254,7 +6254,7 @@ def get_long_running_output(pipeline_response): return LROPoller[JSON](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _put_sub_resource_initial(self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6468,7 +6468,7 @@ def get_long_running_output(pipeline_response): return LROPoller[JSON](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _put_async_sub_resource_initial(self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6684,7 +6684,7 @@ def get_long_running_output(pipeline_response): def _delete_provisioning202_accepted200_succeeded_initial( # pylint: disable=name-too-long self, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6811,7 +6811,7 @@ def get_long_running_output(pipeline_response): def _delete_provisioning202_deleting_failed200_initial( # pylint: disable=name-too-long self, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6938,7 +6938,7 @@ def get_long_running_output(pipeline_response): def _delete_provisioning202_deletingcanceled200_initial( # pylint: disable=name-too-long self, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7063,7 +7063,7 @@ def get_long_running_output(pipeline_response): return LROPoller[JSON](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _delete204_succeeded_initial(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7139,7 +7139,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _delete202_retry200_initial(self, **kwargs: Any) -> Optional[JSON]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7257,7 +7257,7 @@ def get_long_running_output(pipeline_response): return LROPoller[JSON](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _delete202_no_retry204_initial(self, **kwargs: Any) -> Optional[JSON]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7377,7 +7377,7 @@ def get_long_running_output(pipeline_response): def _delete_no_header_in_retry_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7460,7 +7460,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _delete_async_no_header_in_retry_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7543,7 +7543,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _delete_async_retry_succeeded_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7629,7 +7629,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _delete_async_no_retry_succeeded_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7715,7 +7715,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _delete_async_retry_failed_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7801,7 +7801,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _delete_async_retrycanceled_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7885,7 +7885,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _post200_with_payload_initial(self, **kwargs: Any) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7993,7 +7993,7 @@ def get_long_running_output(pipeline_response): def _post202_retry200_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8176,7 +8176,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _post202_no_retry204_initial(self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8431,7 +8431,7 @@ def get_long_running_output(pipeline_response): return LROPoller[JSON](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _post_double_headers_final_location_get_initial(self, **kwargs: Any) -> JSON: # pylint: disable=name-too-long - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8549,7 +8549,7 @@ def get_long_running_output(pipeline_response): def _post_double_headers_final_azure_header_get_initial( # pylint: disable=name-too-long self, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8667,7 +8667,7 @@ def get_long_running_output(pipeline_response): def _post_double_headers_final_azure_header_get_default_initial( # pylint: disable=name-too-long self, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8783,7 +8783,7 @@ def get_long_running_output(pipeline_response): def _post_async_retry_succeeded_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> Optional[JSON]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -9045,7 +9045,7 @@ def get_long_running_output(pipeline_response): def _post_async_no_retry_succeeded_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> Optional[JSON]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -9307,7 +9307,7 @@ def get_long_running_output(pipeline_response): def _post_async_retry_failed_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -9498,7 +9498,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _post_async_retrycanceled_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -9707,7 +9707,7 @@ def __init__(self, *args, **kwargs): def _put201_creating_succeeded200_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -9966,7 +9966,7 @@ def get_long_running_output(pipeline_response): def _put_async_relative_retry_succeeded_initial( # pylint: disable=name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -10232,7 +10232,7 @@ def get_long_running_output(pipeline_response): def _delete_provisioning202_accepted200_succeeded_initial( # pylint: disable=name-too-long self, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -10357,7 +10357,7 @@ def get_long_running_output(pipeline_response): return LROPoller[JSON](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _delete202_retry200_initial(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -10440,7 +10440,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _delete_async_relative_retry_succeeded_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -10528,7 +10528,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _post202_retry200_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -10713,7 +10713,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _post_async_relative_retry_succeeded_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -10920,7 +10920,7 @@ def __init__(self, *args, **kwargs): self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") def _put_non_retry400_initial(self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -11173,7 +11173,7 @@ def get_long_running_output(pipeline_response): def _put_non_retry201_creating400_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -11429,7 +11429,7 @@ def get_long_running_output(pipeline_response): def _put_non_retry201_creating400_invalid_json_initial( # pylint: disable=name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -11685,7 +11685,7 @@ def get_long_running_output(pipeline_response): def _put_async_relative_retry400_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -11946,7 +11946,7 @@ def get_long_running_output(pipeline_response): return LROPoller[JSON](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _delete_non_retry400_initial(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -12026,7 +12026,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _delete202_non_retry400_initial(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -12108,7 +12108,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _delete_async_relative_retry400_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -12194,7 +12194,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _post_non_retry400_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -12376,7 +12376,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _post202_non_retry400_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -12558,7 +12558,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _post_async_relative_retry400_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -12746,7 +12746,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _put_error201_no_provisioning_state_payload_initial( # pylint: disable=name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -12999,7 +12999,7 @@ def get_long_running_output(pipeline_response): def _put_async_relative_retry_no_status_initial( # pylint: disable=name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -13265,7 +13265,7 @@ def get_long_running_output(pipeline_response): def _put_async_relative_retry_no_status_payload_initial( # pylint: disable=name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -13529,7 +13529,7 @@ def get_long_running_output(pipeline_response): return LROPoller[JSON](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _delete204_succeeded_initial(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -13607,7 +13607,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _delete_async_relative_retry_no_status_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -13695,7 +13695,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _post202_no_location_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -13880,7 +13880,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _post_async_relative_retry_no_payload_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -14071,7 +14071,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _put200_invalid_json_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> Optional[JSON]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -14322,7 +14322,7 @@ def get_long_running_output(pipeline_response): def _put_async_relative_retry_invalid_header_initial( # pylint: disable=name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -14588,7 +14588,7 @@ def get_long_running_output(pipeline_response): def _put_async_relative_retry_invalid_json_polling_initial( # pylint: disable=name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -14854,7 +14854,7 @@ def get_long_running_output(pipeline_response): def _delete202_retry_invalid_header_initial( # pylint: disable=inconsistent-return-statements self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -14937,7 +14937,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _delete_async_relative_retry_invalid_header_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -15025,7 +15025,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _delete_async_relative_retry_invalid_json_polling_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -15113,7 +15113,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _post202_retry_invalid_header_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -15298,7 +15298,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _post_async_relative_retry_invalid_header_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -15489,7 +15489,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _post_async_relative_retry_invalid_json_polling_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -15698,7 +15698,7 @@ def __init__(self, *args, **kwargs): def _put_async_retry_succeeded_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -15967,7 +15967,7 @@ def get_long_running_output(pipeline_response): def _put201_creating_succeeded200_initial( self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -16229,7 +16229,7 @@ def get_long_running_output(pipeline_response): def _post202_retry200_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -16417,7 +16417,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _post_async_retry_succeeded_initial( # pylint: disable=inconsistent-return-statements self, product: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroWithParameterizedEndpointsVersionTolerant/lrowithparameterizedendpointsversiontolerant/_operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroWithParameterizedEndpointsVersionTolerant/lrowithparameterizedendpointsversiontolerant/_operations/_operations.py index 5915ad48f0f..7848d660fd3 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroWithParameterizedEndpointsVersionTolerant/lrowithparameterizedendpointsversiontolerant/_operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroWithParameterizedEndpointsVersionTolerant/lrowithparameterizedendpointsversiontolerant/_operations/_operations.py @@ -82,7 +82,7 @@ class LROWithParamaterizedEndpointsOperationsMixin( # pylint: disable=name-too- def _poll_with_parameterized_endpoints_initial( # pylint: disable=name-too-long self, account_name: str, **kwargs: Any ) -> Optional[str]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -198,7 +198,7 @@ def get_long_running_output(pipeline_response): def _poll_with_constant_parameterized_endpoints_initial( # pylint: disable=name-too-long self, account_name: str, **kwargs: Any ) -> Optional[str]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroWithParameterizedEndpointsVersionTolerant/lrowithparameterizedendpointsversiontolerant/aio/_operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroWithParameterizedEndpointsVersionTolerant/lrowithparameterizedendpointsversiontolerant/aio/_operations/_operations.py index 2410d645c54..ef75951129c 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroWithParameterizedEndpointsVersionTolerant/lrowithparameterizedendpointsversiontolerant/aio/_operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroWithParameterizedEndpointsVersionTolerant/lrowithparameterizedendpointsversiontolerant/aio/_operations/_operations.py @@ -43,7 +43,7 @@ class LROWithParamaterizedEndpointsOperationsMixin( # pylint: disable=name-too- async def _poll_with_parameterized_endpoints_initial( # pylint: disable=name-too-long self, account_name: str, **kwargs: Any ) -> Optional[str]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -159,7 +159,7 @@ def get_long_running_output(pipeline_response): async def _poll_with_constant_parameterized_endpoints_initial( # pylint: disable=name-too-long self, account_name: str, **kwargs: Any ) -> Optional[str]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/pagingversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/pagingversiontolerant/aio/operations/_operations.py index 6315722dcc6..945cdc6cf10 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/pagingversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/pagingversiontolerant/aio/operations/_operations.py @@ -107,7 +107,7 @@ def get_no_item_name_pages(self, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -191,7 +191,7 @@ def get_empty_next_link_name_pages(self, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -275,7 +275,7 @@ def get_null_next_link_name_pages(self, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -359,7 +359,7 @@ def get_single_pages(self, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -513,7 +513,7 @@ def get_single_pages_with_body_params( content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -608,7 +608,7 @@ def first_response_empty(self, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -700,7 +700,7 @@ def get_multiple_pages( cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -791,7 +791,7 @@ def get_with_query_params(self, *, required_query_parameter: int, **kwargs: Any) query_constant: Literal[True] = kwargs.pop("query_constant", _params.pop("queryConstant", True)) cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -875,7 +875,7 @@ def duplicate_params(self, *, filter: Optional[str] = None, **kwargs: Any) -> As cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -961,7 +961,7 @@ def page_with_max_page_size(self, **kwargs: Any) -> AsyncIterable[JSON]: maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1054,7 +1054,7 @@ def get_odata_multiple_pages( cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1150,7 +1150,7 @@ def get_multiple_pages_with_offset( cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1238,7 +1238,7 @@ def get_multiple_pages_retry_first(self, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1323,7 +1323,7 @@ def get_multiple_pages_retry_second(self, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1407,7 +1407,7 @@ def get_single_pages_failure(self, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1491,7 +1491,7 @@ def get_multiple_pages_failure(self, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1575,7 +1575,7 @@ def get_multiple_pages_failure_uri(self, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1665,7 +1665,7 @@ def get_multiple_pages_fragment_next_link( cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1753,7 +1753,7 @@ def get_multiple_pages_fragment_with_grouping_next_link( # pylint: disable=name cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1814,7 +1814,7 @@ async def get_next(next_link=None): async def _get_multiple_pages_lro_initial( self, *, maxresults: Optional[int] = None, timeout: int = 30, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1891,7 +1891,7 @@ async def begin_get_multiple_pages_lro( cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2015,7 +2015,7 @@ def append_api_version(self, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2101,7 +2101,7 @@ def replace_api_version(self, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2189,7 +2189,7 @@ def get_paging_model_with_item_name_with_xms_client_name( # pylint: disable=nam cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/pagingversiontolerant/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/pagingversiontolerant/operations/_operations.py index ddf399701c4..3ab46eafcb1 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/pagingversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/pagingversiontolerant/operations/_operations.py @@ -563,7 +563,7 @@ def get_no_item_name_pages(self, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -647,7 +647,7 @@ def get_empty_next_link_name_pages(self, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -731,7 +731,7 @@ def get_null_next_link_name_pages(self, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -815,7 +815,7 @@ def get_single_pages(self, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -967,7 +967,7 @@ def get_single_pages_with_body_params(self, parameters: Union[JSON, IO[bytes]], content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1062,7 +1062,7 @@ def first_response_empty(self, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1154,7 +1154,7 @@ def get_multiple_pages( cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1245,7 +1245,7 @@ def get_with_query_params(self, *, required_query_parameter: int, **kwargs: Any) query_constant: Literal[True] = kwargs.pop("query_constant", _params.pop("queryConstant", True)) cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1329,7 +1329,7 @@ def duplicate_params(self, *, filter: Optional[str] = None, **kwargs: Any) -> It cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1415,7 +1415,7 @@ def page_with_max_page_size(self, **kwargs: Any) -> Iterable[JSON]: maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1508,7 +1508,7 @@ def get_odata_multiple_pages( cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1604,7 +1604,7 @@ def get_multiple_pages_with_offset( cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1692,7 +1692,7 @@ def get_multiple_pages_retry_first(self, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1777,7 +1777,7 @@ def get_multiple_pages_retry_second(self, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1861,7 +1861,7 @@ def get_single_pages_failure(self, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1945,7 +1945,7 @@ def get_multiple_pages_failure(self, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2029,7 +2029,7 @@ def get_multiple_pages_failure_uri(self, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2117,7 +2117,7 @@ def get_multiple_pages_fragment_next_link(self, tenant: str, *, api_version: str cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2205,7 +2205,7 @@ def get_multiple_pages_fragment_with_grouping_next_link( # pylint: disable=name cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2266,7 +2266,7 @@ def get_next(next_link=None): def _get_multiple_pages_lro_initial( self, *, maxresults: Optional[int] = None, timeout: int = 30, **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2343,7 +2343,7 @@ def begin_get_multiple_pages_lro( cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2467,7 +2467,7 @@ def append_api_version(self, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2553,7 +2553,7 @@ def replace_api_version(self, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2641,7 +2641,7 @@ def get_paging_model_with_item_name_with_xms_client_name( # pylint: disable=nam cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/storageversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/storageversiontolerant/aio/operations/_operations.py index b1e84570072..57cb324cfa4 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/storageversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/storageversiontolerant/aio/operations/_operations.py @@ -178,7 +178,7 @@ async def check_name_availability(self, account_name: Union[JSON, IO[bytes]], ** Known values are: "AccountNameInvalid" and "AlreadyExists". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -237,7 +237,7 @@ async def check_name_availability(self, account_name: Union[JSON, IO[bytes]], ** async def _create_initial( self, resource_group_name: str, account_name: str, parameters: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -692,7 +692,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -819,7 +819,7 @@ async def get_properties(self, resource_group_name: str, account_name: str, **kw "type": "str" # Optional. Resource type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1226,7 +1226,7 @@ async def update( "type": "str" # Optional. Resource type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1306,7 +1306,7 @@ async def list_keys(self, resource_group_name: str, account_name: str, **kwargs: "key2": "str" # Optional. Gets the value of key 2. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1437,7 +1437,7 @@ def list(self, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1587,7 +1587,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1765,7 +1765,7 @@ async def regenerate_key( "key2": "str" # Optional. Gets the value of key 2. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1874,7 +1874,7 @@ async def list(self, **kwargs: Any) -> JSON: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/storageversiontolerant/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/storageversiontolerant/operations/_operations.py index 11f9bb49c75..7982595c94b 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/storageversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/storageversiontolerant/operations/_operations.py @@ -446,7 +446,7 @@ def check_name_availability(self, account_name: Union[JSON, IO[bytes]], **kwargs Known values are: "AccountNameInvalid" and "AlreadyExists". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +505,7 @@ def check_name_availability(self, account_name: Union[JSON, IO[bytes]], **kwargs def _create_initial( self, resource_group_name: str, account_name: str, parameters: Union[JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -960,7 +960,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1087,7 +1087,7 @@ def get_properties(self, resource_group_name: str, account_name: str, **kwargs: "type": "str" # Optional. Resource type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1494,7 +1494,7 @@ def update( "type": "str" # Optional. Resource type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1574,7 +1574,7 @@ def list_keys(self, resource_group_name: str, account_name: str, **kwargs: Any) "key2": "str" # Optional. Gets the value of key 2. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1705,7 +1705,7 @@ def list(self, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1855,7 +1855,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2033,7 +2033,7 @@ def regenerate_key( "key2": "str" # Optional. Gets the value of key 2. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2142,7 +2142,7 @@ def list(self, **kwargs: Any) -> JSON: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/SubscriptionIdApiVersionVersionTolerant/subscriptionidapiversionversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/SubscriptionIdApiVersionVersionTolerant/subscriptionidapiversionversiontolerant/aio/operations/_operations.py index accd245063f..15a6832df58 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/SubscriptionIdApiVersionVersionTolerant/subscriptionidapiversionversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/SubscriptionIdApiVersionVersionTolerant/subscriptionidapiversionversiontolerant/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -69,7 +69,7 @@ async def get_sample_resource_group(self, resource_group_name: str, **kwargs: An "name": "str" # Optional. resource group name 'testgroup101'. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/SubscriptionIdApiVersionVersionTolerant/subscriptionidapiversionversiontolerant/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/SubscriptionIdApiVersionVersionTolerant/subscriptionidapiversionversiontolerant/operations/_operations.py index fd694f035a9..1601dc98897 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/SubscriptionIdApiVersionVersionTolerant/subscriptionidapiversionversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/SubscriptionIdApiVersionVersionTolerant/subscriptionidapiversionversiontolerant/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -100,7 +100,7 @@ def get_sample_resource_group(self, resource_group_name: str, **kwargs: Any) -> "name": "str" # Optional. resource group name 'testgroup101'. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/dpgcustomizationcustomizedversiontolerant/_operations/_operations.py b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/dpgcustomizationcustomizedversiontolerant/_operations/_operations.py index 5fbcd1575ee..42f08fad709 100644 --- a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/dpgcustomizationcustomizedversiontolerant/_operations/_operations.py +++ b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/dpgcustomizationcustomizedversiontolerant/_operations/_operations.py @@ -142,7 +142,7 @@ def get_model(self, mode: str, **kwargs: Any) -> JSON: "received": "str" # Required. Known values are: "raw" and "model". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -273,7 +273,7 @@ def post_model(self, mode: str, input: Union[JSON, IO[bytes]], **kwargs: Any) -> "received": "str" # Required. Known values are: "raw" and "model". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -354,7 +354,7 @@ def get_pages(self, mode: str, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -405,7 +405,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) def _lro_initial(self, mode: str, **kwargs: Any) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/dpgcustomizationcustomizedversiontolerant/aio/_operations/_operations.py b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/dpgcustomizationcustomizedversiontolerant/aio/_operations/_operations.py index 13a900df0d4..fd7f4128b30 100644 --- a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/dpgcustomizationcustomizedversiontolerant/aio/_operations/_operations.py +++ b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/dpgcustomizationcustomizedversiontolerant/aio/_operations/_operations.py @@ -66,7 +66,7 @@ async def get_model(self, mode: str, **kwargs: Any) -> JSON: "received": "str" # Required. Known values are: "raw" and "model". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -201,7 +201,7 @@ async def post_model(self, mode: str, input: Union[JSON, IO[bytes]], **kwargs: A "received": "str" # Required. Known values are: "raw" and "model". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +282,7 @@ def get_pages(self, mode: str, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +333,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) async def _lro_initial(self, mode: str, **kwargs: Any) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/dpgcustomizationinitialversiontolerant/_operations/_operations.py b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/dpgcustomizationinitialversiontolerant/_operations/_operations.py index 5fbcd1575ee..42f08fad709 100644 --- a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/dpgcustomizationinitialversiontolerant/_operations/_operations.py +++ b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/dpgcustomizationinitialversiontolerant/_operations/_operations.py @@ -142,7 +142,7 @@ def get_model(self, mode: str, **kwargs: Any) -> JSON: "received": "str" # Required. Known values are: "raw" and "model". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -273,7 +273,7 @@ def post_model(self, mode: str, input: Union[JSON, IO[bytes]], **kwargs: Any) -> "received": "str" # Required. Known values are: "raw" and "model". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -354,7 +354,7 @@ def get_pages(self, mode: str, **kwargs: Any) -> Iterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -405,7 +405,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) def _lro_initial(self, mode: str, **kwargs: Any) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/dpgcustomizationinitialversiontolerant/aio/_operations/_operations.py b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/dpgcustomizationinitialversiontolerant/aio/_operations/_operations.py index 13a900df0d4..fd7f4128b30 100644 --- a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/dpgcustomizationinitialversiontolerant/aio/_operations/_operations.py +++ b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/dpgcustomizationinitialversiontolerant/aio/_operations/_operations.py @@ -66,7 +66,7 @@ async def get_model(self, mode: str, **kwargs: Any) -> JSON: "received": "str" # Required. Known values are: "raw" and "model". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -201,7 +201,7 @@ async def post_model(self, mode: str, input: Union[JSON, IO[bytes]], **kwargs: A "received": "str" # Required. Known values are: "raw" and "model". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +282,7 @@ def get_pages(self, mode: str, **kwargs: Any) -> AsyncIterable[JSON]: cls: ClsType[JSON] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +333,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) async def _lro_initial(self, mode: str, **kwargs: Any) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenInitialVersionTolerant/dpgservicedriveninitialversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenInitialVersionTolerant/dpgservicedriveninitialversiontolerant/aio/operations/_operations.py index 39d9dc9b78a..b988923a804 100644 --- a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenInitialVersionTolerant/dpgservicedriveninitialversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenInitialVersionTolerant/dpgservicedriveninitialversiontolerant/aio/operations/_operations.py @@ -66,7 +66,7 @@ async def head_no_params(self, **kwargs: Any) -> JSON: :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -120,7 +120,7 @@ async def get_required(self, *, parameter: str, **kwargs: Any) -> JSON: :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -178,7 +178,7 @@ async def put_required_optional( :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -281,7 +281,7 @@ async def post_parameters(self, parameter: Union[JSON, IO[bytes]], **kwargs: Any "url": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -347,7 +347,7 @@ async def get_optional(self, *, optional_param: Optional[str] = None, **kwargs: :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenInitialVersionTolerant/dpgservicedriveninitialversiontolerant/operations/_operations.py b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenInitialVersionTolerant/dpgservicedriveninitialversiontolerant/operations/_operations.py index a2acbadc0b6..20f7728247b 100644 --- a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenInitialVersionTolerant/dpgservicedriveninitialversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenInitialVersionTolerant/dpgservicedriveninitialversiontolerant/operations/_operations.py @@ -153,7 +153,7 @@ def head_no_params(self, **kwargs: Any) -> JSON: :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -207,7 +207,7 @@ def get_required(self, *, parameter: str, **kwargs: Any) -> JSON: :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -265,7 +265,7 @@ def put_required_optional( :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -366,7 +366,7 @@ def post_parameters(self, parameter: Union[JSON, IO[bytes]], **kwargs: Any) -> J "url": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -432,7 +432,7 @@ def get_optional(self, *, optional_param: Optional[str] = None, **kwargs: Any) - :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenUpdateOneVersionTolerant/dpgservicedrivenupdateoneversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenUpdateOneVersionTolerant/dpgservicedrivenupdateoneversiontolerant/aio/operations/_operations.py index f7bc2fa3526..90c1d055741 100644 --- a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenUpdateOneVersionTolerant/dpgservicedrivenupdateoneversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenUpdateOneVersionTolerant/dpgservicedrivenupdateoneversiontolerant/aio/operations/_operations.py @@ -70,7 +70,7 @@ async def head_no_params(self, *, new_parameter: Optional[str] = None, **kwargs: :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -127,7 +127,7 @@ async def get_required(self, *, parameter: str, new_parameter: Optional[str] = N :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -193,7 +193,7 @@ async def put_required_optional( :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -295,7 +295,7 @@ async def post_parameters(self, parameter: Union[JSON, IO[bytes]], **kwargs: Any "url": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -364,7 +364,7 @@ async def delete_parameters(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -415,7 +415,7 @@ async def get_optional( :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -469,7 +469,7 @@ async def get_new_operation(self, **kwargs: Any) -> JSON: :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenUpdateOneVersionTolerant/dpgservicedrivenupdateoneversiontolerant/operations/_operations.py b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenUpdateOneVersionTolerant/dpgservicedrivenupdateoneversiontolerant/operations/_operations.py index 4c0b7d5ade7..a791adae36e 100644 --- a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenUpdateOneVersionTolerant/dpgservicedrivenupdateoneversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGServiceDrivenUpdateOneVersionTolerant/dpgservicedrivenupdateoneversiontolerant/operations/_operations.py @@ -191,7 +191,7 @@ def head_no_params(self, *, new_parameter: Optional[str] = None, **kwargs: Any) :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -248,7 +248,7 @@ def get_required(self, *, parameter: str, new_parameter: Optional[str] = None, * :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -314,7 +314,7 @@ def put_required_optional( :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -416,7 +416,7 @@ def post_parameters(self, parameter: Union[JSON, IO[bytes]], **kwargs: Any) -> J "url": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -485,7 +485,7 @@ def delete_parameters(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -536,7 +536,7 @@ def get_optional( :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -590,7 +590,7 @@ def get_new_operation(self, **kwargs: Any) -> JSON: :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/dpgtestmodelsversiontolerant/_operations/_operations.py b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/dpgtestmodelsversiontolerant/_operations/_operations.py index 677ed3e7b4b..a2b20ae5241 100644 --- a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/dpgtestmodelsversiontolerant/_operations/_operations.py +++ b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/dpgtestmodelsversiontolerant/_operations/_operations.py @@ -134,7 +134,7 @@ def get_model(self, mode: str, **kwargs: Any) -> _models.Product: :rtype: ~dpgtestmodelsversiontolerant.models.Product :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -232,7 +232,7 @@ def post_model(self, mode: str, input: Union[_models.Input, IO[bytes]], **kwargs :rtype: ~dpgtestmodelsversiontolerant.models.Product :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -302,7 +302,7 @@ def get_pages(self, mode: str, **kwargs: Any) -> Iterable["_models.Product"]: cls: ClsType[_models._models.ProductResult] = kwargs.pop("cls", None) # pylint: disable=protected-access - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -355,7 +355,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) def _lro_initial(self, mode: str, **kwargs: Any) -> _models.LROProduct: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/dpgtestmodelsversiontolerant/aio/_operations/_operations.py b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/dpgtestmodelsversiontolerant/aio/_operations/_operations.py index 4cb94a05c23..2b441eb7bf0 100644 --- a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/dpgtestmodelsversiontolerant/aio/_operations/_operations.py +++ b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/dpgtestmodelsversiontolerant/aio/_operations/_operations.py @@ -58,7 +58,7 @@ async def get_model(self, mode: str, **kwargs: Any) -> _models.Product: :rtype: ~dpgtestmodelsversiontolerant.models.Product :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -156,7 +156,7 @@ async def post_model(self, mode: str, input: Union[_models.Input, IO[bytes]], ** :rtype: ~dpgtestmodelsversiontolerant.models.Product :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -226,7 +226,7 @@ def get_pages(self, mode: str, **kwargs: Any) -> AsyncIterable["_models.Product" cls: ClsType[_models._models.ProductResult] = kwargs.pop("cls", None) # pylint: disable=protected-access - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -279,7 +279,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) async def _lro_initial(self, mode: str, **kwargs: Any) -> _models.LROProduct: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v0/aio/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v0/aio/operations/_operation_group_one_operations.py index 5bc31690d4d..68f75f377af 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v0/aio/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v0/aio/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -64,7 +64,7 @@ async def test_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v0/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v0/operations/_operation_group_one_operations.py index d68184a3893..f0f9d2e6f55 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v0/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v0/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -86,7 +86,7 @@ def test_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations/_multiapi_service_client_operations.py index 1072d2c37f2..5c778bc6995 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations/_multiapi_service_client_operations.py @@ -69,7 +69,7 @@ async def test_one( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -113,7 +113,7 @@ async def test_one( # pylint: disable=inconsistent-return-statements async def _test_lro_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -265,7 +265,7 @@ async def _test_lro_and_paging_initial( test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any ) -> _models.PagingResult: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -337,7 +337,7 @@ async def begin_test_lro_and_paging( cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -454,7 +454,7 @@ async def test_different_calls( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations/_operation_group_one_operations.py index d091d89086f..f2c58387216 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -65,7 +65,7 @@ async def test_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_multiapi_service_client_operations.py index 52fdeab10df..49f35a2a7a1 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_multiapi_service_client_operations.py @@ -146,7 +146,7 @@ def test_one( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -190,7 +190,7 @@ def test_one( # pylint: disable=inconsistent-return-statements def _test_lro_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -339,7 +339,7 @@ def _test_lro_and_paging_initial( test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any ) -> _models.PagingResult: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -411,7 +411,7 @@ def begin_test_lro_and_paging( cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -528,7 +528,7 @@ def test_different_calls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_operation_group_one_operations.py index 9e4c7aa9d09..732dbbc947f 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -86,7 +86,7 @@ def test_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/aio/operations/_multiapi_service_client_operations.py index 7e9a2481aab..323482d60df 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/aio/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -56,7 +56,7 @@ async def test_one(self, id: int, message: Optional[str] = None, **kwargs: Any) :rtype: ~multiapi.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -115,7 +115,7 @@ async def test_different_calls( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/aio/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/aio/operations/_operation_group_one_operations.py index d52dad91367..1eb42adfc1a 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/aio/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/aio/operations/_operation_group_one_operations.py @@ -103,7 +103,7 @@ async def test_two( :rtype: ~multiapi.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -167,7 +167,7 @@ async def test_three(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/aio/operations/_operation_group_two_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/aio/operations/_operation_group_two_operations.py index b56ceb3f3d8..0345d498125 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/aio/operations/_operation_group_two_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/aio/operations/_operation_group_two_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -69,7 +69,7 @@ async def test_four( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/operations/_multiapi_service_client_operations.py index 7c0d921e97f..cb651a732b3 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -104,7 +104,7 @@ def test_one(self, id: int, message: Optional[str] = None, **kwargs: Any) -> _mo :rtype: ~multiapi.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -163,7 +163,7 @@ def test_different_calls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/operations/_operation_group_one_operations.py index 07f77dc295a..93a59412103 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/operations/_operation_group_one_operations.py @@ -146,7 +146,7 @@ def test_two( :rtype: ~multiapi.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -210,7 +210,7 @@ def test_three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/operations/_operation_group_two_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/operations/_operation_group_two_operations.py index 2a5ccbd4a31..6ea9f0dc9dc 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/operations/_operation_group_two_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/operations/_operation_group_two_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -89,7 +89,7 @@ def test_four(self, parameter_one: bool, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_multiapi_service_client_operations.py index 49ffba0daf7..e64e0a467b0 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar, Union import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -63,7 +63,7 @@ def test_paging(self, **kwargs: Any) -> AsyncIterable["_models.ModelThree"]: cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +143,7 @@ async def test_different_calls( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_operation_group_one_operations.py index f9c7cfd3931..d569ae93e7b 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_operation_group_one_operations.py @@ -77,7 +77,7 @@ def test_operation_group_paging(self, **kwargs: Any) -> AsyncIterable["_models.M cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -186,7 +186,7 @@ async def test_two( :rtype: ~multiapi.v3.models.ModelThree :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_operation_group_two_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_operation_group_two_operations.py index 4ed262f8a20..d13f7b2c0e8 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_operation_group_two_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_operation_group_two_operations.py @@ -104,7 +104,7 @@ async def test_four( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -164,7 +164,7 @@ async def test_five(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_multiapi_service_client_operations.py index c0606063c12..ffef5cb6215 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar, Union import urllib.parse from azure.core.exceptions import ( @@ -105,7 +105,7 @@ def test_paging(self, **kwargs: Any) -> Iterable["_models.ModelThree"]: cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -185,7 +185,7 @@ def test_different_calls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_operation_group_one_operations.py index 72a3e8e6ca8..7844c4d11f4 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_operation_group_one_operations.py @@ -111,7 +111,7 @@ def test_operation_group_paging(self, **kwargs: Any) -> Iterable["_models.ModelT cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +220,7 @@ def test_two( :rtype: ~multiapi.v3.models.ModelThree :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_operation_group_two_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_operation_group_two_operations.py index db36404219b..abd6b18033d 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_operation_group_two_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_operation_group_two_operations.py @@ -147,7 +147,7 @@ def test_four( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -207,7 +207,7 @@ def test_five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/aio/operations/_multiapi_service_client_operations.py index 1c5045af84a..9bfc57884e1 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/aio/operations/_multiapi_service_client_operations.py @@ -69,7 +69,7 @@ async def test_one( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -113,7 +113,7 @@ async def test_one( # pylint: disable=inconsistent-return-statements async def _test_lro_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -265,7 +265,7 @@ async def _test_lro_and_paging_initial( test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any ) -> _models.PagingResult: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -338,7 +338,7 @@ async def begin_test_lro_and_paging( cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -455,7 +455,7 @@ async def test_different_calls( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/aio/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/aio/operations/_operation_group_one_operations.py index 2c7b51cbd16..c5490add4a5 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/aio/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/aio/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -65,7 +65,7 @@ async def test_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/operations/_multiapi_service_client_operations.py index 453d1e9a701..fecf14df680 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/operations/_multiapi_service_client_operations.py @@ -146,7 +146,7 @@ def test_one( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -190,7 +190,7 @@ def test_one( # pylint: disable=inconsistent-return-statements def _test_lro_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -339,7 +339,7 @@ def _test_lro_and_paging_initial( test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any ) -> _models.PagingResult: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -412,7 +412,7 @@ def begin_test_lro_and_paging( cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -529,7 +529,7 @@ def test_different_calls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/operations/_operation_group_one_operations.py index dd30113fffc..ccd5670b8a2 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -86,7 +86,7 @@ def test_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/aio/operations/_multiapi_service_client_operations.py index 185a63cd51e..1d8f0454281 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/aio/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -56,7 +56,7 @@ async def test_one(self, id: int, message: Optional[str] = None, **kwargs: Any) :rtype: ~multiapicredentialdefaultpolicy.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -115,7 +115,7 @@ async def test_different_calls( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/aio/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/aio/operations/_operation_group_one_operations.py index e69e20bee2a..eb8108f20e4 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/aio/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/aio/operations/_operation_group_one_operations.py @@ -103,7 +103,7 @@ async def test_two( :rtype: ~multiapicredentialdefaultpolicy.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -167,7 +167,7 @@ async def test_three(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/aio/operations/_operation_group_two_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/aio/operations/_operation_group_two_operations.py index 8de23e0ad26..6342e8dd069 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/aio/operations/_operation_group_two_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/aio/operations/_operation_group_two_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -69,7 +69,7 @@ async def test_four( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/operations/_multiapi_service_client_operations.py index 59900fc2413..f1cb52db14f 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -104,7 +104,7 @@ def test_one(self, id: int, message: Optional[str] = None, **kwargs: Any) -> _mo :rtype: ~multiapicredentialdefaultpolicy.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -163,7 +163,7 @@ def test_different_calls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/operations/_operation_group_one_operations.py index f684a4a1fde..832030cdf0c 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/operations/_operation_group_one_operations.py @@ -146,7 +146,7 @@ def test_two( :rtype: ~multiapicredentialdefaultpolicy.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -210,7 +210,7 @@ def test_three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/operations/_operation_group_two_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/operations/_operation_group_two_operations.py index e1f1adb7a03..6549f94b33d 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/operations/_operation_group_two_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v2/operations/_operation_group_two_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -89,7 +89,7 @@ def test_four(self, parameter_one: bool, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_multiapi_service_client_operations.py index 31ec5724871..31473c97596 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar, Union import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -64,7 +64,7 @@ def test_paging(self, **kwargs: Any) -> AsyncIterable["_models.ModelThree"]: cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -144,7 +144,7 @@ async def test_different_calls( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_operation_group_one_operations.py index 3feab7cebb8..c0fcca92a8a 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_operation_group_one_operations.py @@ -78,7 +78,7 @@ def test_operation_group_paging(self, **kwargs: Any) -> AsyncIterable["_models.M cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -187,7 +187,7 @@ async def test_two( :rtype: ~multiapicredentialdefaultpolicy.v3.models.ModelThree :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_operation_group_two_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_operation_group_two_operations.py index dde3040ce50..ccafaf9e5bb 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_operation_group_two_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_operation_group_two_operations.py @@ -104,7 +104,7 @@ async def test_four( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -164,7 +164,7 @@ async def test_five(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_multiapi_service_client_operations.py index e3f947ceef7..3352551fc32 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar, Union import urllib.parse from azure.core.exceptions import ( @@ -105,7 +105,7 @@ def test_paging(self, **kwargs: Any) -> Iterable["_models.ModelThree"]: cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -185,7 +185,7 @@ def test_different_calls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_operation_group_one_operations.py index b5d51c45e71..49361185819 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_operation_group_one_operations.py @@ -111,7 +111,7 @@ def test_operation_group_paging(self, **kwargs: Any) -> Iterable["_models.ModelT cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +220,7 @@ def test_two( :rtype: ~multiapicredentialdefaultpolicy.v3.models.ModelThree :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_operation_group_two_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_operation_group_two_operations.py index 9a2c801c161..de1a237078d 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_operation_group_two_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_operation_group_two_operations.py @@ -147,7 +147,7 @@ def test_four( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -207,7 +207,7 @@ def test_five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v1/aio/operations/_multiapi_custom_base_url_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v1/aio/operations/_multiapi_custom_base_url_service_client_operations.py index 5da1edaade7..6848fd7dbbf 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v1/aio/operations/_multiapi_custom_base_url_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v1/aio/operations/_multiapi_custom_base_url_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -56,7 +56,7 @@ async def test(self, id: int, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v1/operations/_multiapi_custom_base_url_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v1/operations/_multiapi_custom_base_url_service_client_operations.py index 1156b1266d8..0aaa03108ef 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v1/operations/_multiapi_custom_base_url_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v1/operations/_multiapi_custom_base_url_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -78,7 +78,7 @@ def test(self, id: int, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v2/aio/operations/_multiapi_custom_base_url_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v2/aio/operations/_multiapi_custom_base_url_service_client_operations.py index ed43663199d..b5070d9f0dd 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v2/aio/operations/_multiapi_custom_base_url_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v2/aio/operations/_multiapi_custom_base_url_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -56,7 +56,7 @@ async def test(self, id: int, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v2/operations/_multiapi_custom_base_url_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v2/operations/_multiapi_custom_base_url_service_client_operations.py index e6d93c9a4a2..8760c8e03ba 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v2/operations/_multiapi_custom_base_url_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCustomBaseUrl/multiapicustombaseurl/v2/operations/_multiapi_custom_base_url_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -78,7 +78,7 @@ def test(self, id: int, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/aio/operations/_multiapi_service_client_operations.py index 6c0778f461a..d8d570ae4fa 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/aio/operations/_multiapi_service_client_operations.py @@ -68,7 +68,7 @@ async def test_one( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -112,7 +112,7 @@ async def test_one( # pylint: disable=inconsistent-return-statements async def _test_lro_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -264,7 +264,7 @@ async def _test_lro_and_paging_initial( test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any ) -> _models.PagingResult: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -336,7 +336,7 @@ async def begin_test_lro_and_paging( cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -453,7 +453,7 @@ async def test_different_calls( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/aio/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/aio/operations/_operation_group_one_operations.py index bf66c2887bc..0b779622bb3 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/aio/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/aio/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -64,7 +64,7 @@ async def test_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/operations/_multiapi_service_client_operations.py index 04aba94b57c..25648a23e98 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/operations/_multiapi_service_client_operations.py @@ -145,7 +145,7 @@ def test_one( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -189,7 +189,7 @@ def test_one( # pylint: disable=inconsistent-return-statements def _test_lro_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -338,7 +338,7 @@ def _test_lro_and_paging_initial( test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any ) -> _models.PagingResult: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -410,7 +410,7 @@ def begin_test_lro_and_paging( cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -527,7 +527,7 @@ def test_different_calls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/operations/_operation_group_one_operations.py index 4345de484fb..a10bd0445ad 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -85,7 +85,7 @@ def test_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/aio/operations/_multiapi_service_client_operations.py index e7a5a3dd74b..6482e18a57f 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/aio/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -55,7 +55,7 @@ async def test_one(self, id: int, message: Optional[str] = None, **kwargs: Any) :rtype: ~multiapidataplane.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -114,7 +114,7 @@ async def test_different_calls( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/aio/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/aio/operations/_operation_group_one_operations.py index 9ff1afd2622..d64e55b07c4 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/aio/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/aio/operations/_operation_group_one_operations.py @@ -102,7 +102,7 @@ async def test_two( :rtype: ~multiapidataplane.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -166,7 +166,7 @@ async def test_three(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/aio/operations/_operation_group_two_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/aio/operations/_operation_group_two_operations.py index 62a704394e2..d28ae0cdea0 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/aio/operations/_operation_group_two_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/aio/operations/_operation_group_two_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -68,7 +68,7 @@ async def test_four( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/operations/_multiapi_service_client_operations.py index f03d6739e97..1f320792998 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -103,7 +103,7 @@ def test_one(self, id: int, message: Optional[str] = None, **kwargs: Any) -> _mo :rtype: ~multiapidataplane.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -162,7 +162,7 @@ def test_different_calls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/operations/_operation_group_one_operations.py index 80e4554b0b8..d3c8185ccc5 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/operations/_operation_group_one_operations.py @@ -145,7 +145,7 @@ def test_two( :rtype: ~multiapidataplane.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -209,7 +209,7 @@ def test_three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/operations/_operation_group_two_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/operations/_operation_group_two_operations.py index d0b3d469960..e2cbe61d835 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/operations/_operation_group_two_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/operations/_operation_group_two_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -88,7 +88,7 @@ def test_four(self, parameter_one: bool, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_multiapi_service_client_operations.py index 51e4f058d06..0eef36c722c 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar, Union import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -62,7 +62,7 @@ def test_paging(self, **kwargs: Any) -> AsyncIterable["_models.ModelThree"]: cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -142,7 +142,7 @@ async def test_different_calls( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_operation_group_one_operations.py index 6bec77d0dee..f1881aac627 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_operation_group_one_operations.py @@ -76,7 +76,7 @@ def test_operation_group_paging(self, **kwargs: Any) -> AsyncIterable["_models.M cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -185,7 +185,7 @@ async def test_two( :rtype: ~multiapidataplane.v3.models.ModelThree :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_operation_group_two_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_operation_group_two_operations.py index 6ae64795ada..1a0d8ee0027 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_operation_group_two_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_operation_group_two_operations.py @@ -103,7 +103,7 @@ async def test_four( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -163,7 +163,7 @@ async def test_five(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_multiapi_service_client_operations.py index 4532a04d5a0..f49c59b45b3 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar, Union import urllib.parse from azure.core.exceptions import ( @@ -104,7 +104,7 @@ def test_paging(self, **kwargs: Any) -> Iterable["_models.ModelThree"]: cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -184,7 +184,7 @@ def test_different_calls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_operation_group_one_operations.py index 0e198d2b0ef..60064ed3de5 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_operation_group_one_operations.py @@ -110,7 +110,7 @@ def test_operation_group_paging(self, **kwargs: Any) -> Iterable["_models.ModelT cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -219,7 +219,7 @@ def test_two( :rtype: ~multiapidataplane.v3.models.ModelThree :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_operation_group_two_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_operation_group_two_operations.py index d208240aa57..02a916ae64b 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_operation_group_two_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_operation_group_two_operations.py @@ -146,7 +146,7 @@ def test_four( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -206,7 +206,7 @@ def test_five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/aio/operations/_multiapi_service_client_operations.py index 0219bdc3dbf..710a0885dea 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/aio/operations/_multiapi_service_client_operations.py @@ -68,7 +68,7 @@ async def test_one( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -112,7 +112,7 @@ async def test_one( # pylint: disable=inconsistent-return-statements async def _test_lro_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -265,7 +265,7 @@ async def _test_lro_and_paging_initial( client_request_id: Optional[str] = None, **kwargs: Any ) -> _models.PagingResult: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -338,7 +338,7 @@ async def begin_test_lro_and_paging( cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -455,7 +455,7 @@ async def test_different_calls( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/aio/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/aio/operations/_operation_group_one_operations.py index f8c13fe1c79..36c1f4f0196 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/aio/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/aio/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -64,7 +64,7 @@ async def test_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/operations/_multiapi_service_client_operations.py index 1667d4c8f50..efe347201d0 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/operations/_multiapi_service_client_operations.py @@ -145,7 +145,7 @@ def test_one( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -189,7 +189,7 @@ def test_one( # pylint: disable=inconsistent-return-statements def _test_lro_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -339,7 +339,7 @@ def _test_lro_and_paging_initial( client_request_id: Optional[str] = None, **kwargs: Any ) -> _models.PagingResult: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -412,7 +412,7 @@ def begin_test_lro_and_paging( cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -529,7 +529,7 @@ def test_different_calls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/operations/_operation_group_one_operations.py index c8f6aca5678..6a039807589 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -85,7 +85,7 @@ def test_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/aio/operations/_multiapi_service_client_operations.py index 005dac84f0b..6b67660178e 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/aio/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -55,7 +55,7 @@ async def test_one(self, *, id: int, message: Optional[str] = None, **kwargs: An :rtype: ~multiapikeywordonly.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -114,7 +114,7 @@ async def test_different_calls( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/aio/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/aio/operations/_operation_group_one_operations.py index cee63f303da..46c7155b677 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/aio/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/aio/operations/_operation_group_one_operations.py @@ -102,7 +102,7 @@ async def test_two( :rtype: ~multiapikeywordonly.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -166,7 +166,7 @@ async def test_three(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/aio/operations/_operation_group_two_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/aio/operations/_operation_group_two_operations.py index 5a2e682d5f5..d6e25ca2eaa 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/aio/operations/_operation_group_two_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/aio/operations/_operation_group_two_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -68,7 +68,7 @@ async def test_four( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/operations/_multiapi_service_client_operations.py index 2042ca97598..fcd9fb25bb5 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -103,7 +103,7 @@ def test_one(self, *, id: int, message: Optional[str] = None, **kwargs: Any) -> :rtype: ~multiapikeywordonly.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -162,7 +162,7 @@ def test_different_calls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/operations/_operation_group_one_operations.py index 2877ae1fdfb..abdb04fed58 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/operations/_operation_group_one_operations.py @@ -145,7 +145,7 @@ def test_two( :rtype: ~multiapikeywordonly.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -209,7 +209,7 @@ def test_three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/operations/_operation_group_two_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/operations/_operation_group_two_operations.py index bc32eac6aa7..9f00ba14199 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/operations/_operation_group_two_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v2/operations/_operation_group_two_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -90,7 +90,7 @@ def test_four( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/aio/operations/_multiapi_service_client_operations.py index 0f6f6abb0f1..e7bebc2a630 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/aio/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar, Union import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -62,7 +62,7 @@ def test_paging(self, **kwargs: Any) -> AsyncIterable["_models.ModelThree"]: cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +143,7 @@ async def test_different_calls( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/aio/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/aio/operations/_operation_group_one_operations.py index 8d47a2f0f05..3993c34f9f4 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/aio/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/aio/operations/_operation_group_one_operations.py @@ -76,7 +76,7 @@ def test_operation_group_paging(self, **kwargs: Any) -> AsyncIterable["_models.M cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -185,7 +185,7 @@ async def test_two( :rtype: ~multiapikeywordonly.v3.models.ModelThree :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/aio/operations/_operation_group_two_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/aio/operations/_operation_group_two_operations.py index 8ef944418fc..52e67dd0113 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/aio/operations/_operation_group_two_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/aio/operations/_operation_group_two_operations.py @@ -103,7 +103,7 @@ async def test_four( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -163,7 +163,7 @@ async def test_five(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/operations/_multiapi_service_client_operations.py index 4936107a744..316afa2245f 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar, Union import urllib.parse from azure.core.exceptions import ( @@ -104,7 +104,7 @@ def test_paging(self, **kwargs: Any) -> Iterable["_models.ModelThree"]: cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -185,7 +185,7 @@ def test_different_calls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/operations/_operation_group_one_operations.py index bb41543f524..fa180157545 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/operations/_operation_group_one_operations.py @@ -110,7 +110,7 @@ def test_operation_group_paging(self, **kwargs: Any) -> Iterable["_models.ModelT cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -219,7 +219,7 @@ def test_two( :rtype: ~multiapikeywordonly.v3.models.ModelThree :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/operations/_operation_group_two_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/operations/_operation_group_two_operations.py index 25bd3ef9121..a7f31b1998f 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/operations/_operation_group_two_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/operations/_operation_group_two_operations.py @@ -146,7 +146,7 @@ def test_four( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -206,7 +206,7 @@ def test_five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_multiapi_service_client_operations.py index 356b1537d1b..3ddf2a0bf7d 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_multiapi_service_client_operations.py @@ -146,7 +146,7 @@ def test_one( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -190,7 +190,7 @@ def test_one( # pylint: disable=inconsistent-return-statements def _test_lro_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -339,7 +339,7 @@ def _test_lro_and_paging_initial( test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any ) -> _models.PagingResult: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -411,7 +411,7 @@ def begin_test_lro_and_paging( cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -528,7 +528,7 @@ def test_different_calls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_operation_group_one_operations.py index c5aa4bca4e5..f6b0ddd2cbd 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -86,7 +86,7 @@ def test_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/operations/_multiapi_service_client_operations.py index bdebed04763..f46224797be 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -104,7 +104,7 @@ def test_one(self, id: int, message: Optional[str] = None, **kwargs: Any) -> _mo :rtype: ~multiapinoasync.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -163,7 +163,7 @@ def test_different_calls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/operations/_operation_group_one_operations.py index 43eb0f6d90b..cb262f9e7ac 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/operations/_operation_group_one_operations.py @@ -146,7 +146,7 @@ def test_two( :rtype: ~multiapinoasync.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -210,7 +210,7 @@ def test_three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/operations/_operation_group_two_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/operations/_operation_group_two_operations.py index 0985856792e..cd42b3a41f1 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/operations/_operation_group_two_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/operations/_operation_group_two_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -89,7 +89,7 @@ def test_four(self, parameter_one: bool, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_multiapi_service_client_operations.py index 8e6ccb2ba82..7405ae43bb6 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar, Union import urllib.parse from azure.core.exceptions import ( @@ -105,7 +105,7 @@ def test_paging(self, **kwargs: Any) -> Iterable["_models.ModelThree"]: cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -185,7 +185,7 @@ def test_different_calls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_operation_group_one_operations.py index 3b540720eeb..fe48756b262 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_operation_group_one_operations.py @@ -111,7 +111,7 @@ def test_operation_group_paging(self, **kwargs: Any) -> Iterable["_models.ModelT cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +220,7 @@ def test_two( :rtype: ~multiapinoasync.v3.models.ModelThree :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_operation_group_two_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_operation_group_two_operations.py index d31b1fee492..411c5065573 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_operation_group_two_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_operation_group_two_operations.py @@ -147,7 +147,7 @@ def test_four( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -207,7 +207,7 @@ def test_five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v0/aio/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v0/aio/operations/_operation_group_one_operations.py index 3335c32db1b..a21b4db9f34 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v0/aio/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v0/aio/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -63,7 +63,7 @@ async def test_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v0/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v0/operations/_operation_group_one_operations.py index 775e0d70b2d..3ee10da4940 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v0/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v0/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -85,7 +85,7 @@ def test_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/aio/operations/_multiapi_service_client_operations.py index 139cedcc01b..29a1595a024 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/aio/operations/_multiapi_service_client_operations.py @@ -68,7 +68,7 @@ async def test_one( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -112,7 +112,7 @@ async def test_one( # pylint: disable=inconsistent-return-statements async def _test_lro_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -264,7 +264,7 @@ async def _test_lro_and_paging_initial( test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any ) -> _models.PagingResult: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -336,7 +336,7 @@ async def begin_test_lro_and_paging( cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -453,7 +453,7 @@ async def test_different_calls( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/aio/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/aio/operations/_operation_group_one_operations.py index 772795102c0..9e89f57a387 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/aio/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/aio/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -64,7 +64,7 @@ async def test_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/operations/_multiapi_service_client_operations.py index 4b4b7787829..5927fa0d1fe 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/operations/_multiapi_service_client_operations.py @@ -145,7 +145,7 @@ def test_one( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -189,7 +189,7 @@ def test_one( # pylint: disable=inconsistent-return-statements def _test_lro_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -338,7 +338,7 @@ def _test_lro_and_paging_initial( test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any ) -> _models.PagingResult: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -410,7 +410,7 @@ def begin_test_lro_and_paging( cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -527,7 +527,7 @@ def test_different_calls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/operations/_operation_group_one_operations.py index d3642d91846..2953b1db143 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -85,7 +85,7 @@ def test_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations/_multiapi_service_client_operations.py index a1cf4362317..8c17e2db818 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations/_multiapi_service_client_operations.py @@ -69,7 +69,7 @@ async def test_one( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -113,7 +113,7 @@ async def test_one( # pylint: disable=inconsistent-return-statements async def _test_lro_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -265,7 +265,7 @@ async def _test_lro_and_paging_initial( test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any ) -> _models.PagingResult: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -338,7 +338,7 @@ async def begin_test_lro_and_paging( cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -455,7 +455,7 @@ async def test_different_calls( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations/_operation_group_one_operations.py index 6b909c30028..0376da4e3fd 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -65,7 +65,7 @@ async def test_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_multiapi_service_client_operations.py index 151140b66b0..8eca086f774 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_multiapi_service_client_operations.py @@ -146,7 +146,7 @@ def test_one( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -190,7 +190,7 @@ def test_one( # pylint: disable=inconsistent-return-statements def _test_lro_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -339,7 +339,7 @@ def _test_lro_and_paging_initial( test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any ) -> _models.PagingResult: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -412,7 +412,7 @@ def begin_test_lro_and_paging( cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -529,7 +529,7 @@ def test_different_calls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_operation_group_one_operations.py index bd12c2d936c..5b32f3b6bcd 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -86,7 +86,7 @@ def test_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/aio/operations/_multiapi_service_client_operations.py index 1eae7eead17..fda7e8990b2 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/aio/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -56,7 +56,7 @@ async def test_one(self, id: int, message: Optional[str] = None, **kwargs: Any) :rtype: ~multiapiwithsubmodule.submodule.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -115,7 +115,7 @@ async def test_different_calls( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/aio/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/aio/operations/_operation_group_one_operations.py index 2acfcc6d071..680cf489bcd 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/aio/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/aio/operations/_operation_group_one_operations.py @@ -103,7 +103,7 @@ async def test_two( :rtype: ~multiapiwithsubmodule.submodule.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -167,7 +167,7 @@ async def test_three(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/aio/operations/_operation_group_two_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/aio/operations/_operation_group_two_operations.py index af533360a28..8d4c41449d3 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/aio/operations/_operation_group_two_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/aio/operations/_operation_group_two_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -69,7 +69,7 @@ async def test_four( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/operations/_multiapi_service_client_operations.py index 75ee72e7d0d..71ed9753567 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -104,7 +104,7 @@ def test_one(self, id: int, message: Optional[str] = None, **kwargs: Any) -> _mo :rtype: ~multiapiwithsubmodule.submodule.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -163,7 +163,7 @@ def test_different_calls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/operations/_operation_group_one_operations.py index 405800b440c..6d618955a92 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/operations/_operation_group_one_operations.py @@ -146,7 +146,7 @@ def test_two( :rtype: ~multiapiwithsubmodule.submodule.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -210,7 +210,7 @@ def test_three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/operations/_operation_group_two_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/operations/_operation_group_two_operations.py index 8cac92a5466..7bebdd0f656 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/operations/_operation_group_two_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/operations/_operation_group_two_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -89,7 +89,7 @@ def test_four(self, parameter_one: bool, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_multiapi_service_client_operations.py index d5032cfec97..3efb4239bb7 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar, Union import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -64,7 +64,7 @@ def test_paging(self, **kwargs: Any) -> AsyncIterable["_models.ModelThree"]: cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -144,7 +144,7 @@ async def test_different_calls( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_operation_group_one_operations.py index 859e77d95f8..6aeabc1bf5f 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_operation_group_one_operations.py @@ -78,7 +78,7 @@ def test_operation_group_paging(self, **kwargs: Any) -> AsyncIterable["_models.M cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -187,7 +187,7 @@ async def test_two( :rtype: ~multiapiwithsubmodule.submodule.v3.models.ModelThree :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_operation_group_two_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_operation_group_two_operations.py index 968205204e9..f89f386af11 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_operation_group_two_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_operation_group_two_operations.py @@ -104,7 +104,7 @@ async def test_four( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -164,7 +164,7 @@ async def test_five(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_multiapi_service_client_operations.py index 518e11df628..734a4c73ca5 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar, Union import urllib.parse from azure.core.exceptions import ( @@ -105,7 +105,7 @@ def test_paging(self, **kwargs: Any) -> Iterable["_models.ModelThree"]: cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -185,7 +185,7 @@ def test_different_calls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_operation_group_one_operations.py index 0cd9fdc8ae0..0b59f2ff060 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_operation_group_one_operations.py @@ -111,7 +111,7 @@ def test_operation_group_paging(self, **kwargs: Any) -> Iterable["_models.ModelT cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +220,7 @@ def test_two( :rtype: ~multiapiwithsubmodule.submodule.v3.models.ModelThree :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_operation_group_two_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_operation_group_two_operations.py index da144e12350..126e6c9c9ad 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_operation_group_two_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_operation_group_two_operations.py @@ -147,7 +147,7 @@ def test_four( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -207,7 +207,7 @@ def test_five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/aio/operations/_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/aio/operations/_operations.py index b6af7d542e3..733bc7526ae 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/aio/operations/_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/aio/operations/_operations.py @@ -97,7 +97,7 @@ async def test_two( :rtype: ~multiapicombiner.v3.models.ModelThree :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +165,7 @@ async def test_three(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -219,7 +219,7 @@ def test_operation_group_paging(self, **kwargs: Any) -> AsyncIterable["_models.M cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -319,7 +319,7 @@ async def test_four( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -383,7 +383,7 @@ async def test_five(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -432,7 +432,7 @@ async def _test_lro_and_paging_initial( client_request_id: Optional[str] = None, **kwargs: Any ) -> _models.PagingResult: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -483,7 +483,7 @@ async def _test_lro_and_paging_initial( async def _test_lro_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -629,7 +629,7 @@ async def begin_test_lro_and_paging( cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -762,7 +762,7 @@ async def test_different_calls( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -820,7 +820,7 @@ async def test_one(self, *, id: int, message: Optional[str] = None, **kwargs: An :rtype: ~multiapicombiner.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -882,7 +882,7 @@ def test_paging(self, **kwargs: Any) -> AsyncIterable["_models.ModelThree"]: cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/operations/_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/operations/_operations.py index 451d8b0f8fd..c864219ca9a 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/operations/_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/operations/_operations.py @@ -141,7 +141,7 @@ def test_two( :rtype: ~multiapicombiner.v3.models.ModelThree :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -209,7 +209,7 @@ def test_three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -263,7 +263,7 @@ def test_operation_group_paging(self, **kwargs: Any) -> Iterable["_models.ModelT cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -402,7 +402,7 @@ def test_four( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -466,7 +466,7 @@ def test_five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -615,7 +615,7 @@ def _test_lro_and_paging_initial( client_request_id: Optional[str] = None, **kwargs: Any ) -> _models.PagingResult: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -666,7 +666,7 @@ def _test_lro_and_paging_initial( def _test_lro_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -811,7 +811,7 @@ def begin_test_lro_and_paging( cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -944,7 +944,7 @@ def test_different_calls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1002,7 +1002,7 @@ def test_one(self, *, id: int, message: Optional[str] = None, **kwargs: Any) -> :rtype: ~multiapicombiner.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1064,7 +1064,7 @@ def test_paging(self, **kwargs: Any) -> Iterable["_models.ModelThree"]: cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/v1/aio/operations/_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/v1/aio/operations/_operations.py index 5487c50e713..65075a0d7b4 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/v1/aio/operations/_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/v1/aio/operations/_operations.py @@ -70,7 +70,7 @@ async def test_one( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -114,7 +114,7 @@ async def test_one( # pylint: disable=inconsistent-return-statements async def _test_lro_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -267,7 +267,7 @@ async def _test_lro_and_paging_initial( client_request_id: Optional[str] = None, **kwargs: Any ) -> _models.PagingResult: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -340,7 +340,7 @@ async def begin_test_lro_and_paging( cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -457,7 +457,7 @@ async def test_different_calls( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -526,7 +526,7 @@ async def test_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/v1/operations/_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/v1/operations/_operations.py index 9f24dd704da..ab872c28bca 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/v1/operations/_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/v1/operations/_operations.py @@ -167,7 +167,7 @@ def test_one( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -211,7 +211,7 @@ def test_one( # pylint: disable=inconsistent-return-statements def _test_lro_initial( self, product: Optional[Union[_models.Product, IO[bytes]]] = None, **kwargs: Any ) -> Optional[_models.Product]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -361,7 +361,7 @@ def _test_lro_and_paging_initial( client_request_id: Optional[str] = None, **kwargs: Any ) -> _models.PagingResult: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -434,7 +434,7 @@ def begin_test_lro_and_paging( cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -551,7 +551,7 @@ def test_different_calls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -620,7 +620,7 @@ def test_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/v2/aio/operations/_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/v2/aio/operations/_operations.py index b491366faeb..77bb9742188 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/v2/aio/operations/_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/v2/aio/operations/_operations.py @@ -63,7 +63,7 @@ async def test_one(self, *, id: int, message: Optional[str] = None, **kwargs: An :rtype: ~multiapicombiner.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -122,7 +122,7 @@ async def test_different_calls( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -229,7 +229,7 @@ async def test_two( :rtype: ~multiapicombiner.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -293,7 +293,7 @@ async def test_three(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -363,7 +363,7 @@ async def test_four( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/v2/operations/_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/v2/operations/_operations.py index a0d13f2b3dc..d61cbe9b7e5 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/v2/operations/_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/v2/operations/_operations.py @@ -168,7 +168,7 @@ def test_one(self, *, id: int, message: Optional[str] = None, **kwargs: Any) -> :rtype: ~multiapicombiner.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -227,7 +227,7 @@ def test_different_calls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -334,7 +334,7 @@ def test_two( :rtype: ~multiapicombiner.v2.models.ModelTwo :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -398,7 +398,7 @@ def test_three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -468,7 +468,7 @@ def test_four( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/v3/aio/operations/_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/v3/aio/operations/_operations.py index 8e89514af11..b86915a3b4b 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/v3/aio/operations/_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/v3/aio/operations/_operations.py @@ -68,7 +68,7 @@ def test_paging(self, **kwargs: Any) -> AsyncIterable["_models.ModelThree"]: cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -149,7 +149,7 @@ async def test_different_calls( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -225,7 +225,7 @@ def test_operation_group_paging(self, **kwargs: Any) -> AsyncIterable["_models.M cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -334,7 +334,7 @@ async def test_two( :rtype: ~multiapicombiner.v3.models.ModelThree :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -457,7 +457,7 @@ async def test_four( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -517,7 +517,7 @@ async def test_five(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/v3/operations/_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/v3/operations/_operations.py index 480e7b1e9f0..ef66fa323c9 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/v3/operations/_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/multiapicombiner/multiapicombiner/v3/operations/_operations.py @@ -185,7 +185,7 @@ def test_paging(self, **kwargs: Any) -> Iterable["_models.ModelThree"]: cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -266,7 +266,7 @@ def test_different_calls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -342,7 +342,7 @@ def test_operation_group_paging(self, **kwargs: Any) -> Iterable["_models.ModelT cls: ClsType[_models.PagingResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -451,7 +451,7 @@ def test_two( :rtype: ~multiapicombiner.v3.models.ModelThree :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -574,7 +574,7 @@ def test_four( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -634,7 +634,7 @@ def test_five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/AdditionalProperties/additionalproperties/aio/operations/_pets_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/AdditionalProperties/additionalproperties/aio/operations/_pets_operations.py index cb47773374c..681dd78af09 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/AdditionalProperties/additionalproperties/aio/operations/_pets_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/AdditionalProperties/additionalproperties/aio/operations/_pets_operations.py @@ -106,7 +106,7 @@ async def create_ap_true( :rtype: ~additionalproperties.models.PetAPTrue :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -201,7 +201,7 @@ async def create_cat_ap_true( :rtype: ~additionalproperties.models.CatAPTrue :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -296,7 +296,7 @@ async def create_ap_object( :rtype: ~additionalproperties.models.PetAPObject :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -391,7 +391,7 @@ async def create_ap_string( :rtype: ~additionalproperties.models.PetAPString :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -486,7 +486,7 @@ async def create_ap_in_properties( :rtype: ~additionalproperties.models.PetAPInProperties :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -587,7 +587,7 @@ async def create_ap_in_properties_with_ap_string( :rtype: ~additionalproperties.models.PetAPInPropertiesWithAPString :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/AdditionalProperties/additionalproperties/operations/_pets_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/AdditionalProperties/additionalproperties/operations/_pets_operations.py index 2e964d7390a..74dcbc9e162 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/AdditionalProperties/additionalproperties/operations/_pets_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/AdditionalProperties/additionalproperties/operations/_pets_operations.py @@ -204,7 +204,7 @@ def create_ap_true( :rtype: ~additionalproperties.models.PetAPTrue :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -299,7 +299,7 @@ def create_cat_ap_true( :rtype: ~additionalproperties.models.CatAPTrue :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -394,7 +394,7 @@ def create_ap_object( :rtype: ~additionalproperties.models.PetAPObject :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -489,7 +489,7 @@ def create_ap_string( :rtype: ~additionalproperties.models.PetAPString :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -584,7 +584,7 @@ def create_ap_in_properties( :rtype: ~additionalproperties.models.PetAPInProperties :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -685,7 +685,7 @@ def create_ap_in_properties_with_ap_string( :rtype: ~additionalproperties.models.PetAPInPropertiesWithAPString :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Anything/anything/aio/operations/_anything_client_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Anything/anything/aio/operations/_anything_client_operations.py index d12850400fa..3834e8eb6a4 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Anything/anything/aio/operations/_anything_client_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Anything/anything/aio/operations/_anything_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -52,7 +52,7 @@ async def get_object(self, **kwargs: Any) -> Any: :rtype: any :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -101,7 +101,7 @@ async def put_object(self, input: Any, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -148,7 +148,7 @@ async def get_string(self, **kwargs: Any) -> Any: :rtype: any :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -197,7 +197,7 @@ async def put_string(self, input: Any, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -244,7 +244,7 @@ async def get_array(self, **kwargs: Any) -> Any: :rtype: any :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -293,7 +293,7 @@ async def put_array(self, input: Any, **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Anything/anything/operations/_anything_client_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Anything/anything/operations/_anything_client_operations.py index 978d2a14679..01f2bc4bba6 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Anything/anything/operations/_anything_client_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Anything/anything/operations/_anything_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -131,7 +131,7 @@ def get_object(self, **kwargs: Any) -> Any: :rtype: any :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -180,7 +180,7 @@ def put_object(self, input: Any, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -227,7 +227,7 @@ def get_string(self, **kwargs: Any) -> Any: :rtype: any :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -276,7 +276,7 @@ def put_string(self, input: Any, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -323,7 +323,7 @@ def get_array(self, **kwargs: Any) -> Any: :rtype: any :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -372,7 +372,7 @@ def put_array(self, input: Any, **kwargs: Any) -> None: # pylint: disable=incon :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyArray/bodyarray/aio/operations/_array_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyArray/bodyarray/aio/operations/_array_operations.py index e923f96ffe5..7d163a72412 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyArray/bodyarray/aio/operations/_array_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyArray/bodyarray/aio/operations/_array_operations.py @@ -134,7 +134,7 @@ async def get_null(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -181,7 +181,7 @@ async def get_invalid(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -228,7 +228,7 @@ async def get_empty(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -311,7 +311,7 @@ async def put_empty( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -366,7 +366,7 @@ async def get_boolean_tfft(self, **kwargs: Any) -> List[bool]: :rtype: list[bool] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -449,7 +449,7 @@ async def put_boolean_tfft( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -504,7 +504,7 @@ async def get_boolean_invalid_null(self, **kwargs: Any) -> List[bool]: :rtype: list[bool] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -551,7 +551,7 @@ async def get_boolean_invalid_string(self, **kwargs: Any) -> List[bool]: :rtype: list[bool] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -598,7 +598,7 @@ async def get_integer_valid(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -681,7 +681,7 @@ async def put_integer_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -736,7 +736,7 @@ async def get_int_invalid_null(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -783,7 +783,7 @@ async def get_int_invalid_string(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -830,7 +830,7 @@ async def get_long_valid(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -913,7 +913,7 @@ async def put_long_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -968,7 +968,7 @@ async def get_long_invalid_null(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1015,7 +1015,7 @@ async def get_long_invalid_string(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1062,7 +1062,7 @@ async def get_float_valid(self, **kwargs: Any) -> List[float]: :rtype: list[float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1145,7 +1145,7 @@ async def put_float_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1200,7 +1200,7 @@ async def get_float_invalid_null(self, **kwargs: Any) -> List[float]: :rtype: list[float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1247,7 +1247,7 @@ async def get_float_invalid_string(self, **kwargs: Any) -> List[float]: :rtype: list[float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1294,7 +1294,7 @@ async def get_double_valid(self, **kwargs: Any) -> List[float]: :rtype: list[float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1377,7 +1377,7 @@ async def put_double_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1432,7 +1432,7 @@ async def get_double_invalid_null(self, **kwargs: Any) -> List[float]: :rtype: list[float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1479,7 +1479,7 @@ async def get_double_invalid_string(self, **kwargs: Any) -> List[float]: :rtype: list[float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1526,7 +1526,7 @@ async def get_string_valid(self, **kwargs: Any) -> List[str]: :rtype: list[str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1609,7 +1609,7 @@ async def put_string_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1664,7 +1664,7 @@ async def get_enum_valid(self, **kwargs: Any) -> List[Union[str, _models.FooEnum :rtype: list[str or ~bodyarray.models.FooEnum] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1748,7 +1748,7 @@ async def put_enum_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1803,7 +1803,7 @@ async def get_string_enum_valid(self, **kwargs: Any) -> List[Union[str, _models. :rtype: list[str or ~bodyarray.models.Enum0] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1887,7 +1887,7 @@ async def put_string_enum_valid( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1942,7 +1942,7 @@ async def get_string_with_null(self, **kwargs: Any) -> List[str]: :rtype: list[str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1989,7 +1989,7 @@ async def get_string_with_invalid(self, **kwargs: Any) -> List[str]: :rtype: list[str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2037,7 +2037,7 @@ async def get_uuid_valid(self, **kwargs: Any) -> List[str]: :rtype: list[str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2123,7 +2123,7 @@ async def put_uuid_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2178,7 +2178,7 @@ async def get_uuid_invalid_chars(self, **kwargs: Any) -> List[str]: :rtype: list[str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2225,7 +2225,7 @@ async def get_date_valid(self, **kwargs: Any) -> List[datetime.date]: :rtype: list[~datetime.date] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2308,7 +2308,7 @@ async def put_date_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2363,7 +2363,7 @@ async def get_date_invalid_null(self, **kwargs: Any) -> List[datetime.date]: :rtype: list[~datetime.date] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2410,7 +2410,7 @@ async def get_date_invalid_chars(self, **kwargs: Any) -> List[datetime.date]: :rtype: list[~datetime.date] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2458,7 +2458,7 @@ async def get_date_time_valid(self, **kwargs: Any) -> List[datetime.datetime]: :rtype: list[~datetime.datetime] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2544,7 +2544,7 @@ async def put_date_time_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2599,7 +2599,7 @@ async def get_date_time_invalid_null(self, **kwargs: Any) -> List[datetime.datet :rtype: list[~datetime.datetime] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2646,7 +2646,7 @@ async def get_date_time_invalid_chars(self, **kwargs: Any) -> List[datetime.date :rtype: list[~datetime.datetime] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2694,7 +2694,7 @@ async def get_date_time_rfc1123_valid(self, **kwargs: Any) -> List[datetime.date :rtype: list[~datetime.datetime] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2780,7 +2780,7 @@ async def put_date_time_rfc1123_valid( # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2835,7 +2835,7 @@ async def get_duration_valid(self, **kwargs: Any) -> List[datetime.timedelta]: :rtype: list[~datetime.timedelta] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2918,7 +2918,7 @@ async def put_duration_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2974,7 +2974,7 @@ async def get_byte_valid(self, **kwargs: Any) -> List[bytes]: :rtype: list[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3060,7 +3060,7 @@ async def put_byte_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3115,7 +3115,7 @@ async def get_byte_invalid_null(self, **kwargs: Any) -> List[bytes]: :rtype: list[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3163,7 +3163,7 @@ async def get_base64_url(self, **kwargs: Any) -> List[bytes]: :rtype: list[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3210,7 +3210,7 @@ async def get_complex_null(self, **kwargs: Any) -> List[_models.Product]: :rtype: list[~bodyarray.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3257,7 +3257,7 @@ async def get_complex_empty(self, **kwargs: Any) -> List[_models.Product]: :rtype: list[~bodyarray.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3305,7 +3305,7 @@ async def get_complex_item_null(self, **kwargs: Any) -> List[_models.Product]: :rtype: list[~bodyarray.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3353,7 +3353,7 @@ async def get_complex_item_empty(self, **kwargs: Any) -> List[_models.Product]: :rtype: list[~bodyarray.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3401,7 +3401,7 @@ async def get_complex_valid(self, **kwargs: Any) -> List[_models.Product]: :rtype: list[~bodyarray.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3487,7 +3487,7 @@ async def put_complex_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3542,7 +3542,7 @@ async def get_array_null(self, **kwargs: Any) -> List[List[str]]: :rtype: list[list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3589,7 +3589,7 @@ async def get_array_empty(self, **kwargs: Any) -> List[List[str]]: :rtype: list[list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3636,7 +3636,7 @@ async def get_array_item_null(self, **kwargs: Any) -> List[List[str]]: :rtype: list[list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3683,7 +3683,7 @@ async def get_array_item_empty(self, **kwargs: Any) -> List[List[str]]: :rtype: list[list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3730,7 +3730,7 @@ async def get_array_valid(self, **kwargs: Any) -> List[List[str]]: :rtype: list[list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3813,7 +3813,7 @@ async def put_array_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3868,7 +3868,7 @@ async def get_dictionary_null(self, **kwargs: Any) -> List[Dict[str, str]]: :rtype: list[dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3915,7 +3915,7 @@ async def get_dictionary_empty(self, **kwargs: Any) -> List[Dict[str, str]]: :rtype: list[dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3963,7 +3963,7 @@ async def get_dictionary_item_null(self, **kwargs: Any) -> List[Dict[str, str]]: :rtype: list[dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4011,7 +4011,7 @@ async def get_dictionary_item_empty(self, **kwargs: Any) -> List[Dict[str, str]] :rtype: list[dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4059,7 +4059,7 @@ async def get_dictionary_valid(self, **kwargs: Any) -> List[Dict[str, str]]: :rtype: list[dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4145,7 +4145,7 @@ async def put_dictionary_valid( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyArray/bodyarray/operations/_array_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyArray/bodyarray/operations/_array_operations.py index 3fb751cd1ed..bb0af189ae6 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyArray/bodyarray/operations/_array_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyArray/bodyarray/operations/_array_operations.py @@ -1087,7 +1087,7 @@ def get_null(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1134,7 +1134,7 @@ def get_invalid(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1181,7 +1181,7 @@ def get_empty(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1264,7 +1264,7 @@ def put_empty( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1319,7 +1319,7 @@ def get_boolean_tfft(self, **kwargs: Any) -> List[bool]: :rtype: list[bool] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1402,7 +1402,7 @@ def put_boolean_tfft( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1457,7 +1457,7 @@ def get_boolean_invalid_null(self, **kwargs: Any) -> List[bool]: :rtype: list[bool] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1504,7 +1504,7 @@ def get_boolean_invalid_string(self, **kwargs: Any) -> List[bool]: :rtype: list[bool] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1551,7 +1551,7 @@ def get_integer_valid(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1634,7 +1634,7 @@ def put_integer_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1689,7 +1689,7 @@ def get_int_invalid_null(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1736,7 +1736,7 @@ def get_int_invalid_string(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1783,7 +1783,7 @@ def get_long_valid(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1866,7 +1866,7 @@ def put_long_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1921,7 +1921,7 @@ def get_long_invalid_null(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1968,7 +1968,7 @@ def get_long_invalid_string(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2015,7 +2015,7 @@ def get_float_valid(self, **kwargs: Any) -> List[float]: :rtype: list[float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2098,7 +2098,7 @@ def put_float_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2153,7 +2153,7 @@ def get_float_invalid_null(self, **kwargs: Any) -> List[float]: :rtype: list[float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2200,7 +2200,7 @@ def get_float_invalid_string(self, **kwargs: Any) -> List[float]: :rtype: list[float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2247,7 +2247,7 @@ def get_double_valid(self, **kwargs: Any) -> List[float]: :rtype: list[float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2330,7 +2330,7 @@ def put_double_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2385,7 +2385,7 @@ def get_double_invalid_null(self, **kwargs: Any) -> List[float]: :rtype: list[float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2432,7 +2432,7 @@ def get_double_invalid_string(self, **kwargs: Any) -> List[float]: :rtype: list[float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2479,7 +2479,7 @@ def get_string_valid(self, **kwargs: Any) -> List[str]: :rtype: list[str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2562,7 +2562,7 @@ def put_string_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2617,7 +2617,7 @@ def get_enum_valid(self, **kwargs: Any) -> List[Union[str, _models.FooEnum]]: :rtype: list[str or ~bodyarray.models.FooEnum] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2701,7 +2701,7 @@ def put_enum_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2756,7 +2756,7 @@ def get_string_enum_valid(self, **kwargs: Any) -> List[Union[str, _models.Enum0] :rtype: list[str or ~bodyarray.models.Enum0] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2840,7 +2840,7 @@ def put_string_enum_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2895,7 +2895,7 @@ def get_string_with_null(self, **kwargs: Any) -> List[str]: :rtype: list[str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2942,7 +2942,7 @@ def get_string_with_invalid(self, **kwargs: Any) -> List[str]: :rtype: list[str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2990,7 +2990,7 @@ def get_uuid_valid(self, **kwargs: Any) -> List[str]: :rtype: list[str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3076,7 +3076,7 @@ def put_uuid_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3131,7 +3131,7 @@ def get_uuid_invalid_chars(self, **kwargs: Any) -> List[str]: :rtype: list[str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3178,7 +3178,7 @@ def get_date_valid(self, **kwargs: Any) -> List[datetime.date]: :rtype: list[~datetime.date] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3261,7 +3261,7 @@ def put_date_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3316,7 +3316,7 @@ def get_date_invalid_null(self, **kwargs: Any) -> List[datetime.date]: :rtype: list[~datetime.date] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3363,7 +3363,7 @@ def get_date_invalid_chars(self, **kwargs: Any) -> List[datetime.date]: :rtype: list[~datetime.date] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3411,7 +3411,7 @@ def get_date_time_valid(self, **kwargs: Any) -> List[datetime.datetime]: :rtype: list[~datetime.datetime] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3497,7 +3497,7 @@ def put_date_time_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3552,7 +3552,7 @@ def get_date_time_invalid_null(self, **kwargs: Any) -> List[datetime.datetime]: :rtype: list[~datetime.datetime] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3599,7 +3599,7 @@ def get_date_time_invalid_chars(self, **kwargs: Any) -> List[datetime.datetime]: :rtype: list[~datetime.datetime] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3647,7 +3647,7 @@ def get_date_time_rfc1123_valid(self, **kwargs: Any) -> List[datetime.datetime]: :rtype: list[~datetime.datetime] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3733,7 +3733,7 @@ def put_date_time_rfc1123_valid( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3788,7 +3788,7 @@ def get_duration_valid(self, **kwargs: Any) -> List[datetime.timedelta]: :rtype: list[~datetime.timedelta] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3871,7 +3871,7 @@ def put_duration_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3927,7 +3927,7 @@ def get_byte_valid(self, **kwargs: Any) -> List[bytes]: :rtype: list[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4013,7 +4013,7 @@ def put_byte_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4068,7 +4068,7 @@ def get_byte_invalid_null(self, **kwargs: Any) -> List[bytes]: :rtype: list[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4116,7 +4116,7 @@ def get_base64_url(self, **kwargs: Any) -> List[bytes]: :rtype: list[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4163,7 +4163,7 @@ def get_complex_null(self, **kwargs: Any) -> List[_models.Product]: :rtype: list[~bodyarray.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4210,7 +4210,7 @@ def get_complex_empty(self, **kwargs: Any) -> List[_models.Product]: :rtype: list[~bodyarray.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4258,7 +4258,7 @@ def get_complex_item_null(self, **kwargs: Any) -> List[_models.Product]: :rtype: list[~bodyarray.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4306,7 +4306,7 @@ def get_complex_item_empty(self, **kwargs: Any) -> List[_models.Product]: :rtype: list[~bodyarray.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4354,7 +4354,7 @@ def get_complex_valid(self, **kwargs: Any) -> List[_models.Product]: :rtype: list[~bodyarray.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4440,7 +4440,7 @@ def put_complex_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4495,7 +4495,7 @@ def get_array_null(self, **kwargs: Any) -> List[List[str]]: :rtype: list[list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4542,7 +4542,7 @@ def get_array_empty(self, **kwargs: Any) -> List[List[str]]: :rtype: list[list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4589,7 +4589,7 @@ def get_array_item_null(self, **kwargs: Any) -> List[List[str]]: :rtype: list[list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4636,7 +4636,7 @@ def get_array_item_empty(self, **kwargs: Any) -> List[List[str]]: :rtype: list[list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4683,7 +4683,7 @@ def get_array_valid(self, **kwargs: Any) -> List[List[str]]: :rtype: list[list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4766,7 +4766,7 @@ def put_array_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4821,7 +4821,7 @@ def get_dictionary_null(self, **kwargs: Any) -> List[Dict[str, str]]: :rtype: list[dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4868,7 +4868,7 @@ def get_dictionary_empty(self, **kwargs: Any) -> List[Dict[str, str]]: :rtype: list[dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4916,7 +4916,7 @@ def get_dictionary_item_null(self, **kwargs: Any) -> List[Dict[str, str]]: :rtype: list[dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4964,7 +4964,7 @@ def get_dictionary_item_empty(self, **kwargs: Any) -> List[Dict[str, str]]: :rtype: list[dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5012,7 +5012,7 @@ def get_dictionary_valid(self, **kwargs: Any) -> List[Dict[str, str]]: :rtype: list[dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5098,7 +5098,7 @@ def put_dictionary_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/aio/operations/_array_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/aio/operations/_array_operations.py index a8c57560ecb..479ba1ec3c4 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/aio/operations/_array_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/aio/operations/_array_operations.py @@ -134,7 +134,7 @@ async def get_null(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -181,7 +181,7 @@ async def get_invalid(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -228,7 +228,7 @@ async def get_empty(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -311,7 +311,7 @@ async def put_empty( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -366,7 +366,7 @@ async def get_boolean_tfft(self, **kwargs: Any) -> List[bool]: :rtype: list[bool] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -449,7 +449,7 @@ async def put_boolean_tfft( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -504,7 +504,7 @@ async def get_boolean_invalid_null(self, **kwargs: Any) -> List[bool]: :rtype: list[bool] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -551,7 +551,7 @@ async def get_boolean_invalid_string(self, **kwargs: Any) -> List[bool]: :rtype: list[bool] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -598,7 +598,7 @@ async def get_integer_valid(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -681,7 +681,7 @@ async def put_integer_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -736,7 +736,7 @@ async def get_int_invalid_null(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -783,7 +783,7 @@ async def get_int_invalid_string(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -830,7 +830,7 @@ async def get_long_valid(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -913,7 +913,7 @@ async def put_long_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -968,7 +968,7 @@ async def get_long_invalid_null(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1015,7 +1015,7 @@ async def get_long_invalid_string(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1062,7 +1062,7 @@ async def get_float_valid(self, **kwargs: Any) -> List[float]: :rtype: list[float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1145,7 +1145,7 @@ async def put_float_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1200,7 +1200,7 @@ async def get_float_invalid_null(self, **kwargs: Any) -> List[float]: :rtype: list[float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1247,7 +1247,7 @@ async def get_float_invalid_string(self, **kwargs: Any) -> List[float]: :rtype: list[float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1294,7 +1294,7 @@ async def get_double_valid(self, **kwargs: Any) -> List[float]: :rtype: list[float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1377,7 +1377,7 @@ async def put_double_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1432,7 +1432,7 @@ async def get_double_invalid_null(self, **kwargs: Any) -> List[float]: :rtype: list[float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1479,7 +1479,7 @@ async def get_double_invalid_string(self, **kwargs: Any) -> List[float]: :rtype: list[float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1526,7 +1526,7 @@ async def get_string_valid(self, **kwargs: Any) -> List[str]: :rtype: list[str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1609,7 +1609,7 @@ async def put_string_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1664,7 +1664,7 @@ async def get_enum_valid(self, **kwargs: Any) -> List[Union[str, _models.FooEnum :rtype: list[str or ~vanilla.body.array.models.FooEnum] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1748,7 +1748,7 @@ async def put_enum_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1803,7 +1803,7 @@ async def get_string_enum_valid(self, **kwargs: Any) -> List[Union[str, _models. :rtype: list[str or ~vanilla.body.array.models.Enum0] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1887,7 +1887,7 @@ async def put_string_enum_valid( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1942,7 +1942,7 @@ async def get_string_with_null(self, **kwargs: Any) -> List[str]: :rtype: list[str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1989,7 +1989,7 @@ async def get_string_with_invalid(self, **kwargs: Any) -> List[str]: :rtype: list[str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2037,7 +2037,7 @@ async def get_uuid_valid(self, **kwargs: Any) -> List[str]: :rtype: list[str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2123,7 +2123,7 @@ async def put_uuid_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2178,7 +2178,7 @@ async def get_uuid_invalid_chars(self, **kwargs: Any) -> List[str]: :rtype: list[str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2225,7 +2225,7 @@ async def get_date_valid(self, **kwargs: Any) -> List[datetime.date]: :rtype: list[~datetime.date] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2308,7 +2308,7 @@ async def put_date_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2363,7 +2363,7 @@ async def get_date_invalid_null(self, **kwargs: Any) -> List[datetime.date]: :rtype: list[~datetime.date] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2410,7 +2410,7 @@ async def get_date_invalid_chars(self, **kwargs: Any) -> List[datetime.date]: :rtype: list[~datetime.date] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2458,7 +2458,7 @@ async def get_date_time_valid(self, **kwargs: Any) -> List[datetime.datetime]: :rtype: list[~datetime.datetime] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2544,7 +2544,7 @@ async def put_date_time_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2599,7 +2599,7 @@ async def get_date_time_invalid_null(self, **kwargs: Any) -> List[datetime.datet :rtype: list[~datetime.datetime] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2646,7 +2646,7 @@ async def get_date_time_invalid_chars(self, **kwargs: Any) -> List[datetime.date :rtype: list[~datetime.datetime] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2694,7 +2694,7 @@ async def get_date_time_rfc1123_valid(self, **kwargs: Any) -> List[datetime.date :rtype: list[~datetime.datetime] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2780,7 +2780,7 @@ async def put_date_time_rfc1123_valid( # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2835,7 +2835,7 @@ async def get_duration_valid(self, **kwargs: Any) -> List[datetime.timedelta]: :rtype: list[~datetime.timedelta] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2918,7 +2918,7 @@ async def put_duration_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2974,7 +2974,7 @@ async def get_byte_valid(self, **kwargs: Any) -> List[bytes]: :rtype: list[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3060,7 +3060,7 @@ async def put_byte_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3115,7 +3115,7 @@ async def get_byte_invalid_null(self, **kwargs: Any) -> List[bytes]: :rtype: list[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3163,7 +3163,7 @@ async def get_base64_url(self, **kwargs: Any) -> List[bytes]: :rtype: list[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3210,7 +3210,7 @@ async def get_complex_null(self, **kwargs: Any) -> List[_models.Product]: :rtype: list[~vanilla.body.array.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3257,7 +3257,7 @@ async def get_complex_empty(self, **kwargs: Any) -> List[_models.Product]: :rtype: list[~vanilla.body.array.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3305,7 +3305,7 @@ async def get_complex_item_null(self, **kwargs: Any) -> List[_models.Product]: :rtype: list[~vanilla.body.array.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3353,7 +3353,7 @@ async def get_complex_item_empty(self, **kwargs: Any) -> List[_models.Product]: :rtype: list[~vanilla.body.array.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3401,7 +3401,7 @@ async def get_complex_valid(self, **kwargs: Any) -> List[_models.Product]: :rtype: list[~vanilla.body.array.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3487,7 +3487,7 @@ async def put_complex_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3542,7 +3542,7 @@ async def get_array_null(self, **kwargs: Any) -> List[List[str]]: :rtype: list[list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3589,7 +3589,7 @@ async def get_array_empty(self, **kwargs: Any) -> List[List[str]]: :rtype: list[list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3636,7 +3636,7 @@ async def get_array_item_null(self, **kwargs: Any) -> List[List[str]]: :rtype: list[list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3683,7 +3683,7 @@ async def get_array_item_empty(self, **kwargs: Any) -> List[List[str]]: :rtype: list[list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3730,7 +3730,7 @@ async def get_array_valid(self, **kwargs: Any) -> List[List[str]]: :rtype: list[list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3813,7 +3813,7 @@ async def put_array_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3868,7 +3868,7 @@ async def get_dictionary_null(self, **kwargs: Any) -> List[Dict[str, str]]: :rtype: list[dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3915,7 +3915,7 @@ async def get_dictionary_empty(self, **kwargs: Any) -> List[Dict[str, str]]: :rtype: list[dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3963,7 +3963,7 @@ async def get_dictionary_item_null(self, **kwargs: Any) -> List[Dict[str, str]]: :rtype: list[dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4011,7 +4011,7 @@ async def get_dictionary_item_empty(self, **kwargs: Any) -> List[Dict[str, str]] :rtype: list[dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4059,7 +4059,7 @@ async def get_dictionary_valid(self, **kwargs: Any) -> List[Dict[str, str]]: :rtype: list[dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4145,7 +4145,7 @@ async def put_dictionary_valid( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/operations/_array_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/operations/_array_operations.py index 9b087ca2058..6660b821032 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/operations/_array_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/operations/_array_operations.py @@ -1087,7 +1087,7 @@ def get_null(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1134,7 +1134,7 @@ def get_invalid(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1181,7 +1181,7 @@ def get_empty(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1264,7 +1264,7 @@ def put_empty( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1319,7 +1319,7 @@ def get_boolean_tfft(self, **kwargs: Any) -> List[bool]: :rtype: list[bool] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1402,7 +1402,7 @@ def put_boolean_tfft( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1457,7 +1457,7 @@ def get_boolean_invalid_null(self, **kwargs: Any) -> List[bool]: :rtype: list[bool] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1504,7 +1504,7 @@ def get_boolean_invalid_string(self, **kwargs: Any) -> List[bool]: :rtype: list[bool] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1551,7 +1551,7 @@ def get_integer_valid(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1634,7 +1634,7 @@ def put_integer_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1689,7 +1689,7 @@ def get_int_invalid_null(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1736,7 +1736,7 @@ def get_int_invalid_string(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1783,7 +1783,7 @@ def get_long_valid(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1866,7 +1866,7 @@ def put_long_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1921,7 +1921,7 @@ def get_long_invalid_null(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1968,7 +1968,7 @@ def get_long_invalid_string(self, **kwargs: Any) -> List[int]: :rtype: list[int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2015,7 +2015,7 @@ def get_float_valid(self, **kwargs: Any) -> List[float]: :rtype: list[float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2098,7 +2098,7 @@ def put_float_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2153,7 +2153,7 @@ def get_float_invalid_null(self, **kwargs: Any) -> List[float]: :rtype: list[float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2200,7 +2200,7 @@ def get_float_invalid_string(self, **kwargs: Any) -> List[float]: :rtype: list[float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2247,7 +2247,7 @@ def get_double_valid(self, **kwargs: Any) -> List[float]: :rtype: list[float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2330,7 +2330,7 @@ def put_double_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2385,7 +2385,7 @@ def get_double_invalid_null(self, **kwargs: Any) -> List[float]: :rtype: list[float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2432,7 +2432,7 @@ def get_double_invalid_string(self, **kwargs: Any) -> List[float]: :rtype: list[float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2479,7 +2479,7 @@ def get_string_valid(self, **kwargs: Any) -> List[str]: :rtype: list[str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2562,7 +2562,7 @@ def put_string_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2617,7 +2617,7 @@ def get_enum_valid(self, **kwargs: Any) -> List[Union[str, _models.FooEnum]]: :rtype: list[str or ~vanilla.body.array.models.FooEnum] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2701,7 +2701,7 @@ def put_enum_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2756,7 +2756,7 @@ def get_string_enum_valid(self, **kwargs: Any) -> List[Union[str, _models.Enum0] :rtype: list[str or ~vanilla.body.array.models.Enum0] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2840,7 +2840,7 @@ def put_string_enum_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2895,7 +2895,7 @@ def get_string_with_null(self, **kwargs: Any) -> List[str]: :rtype: list[str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2942,7 +2942,7 @@ def get_string_with_invalid(self, **kwargs: Any) -> List[str]: :rtype: list[str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2990,7 +2990,7 @@ def get_uuid_valid(self, **kwargs: Any) -> List[str]: :rtype: list[str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3076,7 +3076,7 @@ def put_uuid_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3131,7 +3131,7 @@ def get_uuid_invalid_chars(self, **kwargs: Any) -> List[str]: :rtype: list[str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3178,7 +3178,7 @@ def get_date_valid(self, **kwargs: Any) -> List[datetime.date]: :rtype: list[~datetime.date] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3261,7 +3261,7 @@ def put_date_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3316,7 +3316,7 @@ def get_date_invalid_null(self, **kwargs: Any) -> List[datetime.date]: :rtype: list[~datetime.date] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3363,7 +3363,7 @@ def get_date_invalid_chars(self, **kwargs: Any) -> List[datetime.date]: :rtype: list[~datetime.date] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3411,7 +3411,7 @@ def get_date_time_valid(self, **kwargs: Any) -> List[datetime.datetime]: :rtype: list[~datetime.datetime] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3497,7 +3497,7 @@ def put_date_time_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3552,7 +3552,7 @@ def get_date_time_invalid_null(self, **kwargs: Any) -> List[datetime.datetime]: :rtype: list[~datetime.datetime] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3599,7 +3599,7 @@ def get_date_time_invalid_chars(self, **kwargs: Any) -> List[datetime.datetime]: :rtype: list[~datetime.datetime] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3647,7 +3647,7 @@ def get_date_time_rfc1123_valid(self, **kwargs: Any) -> List[datetime.datetime]: :rtype: list[~datetime.datetime] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3733,7 +3733,7 @@ def put_date_time_rfc1123_valid( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3788,7 +3788,7 @@ def get_duration_valid(self, **kwargs: Any) -> List[datetime.timedelta]: :rtype: list[~datetime.timedelta] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3871,7 +3871,7 @@ def put_duration_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3927,7 +3927,7 @@ def get_byte_valid(self, **kwargs: Any) -> List[bytes]: :rtype: list[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4013,7 +4013,7 @@ def put_byte_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4068,7 +4068,7 @@ def get_byte_invalid_null(self, **kwargs: Any) -> List[bytes]: :rtype: list[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4116,7 +4116,7 @@ def get_base64_url(self, **kwargs: Any) -> List[bytes]: :rtype: list[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4163,7 +4163,7 @@ def get_complex_null(self, **kwargs: Any) -> List[_models.Product]: :rtype: list[~vanilla.body.array.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4210,7 +4210,7 @@ def get_complex_empty(self, **kwargs: Any) -> List[_models.Product]: :rtype: list[~vanilla.body.array.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4258,7 +4258,7 @@ def get_complex_item_null(self, **kwargs: Any) -> List[_models.Product]: :rtype: list[~vanilla.body.array.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4306,7 +4306,7 @@ def get_complex_item_empty(self, **kwargs: Any) -> List[_models.Product]: :rtype: list[~vanilla.body.array.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4354,7 +4354,7 @@ def get_complex_valid(self, **kwargs: Any) -> List[_models.Product]: :rtype: list[~vanilla.body.array.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4440,7 +4440,7 @@ def put_complex_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4495,7 +4495,7 @@ def get_array_null(self, **kwargs: Any) -> List[List[str]]: :rtype: list[list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4542,7 +4542,7 @@ def get_array_empty(self, **kwargs: Any) -> List[List[str]]: :rtype: list[list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4589,7 +4589,7 @@ def get_array_item_null(self, **kwargs: Any) -> List[List[str]]: :rtype: list[list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4636,7 +4636,7 @@ def get_array_item_empty(self, **kwargs: Any) -> List[List[str]]: :rtype: list[list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4683,7 +4683,7 @@ def get_array_valid(self, **kwargs: Any) -> List[List[str]]: :rtype: list[list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4766,7 +4766,7 @@ def put_array_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4821,7 +4821,7 @@ def get_dictionary_null(self, **kwargs: Any) -> List[Dict[str, str]]: :rtype: list[dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4868,7 +4868,7 @@ def get_dictionary_empty(self, **kwargs: Any) -> List[Dict[str, str]]: :rtype: list[dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4916,7 +4916,7 @@ def get_dictionary_item_null(self, **kwargs: Any) -> List[Dict[str, str]]: :rtype: list[dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4964,7 +4964,7 @@ def get_dictionary_item_empty(self, **kwargs: Any) -> List[Dict[str, str]]: :rtype: list[dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5012,7 +5012,7 @@ def get_dictionary_valid(self, **kwargs: Any) -> List[Dict[str, str]]: :rtype: list[dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5098,7 +5098,7 @@ def put_dictionary_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBinary/bodybinary/aio/operations/_download_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBinary/bodybinary/aio/operations/_download_operations.py index b216f6ab6b5..a89b43b1149 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBinary/bodybinary/aio/operations/_download_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBinary/bodybinary/aio/operations/_download_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterator, Callable, Dict, Optional, Type, TypeVar +from typing import Any, AsyncIterator, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -61,7 +61,7 @@ async def error_stream(self, **kwargs: Any) -> AsyncIterator[bytes]: :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBinary/bodybinary/aio/operations/_upload_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBinary/bodybinary/aio/operations/_upload_operations.py index 089728539de..770c4de1a17 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBinary/bodybinary/aio/operations/_upload_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBinary/bodybinary/aio/operations/_upload_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -66,7 +66,7 @@ async def file( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -117,7 +117,7 @@ async def binary( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBinary/bodybinary/operations/_download_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBinary/bodybinary/operations/_download_operations.py index be598b602d7..40edcc5dd04 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBinary/bodybinary/operations/_download_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBinary/bodybinary/operations/_download_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterator, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterator, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -79,7 +79,7 @@ def error_stream(self, **kwargs: Any) -> Iterator[bytes]: :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBinary/bodybinary/operations/_upload_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBinary/bodybinary/operations/_upload_operations.py index f8b0ff9e181..8093f7814c2 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBinary/bodybinary/operations/_upload_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBinary/bodybinary/operations/_upload_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -95,7 +95,7 @@ def file(self, file_param: IO[bytes], **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -144,7 +144,7 @@ def binary(self, file_param: IO[bytes], **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBoolean/bodyboolean/aio/operations/_bool_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBoolean/bodyboolean/aio/operations/_bool_operations.py index 98dd0493957..aa516612891 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBoolean/bodyboolean/aio/operations/_bool_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBoolean/bodyboolean/aio/operations/_bool_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -69,7 +69,7 @@ async def get_true(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -116,7 +116,7 @@ async def put_true(self, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +165,7 @@ async def get_false(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -212,7 +212,7 @@ async def put_false(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -261,7 +261,7 @@ async def get_null(self, **kwargs: Any) -> Optional[bool]: :rtype: bool or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -308,7 +308,7 @@ async def get_invalid(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBoolean/bodyboolean/operations/_bool_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBoolean/bodyboolean/operations/_bool_operations.py index 601c4a091f9..af1d6a53033 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBoolean/bodyboolean/operations/_bool_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyBoolean/bodyboolean/operations/_bool_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -157,7 +157,7 @@ def get_true(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -204,7 +204,7 @@ def put_true(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -253,7 +253,7 @@ def get_false(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -300,7 +300,7 @@ def put_false(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -349,7 +349,7 @@ def get_null(self, **kwargs: Any) -> Optional[bool]: :rtype: bool or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -396,7 +396,7 @@ def get_invalid(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyByte/bodybyte/aio/operations/_byte_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyByte/bodybyte/aio/operations/_byte_operations.py index bc083defa5a..487814190c9 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyByte/bodybyte/aio/operations/_byte_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyByte/bodybyte/aio/operations/_byte_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -68,7 +68,7 @@ async def get_null(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -115,7 +115,7 @@ async def get_empty(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -162,7 +162,7 @@ async def get_non_ascii(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -214,7 +214,7 @@ async def put_non_ascii( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -262,7 +262,7 @@ async def get_invalid(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyByte/bodybyte/operations/_byte_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyByte/bodybyte/operations/_byte_operations.py index 8bc2a8b282b..2c80025cc6f 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyByte/bodybyte/operations/_byte_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyByte/bodybyte/operations/_byte_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -138,7 +138,7 @@ def get_null(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -185,7 +185,7 @@ def get_empty(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -232,7 +232,7 @@ def get_non_ascii(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +282,7 @@ def put_non_ascii(self, byte_body: bytes, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -330,7 +330,7 @@ def get_invalid(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyByteWithPackageName/bodybytewithpackagename/aio/operations/_byte_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyByteWithPackageName/bodybytewithpackagename/aio/operations/_byte_operations.py index cb57ae50e81..7c1d010afe6 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyByteWithPackageName/bodybytewithpackagename/aio/operations/_byte_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyByteWithPackageName/bodybytewithpackagename/aio/operations/_byte_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -68,7 +68,7 @@ async def get_null(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -115,7 +115,7 @@ async def get_empty(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -162,7 +162,7 @@ async def get_non_ascii(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -214,7 +214,7 @@ async def put_non_ascii( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -262,7 +262,7 @@ async def get_invalid(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyByteWithPackageName/bodybytewithpackagename/operations/_byte_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyByteWithPackageName/bodybytewithpackagename/operations/_byte_operations.py index 6265e6f9eb6..1836f675e66 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyByteWithPackageName/bodybytewithpackagename/operations/_byte_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyByteWithPackageName/bodybytewithpackagename/operations/_byte_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -138,7 +138,7 @@ def get_null(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -185,7 +185,7 @@ def get_empty(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -232,7 +232,7 @@ def get_non_ascii(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +282,7 @@ def put_non_ascii(self, byte_body: bytes, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -330,7 +330,7 @@ def get_invalid(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_array_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_array_operations.py index 04f754b7055..df90e0294bf 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_array_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_array_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, List, Optional, Type, TypeVar +from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -68,7 +68,7 @@ async def get_valid(self, **kwargs: Any) -> _models.ArrayWrapper: :rtype: ~bodycomplex.models.ArrayWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -119,7 +119,7 @@ async def put_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +168,7 @@ async def get_empty(self, **kwargs: Any) -> _models.ArrayWrapper: :rtype: ~bodycomplex.models.ArrayWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -219,7 +219,7 @@ async def put_empty( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -268,7 +268,7 @@ async def get_not_provided(self, **kwargs: Any) -> _models.ArrayWrapper: :rtype: ~bodycomplex.models.ArrayWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_basic_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_basic_operations.py index c082f2ab325..cf4a0a2255c 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_basic_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_basic_operations.py @@ -70,7 +70,7 @@ async def get_valid(self, **kwargs: Any) -> _models.Basic: :rtype: ~bodycomplex.models.Basic :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -154,7 +154,7 @@ async def put_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -211,7 +211,7 @@ async def get_invalid(self, **kwargs: Any) -> _models.Basic: :rtype: ~bodycomplex.models.Basic :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -258,7 +258,7 @@ async def get_empty(self, **kwargs: Any) -> _models.Basic: :rtype: ~bodycomplex.models.Basic :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -305,7 +305,7 @@ async def get_null(self, **kwargs: Any) -> _models.Basic: :rtype: ~bodycomplex.models.Basic :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -352,7 +352,7 @@ async def get_not_provided(self, **kwargs: Any) -> _models.Basic: :rtype: ~bodycomplex.models.Basic :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_dictionary_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_dictionary_operations.py index f456ddd90ea..cd7e4defe9a 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_dictionary_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_dictionary_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -69,7 +69,7 @@ async def get_valid(self, **kwargs: Any) -> _models.DictionaryWrapper: :rtype: ~bodycomplex.models.DictionaryWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -120,7 +120,7 @@ async def put_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +169,7 @@ async def get_empty(self, **kwargs: Any) -> _models.DictionaryWrapper: :rtype: ~bodycomplex.models.DictionaryWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +220,7 @@ async def put_empty( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -269,7 +269,7 @@ async def get_null(self, **kwargs: Any) -> _models.DictionaryWrapper: :rtype: ~bodycomplex.models.DictionaryWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -316,7 +316,7 @@ async def get_not_provided(self, **kwargs: Any) -> _models.DictionaryWrapper: :rtype: ~bodycomplex.models.DictionaryWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_flattencomplex_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_flattencomplex_operations.py index 7e7386e10dd..621c49749cc 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_flattencomplex_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_flattencomplex_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -61,7 +61,7 @@ async def get_valid(self, **kwargs: Any) -> _models.MyBaseType: :rtype: ~bodycomplex.models.MyBaseType :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_inheritance_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_inheritance_operations.py index 20e03b97f05..a3fb3dd8e67 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_inheritance_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_inheritance_operations.py @@ -63,7 +63,7 @@ async def get_valid(self, **kwargs: Any) -> _models.Siamese: :rtype: ~bodycomplex.models.Siamese :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -153,7 +153,7 @@ async def put_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_polymorphicrecursive_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_polymorphicrecursive_operations.py index 7b2d91b5d2c..d495b866f27 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_polymorphicrecursive_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_polymorphicrecursive_operations.py @@ -63,7 +63,7 @@ async def get_valid(self, **kwargs: Any) -> _models.Fish: :rtype: ~bodycomplex.models.Fish :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -302,7 +302,7 @@ async def put_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_polymorphism_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_polymorphism_operations.py index 0612fdcc65a..f66a197de33 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_polymorphism_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_polymorphism_operations.py @@ -73,7 +73,7 @@ async def get_valid(self, **kwargs: Any) -> _models.Fish: :rtype: ~bodycomplex.models.Fish :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -252,7 +252,7 @@ async def put_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -307,7 +307,7 @@ async def get_dot_syntax(self, **kwargs: Any) -> _models.DotFish: :rtype: ~bodycomplex.models.DotFish :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -356,7 +356,7 @@ async def get_composed_with_discriminator(self, **kwargs: Any) -> _models.DotFis :rtype: ~bodycomplex.models.DotFishMarket :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -405,7 +405,7 @@ async def get_composed_without_discriminator(self, **kwargs: Any) -> _models.Dot :rtype: ~bodycomplex.models.DotFishMarket :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -453,7 +453,7 @@ async def get_complicated(self, **kwargs: Any) -> _models.Salmon: :rtype: ~bodycomplex.models.Salmon :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -539,7 +539,7 @@ async def put_complicated( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -630,7 +630,7 @@ async def put_missing_discriminator( :rtype: ~bodycomplex.models.Salmon :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -806,7 +806,7 @@ async def put_valid_missing_required( # pylint: disable=inconsistent-return-sta :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_primitive_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_primitive_operations.py index 96e9660f005..ef704e8adbe 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_primitive_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_primitive_operations.py @@ -87,7 +87,7 @@ async def get_int(self, **kwargs: Any) -> _models.IntWrapper: :rtype: ~bodycomplex.models.IntWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -171,7 +171,7 @@ async def put_int( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -226,7 +226,7 @@ async def get_long(self, **kwargs: Any) -> _models.LongWrapper: :rtype: ~bodycomplex.models.LongWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -310,7 +310,7 @@ async def put_long( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -365,7 +365,7 @@ async def get_float(self, **kwargs: Any) -> _models.FloatWrapper: :rtype: ~bodycomplex.models.FloatWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -449,7 +449,7 @@ async def put_float( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -504,7 +504,7 @@ async def get_double(self, **kwargs: Any) -> _models.DoubleWrapper: :rtype: ~bodycomplex.models.DoubleWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -591,7 +591,7 @@ async def put_double( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -646,7 +646,7 @@ async def get_bool(self, **kwargs: Any) -> _models.BooleanWrapper: :rtype: ~bodycomplex.models.BooleanWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -730,7 +730,7 @@ async def put_bool( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -785,7 +785,7 @@ async def get_string(self, **kwargs: Any) -> _models.StringWrapper: :rtype: ~bodycomplex.models.StringWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -869,7 +869,7 @@ async def put_string( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -924,7 +924,7 @@ async def get_date(self, **kwargs: Any) -> _models.DateWrapper: :rtype: ~bodycomplex.models.DateWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1008,7 +1008,7 @@ async def put_date( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1063,7 +1063,7 @@ async def get_date_time(self, **kwargs: Any) -> _models.DatetimeWrapper: :rtype: ~bodycomplex.models.DatetimeWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1149,7 +1149,7 @@ async def put_date_time( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1204,7 +1204,7 @@ async def get_date_time_rfc1123(self, **kwargs: Any) -> _models.Datetimerfc1123W :rtype: ~bodycomplex.models.Datetimerfc1123Wrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1290,7 +1290,7 @@ async def put_date_time_rfc1123( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1345,7 +1345,7 @@ async def get_duration(self, **kwargs: Any) -> _models.DurationWrapper: :rtype: ~bodycomplex.models.DurationWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1396,7 +1396,7 @@ async def put_duration( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1445,7 +1445,7 @@ async def get_byte(self, **kwargs: Any) -> _models.ByteWrapper: :rtype: ~bodycomplex.models.ByteWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1496,7 +1496,7 @@ async def put_byte( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_readonlyproperty_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_readonlyproperty_operations.py index 2005b225849..573759f28bd 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_readonlyproperty_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_readonlyproperty_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -62,7 +62,7 @@ async def get_valid(self, **kwargs: Any) -> _models.ReadonlyObj: :rtype: ~bodycomplex.models.ReadonlyObj :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -113,7 +113,7 @@ async def put_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_array_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_array_operations.py index fcc616dc728..f0cd75b0603 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_array_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_array_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, List, Optional, Type, TypeVar +from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, Union from msrest import Serializer @@ -141,7 +141,7 @@ def get_valid(self, **kwargs: Any) -> _models.ArrayWrapper: :rtype: ~bodycomplex.models.ArrayWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -192,7 +192,7 @@ def put_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -241,7 +241,7 @@ def get_empty(self, **kwargs: Any) -> _models.ArrayWrapper: :rtype: ~bodycomplex.models.ArrayWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -292,7 +292,7 @@ def put_empty( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -341,7 +341,7 @@ def get_not_provided(self, **kwargs: Any) -> _models.ArrayWrapper: :rtype: ~bodycomplex.models.ArrayWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_basic_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_basic_operations.py index 42e8c69f3d7..f68c412e23e 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_basic_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_basic_operations.py @@ -158,7 +158,7 @@ def get_valid(self, **kwargs: Any) -> _models.Basic: :rtype: ~bodycomplex.models.Basic :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -242,7 +242,7 @@ def put_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -299,7 +299,7 @@ def get_invalid(self, **kwargs: Any) -> _models.Basic: :rtype: ~bodycomplex.models.Basic :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -346,7 +346,7 @@ def get_empty(self, **kwargs: Any) -> _models.Basic: :rtype: ~bodycomplex.models.Basic :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -393,7 +393,7 @@ def get_null(self, **kwargs: Any) -> _models.Basic: :rtype: ~bodycomplex.models.Basic :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -440,7 +440,7 @@ def get_not_provided(self, **kwargs: Any) -> _models.Basic: :rtype: ~bodycomplex.models.Basic :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_dictionary_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_dictionary_operations.py index cb46112d994..cbf17e90c32 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_dictionary_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_dictionary_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from msrest import Serializer @@ -155,7 +155,7 @@ def get_valid(self, **kwargs: Any) -> _models.DictionaryWrapper: :rtype: ~bodycomplex.models.DictionaryWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -206,7 +206,7 @@ def put_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -255,7 +255,7 @@ def get_empty(self, **kwargs: Any) -> _models.DictionaryWrapper: :rtype: ~bodycomplex.models.DictionaryWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -306,7 +306,7 @@ def put_empty( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -355,7 +355,7 @@ def get_null(self, **kwargs: Any) -> _models.DictionaryWrapper: :rtype: ~bodycomplex.models.DictionaryWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -402,7 +402,7 @@ def get_not_provided(self, **kwargs: Any) -> _models.DictionaryWrapper: :rtype: ~bodycomplex.models.DictionaryWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_flattencomplex_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_flattencomplex_operations.py index 648dc9a8b59..dd032fe264b 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_flattencomplex_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_flattencomplex_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from msrest import Serializer @@ -79,7 +79,7 @@ def get_valid(self, **kwargs: Any) -> _models.MyBaseType: :rtype: ~bodycomplex.models.MyBaseType :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_inheritance_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_inheritance_operations.py index f2db021b368..97b7ff16c88 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_inheritance_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_inheritance_operations.py @@ -97,7 +97,7 @@ def get_valid(self, **kwargs: Any) -> _models.Siamese: :rtype: ~bodycomplex.models.Siamese :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -187,7 +187,7 @@ def put_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_polymorphicrecursive_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_polymorphicrecursive_operations.py index c7a5caf3309..fc079c6e267 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_polymorphicrecursive_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_polymorphicrecursive_operations.py @@ -97,7 +97,7 @@ def get_valid(self, **kwargs: Any) -> _models.Fish: :rtype: ~bodycomplex.models.Fish :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -336,7 +336,7 @@ def put_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_polymorphism_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_polymorphism_operations.py index 1efe26ad282..1ac45c043aa 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_polymorphism_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_polymorphism_operations.py @@ -204,7 +204,7 @@ def get_valid(self, **kwargs: Any) -> _models.Fish: :rtype: ~bodycomplex.models.Fish :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -383,7 +383,7 @@ def put_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -438,7 +438,7 @@ def get_dot_syntax(self, **kwargs: Any) -> _models.DotFish: :rtype: ~bodycomplex.models.DotFish :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -487,7 +487,7 @@ def get_composed_with_discriminator(self, **kwargs: Any) -> _models.DotFishMarke :rtype: ~bodycomplex.models.DotFishMarket :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -536,7 +536,7 @@ def get_composed_without_discriminator(self, **kwargs: Any) -> _models.DotFishMa :rtype: ~bodycomplex.models.DotFishMarket :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -584,7 +584,7 @@ def get_complicated(self, **kwargs: Any) -> _models.Salmon: :rtype: ~bodycomplex.models.Salmon :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -670,7 +670,7 @@ def put_complicated( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -761,7 +761,7 @@ def put_missing_discriminator( :rtype: ~bodycomplex.models.Salmon :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -937,7 +937,7 @@ def put_valid_missing_required( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_primitive_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_primitive_operations.py index aed81de0250..63a71bbe0ad 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_primitive_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_primitive_operations.py @@ -408,7 +408,7 @@ def get_int(self, **kwargs: Any) -> _models.IntWrapper: :rtype: ~bodycomplex.models.IntWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -492,7 +492,7 @@ def put_int( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -547,7 +547,7 @@ def get_long(self, **kwargs: Any) -> _models.LongWrapper: :rtype: ~bodycomplex.models.LongWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -631,7 +631,7 @@ def put_long( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -686,7 +686,7 @@ def get_float(self, **kwargs: Any) -> _models.FloatWrapper: :rtype: ~bodycomplex.models.FloatWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -770,7 +770,7 @@ def put_float( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -825,7 +825,7 @@ def get_double(self, **kwargs: Any) -> _models.DoubleWrapper: :rtype: ~bodycomplex.models.DoubleWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -912,7 +912,7 @@ def put_double( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -967,7 +967,7 @@ def get_bool(self, **kwargs: Any) -> _models.BooleanWrapper: :rtype: ~bodycomplex.models.BooleanWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1051,7 +1051,7 @@ def put_bool( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1106,7 +1106,7 @@ def get_string(self, **kwargs: Any) -> _models.StringWrapper: :rtype: ~bodycomplex.models.StringWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1190,7 +1190,7 @@ def put_string( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1245,7 +1245,7 @@ def get_date(self, **kwargs: Any) -> _models.DateWrapper: :rtype: ~bodycomplex.models.DateWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1329,7 +1329,7 @@ def put_date( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1384,7 +1384,7 @@ def get_date_time(self, **kwargs: Any) -> _models.DatetimeWrapper: :rtype: ~bodycomplex.models.DatetimeWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1470,7 +1470,7 @@ def put_date_time( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1525,7 +1525,7 @@ def get_date_time_rfc1123(self, **kwargs: Any) -> _models.Datetimerfc1123Wrapper :rtype: ~bodycomplex.models.Datetimerfc1123Wrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1611,7 +1611,7 @@ def put_date_time_rfc1123( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1666,7 +1666,7 @@ def get_duration(self, **kwargs: Any) -> _models.DurationWrapper: :rtype: ~bodycomplex.models.DurationWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1717,7 +1717,7 @@ def put_duration( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1766,7 +1766,7 @@ def get_byte(self, **kwargs: Any) -> _models.ByteWrapper: :rtype: ~bodycomplex.models.ByteWrapper :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1817,7 +1817,7 @@ def put_byte( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_readonlyproperty_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_readonlyproperty_operations.py index 8e8cd27c698..d2dda9aebb3 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_readonlyproperty_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyComplex/bodycomplex/operations/_readonlyproperty_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from msrest import Serializer @@ -96,7 +96,7 @@ def get_valid(self, **kwargs: Any) -> _models.ReadonlyObj: :rtype: ~bodycomplex.models.ReadonlyObj :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -147,7 +147,7 @@ def put_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDate/bodydate/aio/operations/_date_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDate/bodydate/aio/operations/_date_operations.py index effe32974c4..25b18b2b20e 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDate/bodydate/aio/operations/_date_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDate/bodydate/aio/operations/_date_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -72,7 +72,7 @@ async def get_null(self, **kwargs: Any) -> Optional[datetime.date]: :rtype: ~datetime.date or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -119,7 +119,7 @@ async def get_invalid_date(self, **kwargs: Any) -> datetime.date: :rtype: ~datetime.date :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -166,7 +166,7 @@ async def get_overflow_date(self, **kwargs: Any) -> datetime.date: :rtype: ~datetime.date :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -213,7 +213,7 @@ async def get_underflow_date(self, **kwargs: Any) -> datetime.date: :rtype: ~datetime.date :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -264,7 +264,7 @@ async def put_max_date( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -312,7 +312,7 @@ async def get_max_date(self, **kwargs: Any) -> datetime.date: :rtype: ~datetime.date :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -363,7 +363,7 @@ async def put_min_date( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -411,7 +411,7 @@ async def get_min_date(self, **kwargs: Any) -> datetime.date: :rtype: ~datetime.date :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDate/bodydate/operations/_date_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDate/bodydate/operations/_date_operations.py index e99808def7e..f0df6f95043 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDate/bodydate/operations/_date_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDate/bodydate/operations/_date_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -184,7 +184,7 @@ def get_null(self, **kwargs: Any) -> Optional[datetime.date]: :rtype: ~datetime.date or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -231,7 +231,7 @@ def get_invalid_date(self, **kwargs: Any) -> datetime.date: :rtype: ~datetime.date :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -278,7 +278,7 @@ def get_overflow_date(self, **kwargs: Any) -> datetime.date: :rtype: ~datetime.date :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +325,7 @@ def get_underflow_date(self, **kwargs: Any) -> datetime.date: :rtype: ~datetime.date :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +376,7 @@ def put_max_date( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -424,7 +424,7 @@ def get_max_date(self, **kwargs: Any) -> datetime.date: :rtype: ~datetime.date :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -475,7 +475,7 @@ def put_min_date( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -523,7 +523,7 @@ def get_min_date(self, **kwargs: Any) -> datetime.date: :rtype: ~datetime.date :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDateTime/bodydatetime/aio/operations/_datetime_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDateTime/bodydatetime/aio/operations/_datetime_operations.py index 35c96e90bcc..be4c1338859 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDateTime/bodydatetime/aio/operations/_datetime_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDateTime/bodydatetime/aio/operations/_datetime_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -86,7 +86,7 @@ async def get_null(self, **kwargs: Any) -> Optional[datetime.datetime]: :rtype: ~datetime.datetime or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -133,7 +133,7 @@ async def get_invalid(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -180,7 +180,7 @@ async def get_overflow(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -227,7 +227,7 @@ async def get_underflow(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -278,7 +278,7 @@ async def put_utc_max_date_time( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +333,7 @@ async def put_utc_max_date_time7_digits( # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -381,7 +381,7 @@ async def get_utc_lowercase_max_date_time(self, **kwargs: Any) -> datetime.datet :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -428,7 +428,7 @@ async def get_utc_uppercase_max_date_time(self, **kwargs: Any) -> datetime.datet :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -478,7 +478,7 @@ async def get_utc_uppercase_max_date_time7_digits(self, **kwargs: Any) -> dateti :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -529,7 +529,7 @@ async def put_local_positive_offset_max_date_time( # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -579,7 +579,7 @@ async def get_local_positive_offset_lowercase_max_date_time( # pylint: disable= :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -628,7 +628,7 @@ async def get_local_positive_offset_uppercase_max_date_time( # pylint: disable= :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -679,7 +679,7 @@ async def put_local_negative_offset_max_date_time( # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -729,7 +729,7 @@ async def get_local_negative_offset_uppercase_max_date_time( # pylint: disable= :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -778,7 +778,7 @@ async def get_local_negative_offset_lowercase_max_date_time( # pylint: disable= :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -829,7 +829,7 @@ async def put_utc_min_date_time( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -877,7 +877,7 @@ async def get_utc_min_date_time(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -928,7 +928,7 @@ async def put_local_positive_offset_min_date_time( # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -976,7 +976,7 @@ async def get_local_positive_offset_min_date_time(self, **kwargs: Any) -> dateti :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1027,7 +1027,7 @@ async def put_local_negative_offset_min_date_time( # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1075,7 +1075,7 @@ async def get_local_negative_offset_min_date_time(self, **kwargs: Any) -> dateti :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1122,7 +1122,7 @@ async def get_local_no_offset_min_date_time(self, **kwargs: Any) -> datetime.dat :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDateTime/bodydatetime/operations/_datetime_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDateTime/bodydatetime/operations/_datetime_operations.py index 9bf539d2da6..d30b393ff1a 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDateTime/bodydatetime/operations/_datetime_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDateTime/bodydatetime/operations/_datetime_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -419,7 +419,7 @@ def get_null(self, **kwargs: Any) -> Optional[datetime.datetime]: :rtype: ~datetime.datetime or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -466,7 +466,7 @@ def get_invalid(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -513,7 +513,7 @@ def get_overflow(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -560,7 +560,7 @@ def get_underflow(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -611,7 +611,7 @@ def put_utc_max_date_time( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -666,7 +666,7 @@ def put_utc_max_date_time7_digits( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -714,7 +714,7 @@ def get_utc_lowercase_max_date_time(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -761,7 +761,7 @@ def get_utc_uppercase_max_date_time(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -811,7 +811,7 @@ def get_utc_uppercase_max_date_time7_digits(self, **kwargs: Any) -> datetime.dat :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -862,7 +862,7 @@ def put_local_positive_offset_max_date_time( # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -912,7 +912,7 @@ def get_local_positive_offset_lowercase_max_date_time( # pylint: disable=name-t :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -961,7 +961,7 @@ def get_local_positive_offset_uppercase_max_date_time( # pylint: disable=name-t :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1012,7 +1012,7 @@ def put_local_negative_offset_max_date_time( # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1062,7 +1062,7 @@ def get_local_negative_offset_uppercase_max_date_time( # pylint: disable=name-t :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1111,7 +1111,7 @@ def get_local_negative_offset_lowercase_max_date_time( # pylint: disable=name-t :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1162,7 +1162,7 @@ def put_utc_min_date_time( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1210,7 +1210,7 @@ def get_utc_min_date_time(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1261,7 +1261,7 @@ def put_local_positive_offset_min_date_time( # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1309,7 +1309,7 @@ def get_local_positive_offset_min_date_time(self, **kwargs: Any) -> datetime.dat :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1360,7 +1360,7 @@ def put_local_negative_offset_min_date_time( # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1408,7 +1408,7 @@ def get_local_negative_offset_min_date_time(self, **kwargs: Any) -> datetime.dat :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1455,7 +1455,7 @@ def get_local_no_offset_min_date_time(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDateTimeRfc1123/bodydatetimerfc1123/aio/operations/_datetimerfc1123_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDateTimeRfc1123/bodydatetimerfc1123/aio/operations/_datetimerfc1123_operations.py index b18050032ff..ae49889a527 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDateTimeRfc1123/bodydatetimerfc1123/aio/operations/_datetimerfc1123_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDateTimeRfc1123/bodydatetimerfc1123/aio/operations/_datetimerfc1123_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -73,7 +73,7 @@ async def get_null(self, **kwargs: Any) -> Optional[datetime.datetime]: :rtype: ~datetime.datetime or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -120,7 +120,7 @@ async def get_invalid(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -167,7 +167,7 @@ async def get_overflow(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -214,7 +214,7 @@ async def get_underflow(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -265,7 +265,7 @@ async def put_utc_max_date_time( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -313,7 +313,7 @@ async def get_utc_lowercase_max_date_time(self, **kwargs: Any) -> datetime.datet :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -360,7 +360,7 @@ async def get_utc_uppercase_max_date_time(self, **kwargs: Any) -> datetime.datet :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -411,7 +411,7 @@ async def put_utc_min_date_time( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -459,7 +459,7 @@ async def get_utc_min_date_time(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDateTimeRfc1123/bodydatetimerfc1123/operations/_datetimerfc1123_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDateTimeRfc1123/bodydatetimerfc1123/operations/_datetimerfc1123_operations.py index cad7162b770..8ed3b55dadb 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDateTimeRfc1123/bodydatetimerfc1123/operations/_datetimerfc1123_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDateTimeRfc1123/bodydatetimerfc1123/operations/_datetimerfc1123_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -198,7 +198,7 @@ def get_null(self, **kwargs: Any) -> Optional[datetime.datetime]: :rtype: ~datetime.datetime or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -245,7 +245,7 @@ def get_invalid(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -292,7 +292,7 @@ def get_overflow(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -339,7 +339,7 @@ def get_underflow(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -390,7 +390,7 @@ def put_utc_max_date_time( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -438,7 +438,7 @@ def get_utc_lowercase_max_date_time(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -485,7 +485,7 @@ def get_utc_uppercase_max_date_time(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -536,7 +536,7 @@ def put_utc_min_date_time( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -584,7 +584,7 @@ def get_utc_min_date_time(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDictionary/bodydictionary/aio/operations/_dictionary_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDictionary/bodydictionary/aio/operations/_dictionary_operations.py index bffd52227b3..aa39d76214c 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDictionary/bodydictionary/aio/operations/_dictionary_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDictionary/bodydictionary/aio/operations/_dictionary_operations.py @@ -130,7 +130,7 @@ async def get_null(self, **kwargs: Any) -> Dict[str, int]: :rtype: dict[str, int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -177,7 +177,7 @@ async def get_empty(self, **kwargs: Any) -> Dict[str, int]: :rtype: dict[str, int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -260,7 +260,7 @@ async def put_empty( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -315,7 +315,7 @@ async def get_null_value(self, **kwargs: Any) -> Dict[str, str]: :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -362,7 +362,7 @@ async def get_null_key(self, **kwargs: Any) -> Dict[str, str]: :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -409,7 +409,7 @@ async def get_empty_string_key(self, **kwargs: Any) -> Dict[str, str]: :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -456,7 +456,7 @@ async def get_invalid(self, **kwargs: Any) -> Dict[str, str]: :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -503,7 +503,7 @@ async def get_boolean_tfft(self, **kwargs: Any) -> Dict[str, bool]: :rtype: dict[str, bool] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -586,7 +586,7 @@ async def put_boolean_tfft( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -641,7 +641,7 @@ async def get_boolean_invalid_null(self, **kwargs: Any) -> Dict[str, bool]: :rtype: dict[str, bool] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -688,7 +688,7 @@ async def get_boolean_invalid_string(self, **kwargs: Any) -> Dict[str, bool]: :rtype: dict[str, bool] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -735,7 +735,7 @@ async def get_integer_valid(self, **kwargs: Any) -> Dict[str, int]: :rtype: dict[str, int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -818,7 +818,7 @@ async def put_integer_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -873,7 +873,7 @@ async def get_int_invalid_null(self, **kwargs: Any) -> Dict[str, int]: :rtype: dict[str, int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -920,7 +920,7 @@ async def get_int_invalid_string(self, **kwargs: Any) -> Dict[str, int]: :rtype: dict[str, int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -967,7 +967,7 @@ async def get_long_valid(self, **kwargs: Any) -> Dict[str, int]: :rtype: dict[str, int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1050,7 +1050,7 @@ async def put_long_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1105,7 +1105,7 @@ async def get_long_invalid_null(self, **kwargs: Any) -> Dict[str, int]: :rtype: dict[str, int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1152,7 +1152,7 @@ async def get_long_invalid_string(self, **kwargs: Any) -> Dict[str, int]: :rtype: dict[str, int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1199,7 +1199,7 @@ async def get_float_valid(self, **kwargs: Any) -> Dict[str, float]: :rtype: dict[str, float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1282,7 +1282,7 @@ async def put_float_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1337,7 +1337,7 @@ async def get_float_invalid_null(self, **kwargs: Any) -> Dict[str, float]: :rtype: dict[str, float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1384,7 +1384,7 @@ async def get_float_invalid_string(self, **kwargs: Any) -> Dict[str, float]: :rtype: dict[str, float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1431,7 +1431,7 @@ async def get_double_valid(self, **kwargs: Any) -> Dict[str, float]: :rtype: dict[str, float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1514,7 +1514,7 @@ async def put_double_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1569,7 +1569,7 @@ async def get_double_invalid_null(self, **kwargs: Any) -> Dict[str, float]: :rtype: dict[str, float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1616,7 +1616,7 @@ async def get_double_invalid_string(self, **kwargs: Any) -> Dict[str, float]: :rtype: dict[str, float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1663,7 +1663,7 @@ async def get_string_valid(self, **kwargs: Any) -> Dict[str, str]: :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1746,7 +1746,7 @@ async def put_string_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1801,7 +1801,7 @@ async def get_string_with_null(self, **kwargs: Any) -> Dict[str, str]: :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1848,7 +1848,7 @@ async def get_string_with_invalid(self, **kwargs: Any) -> Dict[str, str]: :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1895,7 +1895,7 @@ async def get_date_valid(self, **kwargs: Any) -> Dict[str, datetime.date]: :rtype: dict[str, ~datetime.date] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1978,7 +1978,7 @@ async def put_date_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2033,7 +2033,7 @@ async def get_date_invalid_null(self, **kwargs: Any) -> Dict[str, datetime.date] :rtype: dict[str, ~datetime.date] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2080,7 +2080,7 @@ async def get_date_invalid_chars(self, **kwargs: Any) -> Dict[str, datetime.date :rtype: dict[str, ~datetime.date] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2128,7 +2128,7 @@ async def get_date_time_valid(self, **kwargs: Any) -> Dict[str, datetime.datetim :rtype: dict[str, ~datetime.datetime] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2214,7 +2214,7 @@ async def put_date_time_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2269,7 +2269,7 @@ async def get_date_time_invalid_null(self, **kwargs: Any) -> Dict[str, datetime. :rtype: dict[str, ~datetime.datetime] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2316,7 +2316,7 @@ async def get_date_time_invalid_chars(self, **kwargs: Any) -> Dict[str, datetime :rtype: dict[str, ~datetime.datetime] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2364,7 +2364,7 @@ async def get_date_time_rfc1123_valid(self, **kwargs: Any) -> Dict[str, datetime :rtype: dict[str, ~datetime.datetime] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2450,7 +2450,7 @@ async def put_date_time_rfc1123_valid( # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2505,7 +2505,7 @@ async def get_duration_valid(self, **kwargs: Any) -> Dict[str, datetime.timedelt :rtype: dict[str, ~datetime.timedelta] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2588,7 +2588,7 @@ async def put_duration_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2644,7 +2644,7 @@ async def get_byte_valid(self, **kwargs: Any) -> Dict[str, bytes]: :rtype: dict[str, bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2730,7 +2730,7 @@ async def put_byte_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2786,7 +2786,7 @@ async def get_byte_invalid_null(self, **kwargs: Any) -> Dict[str, bytes]: :rtype: dict[str, bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2834,7 +2834,7 @@ async def get_base64_url(self, **kwargs: Any) -> Dict[str, bytes]: :rtype: dict[str, bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2881,7 +2881,7 @@ async def get_complex_null(self, **kwargs: Any) -> Optional[Dict[str, _models.Wi :rtype: dict[str, ~bodydictionary.models.Widget] or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2928,7 +2928,7 @@ async def get_complex_empty(self, **kwargs: Any) -> Dict[str, _models.Widget]: :rtype: dict[str, ~bodydictionary.models.Widget] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2976,7 +2976,7 @@ async def get_complex_item_null(self, **kwargs: Any) -> Dict[str, _models.Widget :rtype: dict[str, ~bodydictionary.models.Widget] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3024,7 +3024,7 @@ async def get_complex_item_empty(self, **kwargs: Any) -> Dict[str, _models.Widge :rtype: dict[str, ~bodydictionary.models.Widget] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3072,7 +3072,7 @@ async def get_complex_valid(self, **kwargs: Any) -> Dict[str, _models.Widget]: :rtype: dict[str, ~bodydictionary.models.Widget] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3158,7 +3158,7 @@ async def put_complex_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3213,7 +3213,7 @@ async def get_array_null(self, **kwargs: Any) -> Optional[Dict[str, List[str]]]: :rtype: dict[str, list[str]] or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3260,7 +3260,7 @@ async def get_array_empty(self, **kwargs: Any) -> Dict[str, List[str]]: :rtype: dict[str, list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3307,7 +3307,7 @@ async def get_array_item_null(self, **kwargs: Any) -> Dict[str, List[str]]: :rtype: dict[str, list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3354,7 +3354,7 @@ async def get_array_item_empty(self, **kwargs: Any) -> Dict[str, List[str]]: :rtype: dict[str, list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3402,7 +3402,7 @@ async def get_array_valid(self, **kwargs: Any) -> Dict[str, List[str]]: :rtype: dict[str, list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3488,7 +3488,7 @@ async def put_array_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3543,7 +3543,7 @@ async def get_dictionary_null(self, **kwargs: Any) -> Dict[str, Dict[str, str]]: :rtype: dict[str, dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3590,7 +3590,7 @@ async def get_dictionary_empty(self, **kwargs: Any) -> Dict[str, Dict[str, str]] :rtype: dict[str, dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3638,7 +3638,7 @@ async def get_dictionary_item_null(self, **kwargs: Any) -> Dict[str, Dict[str, s :rtype: dict[str, dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3686,7 +3686,7 @@ async def get_dictionary_item_empty(self, **kwargs: Any) -> Dict[str, Dict[str, :rtype: dict[str, dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3735,7 +3735,7 @@ async def get_dictionary_valid(self, **kwargs: Any) -> Dict[str, Dict[str, str]] :rtype: dict[str, dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3824,7 +3824,7 @@ async def put_dictionary_valid( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDictionary/bodydictionary/operations/_dictionary_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDictionary/bodydictionary/operations/_dictionary_operations.py index 6279400fe82..67f5b228d77 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDictionary/bodydictionary/operations/_dictionary_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDictionary/bodydictionary/operations/_dictionary_operations.py @@ -1022,7 +1022,7 @@ def get_null(self, **kwargs: Any) -> Dict[str, int]: :rtype: dict[str, int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1069,7 +1069,7 @@ def get_empty(self, **kwargs: Any) -> Dict[str, int]: :rtype: dict[str, int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1152,7 +1152,7 @@ def put_empty( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1207,7 +1207,7 @@ def get_null_value(self, **kwargs: Any) -> Dict[str, str]: :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1254,7 +1254,7 @@ def get_null_key(self, **kwargs: Any) -> Dict[str, str]: :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1301,7 +1301,7 @@ def get_empty_string_key(self, **kwargs: Any) -> Dict[str, str]: :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1348,7 +1348,7 @@ def get_invalid(self, **kwargs: Any) -> Dict[str, str]: :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1395,7 +1395,7 @@ def get_boolean_tfft(self, **kwargs: Any) -> Dict[str, bool]: :rtype: dict[str, bool] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1478,7 +1478,7 @@ def put_boolean_tfft( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1533,7 +1533,7 @@ def get_boolean_invalid_null(self, **kwargs: Any) -> Dict[str, bool]: :rtype: dict[str, bool] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1580,7 +1580,7 @@ def get_boolean_invalid_string(self, **kwargs: Any) -> Dict[str, bool]: :rtype: dict[str, bool] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1627,7 +1627,7 @@ def get_integer_valid(self, **kwargs: Any) -> Dict[str, int]: :rtype: dict[str, int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1710,7 +1710,7 @@ def put_integer_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1765,7 +1765,7 @@ def get_int_invalid_null(self, **kwargs: Any) -> Dict[str, int]: :rtype: dict[str, int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1812,7 +1812,7 @@ def get_int_invalid_string(self, **kwargs: Any) -> Dict[str, int]: :rtype: dict[str, int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1859,7 +1859,7 @@ def get_long_valid(self, **kwargs: Any) -> Dict[str, int]: :rtype: dict[str, int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1942,7 +1942,7 @@ def put_long_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1997,7 +1997,7 @@ def get_long_invalid_null(self, **kwargs: Any) -> Dict[str, int]: :rtype: dict[str, int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2044,7 +2044,7 @@ def get_long_invalid_string(self, **kwargs: Any) -> Dict[str, int]: :rtype: dict[str, int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2091,7 +2091,7 @@ def get_float_valid(self, **kwargs: Any) -> Dict[str, float]: :rtype: dict[str, float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2174,7 +2174,7 @@ def put_float_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2229,7 +2229,7 @@ def get_float_invalid_null(self, **kwargs: Any) -> Dict[str, float]: :rtype: dict[str, float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2276,7 +2276,7 @@ def get_float_invalid_string(self, **kwargs: Any) -> Dict[str, float]: :rtype: dict[str, float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2323,7 +2323,7 @@ def get_double_valid(self, **kwargs: Any) -> Dict[str, float]: :rtype: dict[str, float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2406,7 +2406,7 @@ def put_double_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2461,7 +2461,7 @@ def get_double_invalid_null(self, **kwargs: Any) -> Dict[str, float]: :rtype: dict[str, float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2508,7 +2508,7 @@ def get_double_invalid_string(self, **kwargs: Any) -> Dict[str, float]: :rtype: dict[str, float] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2555,7 +2555,7 @@ def get_string_valid(self, **kwargs: Any) -> Dict[str, str]: :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2638,7 +2638,7 @@ def put_string_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2693,7 +2693,7 @@ def get_string_with_null(self, **kwargs: Any) -> Dict[str, str]: :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2740,7 +2740,7 @@ def get_string_with_invalid(self, **kwargs: Any) -> Dict[str, str]: :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2787,7 +2787,7 @@ def get_date_valid(self, **kwargs: Any) -> Dict[str, datetime.date]: :rtype: dict[str, ~datetime.date] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2870,7 +2870,7 @@ def put_date_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2925,7 +2925,7 @@ def get_date_invalid_null(self, **kwargs: Any) -> Dict[str, datetime.date]: :rtype: dict[str, ~datetime.date] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2972,7 +2972,7 @@ def get_date_invalid_chars(self, **kwargs: Any) -> Dict[str, datetime.date]: :rtype: dict[str, ~datetime.date] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3020,7 +3020,7 @@ def get_date_time_valid(self, **kwargs: Any) -> Dict[str, datetime.datetime]: :rtype: dict[str, ~datetime.datetime] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3106,7 +3106,7 @@ def put_date_time_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3161,7 +3161,7 @@ def get_date_time_invalid_null(self, **kwargs: Any) -> Dict[str, datetime.dateti :rtype: dict[str, ~datetime.datetime] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3208,7 +3208,7 @@ def get_date_time_invalid_chars(self, **kwargs: Any) -> Dict[str, datetime.datet :rtype: dict[str, ~datetime.datetime] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3256,7 +3256,7 @@ def get_date_time_rfc1123_valid(self, **kwargs: Any) -> Dict[str, datetime.datet :rtype: dict[str, ~datetime.datetime] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3342,7 +3342,7 @@ def put_date_time_rfc1123_valid( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3397,7 +3397,7 @@ def get_duration_valid(self, **kwargs: Any) -> Dict[str, datetime.timedelta]: :rtype: dict[str, ~datetime.timedelta] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3480,7 +3480,7 @@ def put_duration_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3536,7 +3536,7 @@ def get_byte_valid(self, **kwargs: Any) -> Dict[str, bytes]: :rtype: dict[str, bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3622,7 +3622,7 @@ def put_byte_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3678,7 +3678,7 @@ def get_byte_invalid_null(self, **kwargs: Any) -> Dict[str, bytes]: :rtype: dict[str, bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3726,7 +3726,7 @@ def get_base64_url(self, **kwargs: Any) -> Dict[str, bytes]: :rtype: dict[str, bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3773,7 +3773,7 @@ def get_complex_null(self, **kwargs: Any) -> Optional[Dict[str, _models.Widget]] :rtype: dict[str, ~bodydictionary.models.Widget] or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3820,7 +3820,7 @@ def get_complex_empty(self, **kwargs: Any) -> Dict[str, _models.Widget]: :rtype: dict[str, ~bodydictionary.models.Widget] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3868,7 +3868,7 @@ def get_complex_item_null(self, **kwargs: Any) -> Dict[str, _models.Widget]: :rtype: dict[str, ~bodydictionary.models.Widget] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3916,7 +3916,7 @@ def get_complex_item_empty(self, **kwargs: Any) -> Dict[str, _models.Widget]: :rtype: dict[str, ~bodydictionary.models.Widget] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3964,7 +3964,7 @@ def get_complex_valid(self, **kwargs: Any) -> Dict[str, _models.Widget]: :rtype: dict[str, ~bodydictionary.models.Widget] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4050,7 +4050,7 @@ def put_complex_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4105,7 +4105,7 @@ def get_array_null(self, **kwargs: Any) -> Optional[Dict[str, List[str]]]: :rtype: dict[str, list[str]] or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4152,7 +4152,7 @@ def get_array_empty(self, **kwargs: Any) -> Dict[str, List[str]]: :rtype: dict[str, list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4199,7 +4199,7 @@ def get_array_item_null(self, **kwargs: Any) -> Dict[str, List[str]]: :rtype: dict[str, list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4246,7 +4246,7 @@ def get_array_item_empty(self, **kwargs: Any) -> Dict[str, List[str]]: :rtype: dict[str, list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4294,7 +4294,7 @@ def get_array_valid(self, **kwargs: Any) -> Dict[str, List[str]]: :rtype: dict[str, list[str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4380,7 +4380,7 @@ def put_array_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4435,7 +4435,7 @@ def get_dictionary_null(self, **kwargs: Any) -> Dict[str, Dict[str, str]]: :rtype: dict[str, dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4482,7 +4482,7 @@ def get_dictionary_empty(self, **kwargs: Any) -> Dict[str, Dict[str, str]]: :rtype: dict[str, dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4530,7 +4530,7 @@ def get_dictionary_item_null(self, **kwargs: Any) -> Dict[str, Dict[str, str]]: :rtype: dict[str, dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4578,7 +4578,7 @@ def get_dictionary_item_empty(self, **kwargs: Any) -> Dict[str, Dict[str, str]]: :rtype: dict[str, dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4627,7 +4627,7 @@ def get_dictionary_valid(self, **kwargs: Any) -> Dict[str, Dict[str, str]]: :rtype: dict[str, dict[str, str]] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4716,7 +4716,7 @@ def put_dictionary_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDuration/bodyduration/aio/operations/_duration_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDuration/bodyduration/aio/operations/_duration_operations.py index 5a6fdc953fd..e1c3159f3f3 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDuration/bodyduration/aio/operations/_duration_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDuration/bodyduration/aio/operations/_duration_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -68,7 +68,7 @@ async def get_null(self, **kwargs: Any) -> Optional[datetime.timedelta]: :rtype: ~datetime.timedelta or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -119,7 +119,7 @@ async def put_positive_duration( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -167,7 +167,7 @@ async def get_positive_duration(self, **kwargs: Any) -> datetime.timedelta: :rtype: ~datetime.timedelta :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -214,7 +214,7 @@ async def get_invalid(self, **kwargs: Any) -> datetime.timedelta: :rtype: ~datetime.timedelta :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDuration/bodyduration/operations/_duration_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDuration/bodyduration/operations/_duration_operations.py index 97fec1d0745..3856c5f6441 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDuration/bodyduration/operations/_duration_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyDuration/bodyduration/operations/_duration_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -125,7 +125,7 @@ def get_null(self, **kwargs: Any) -> Optional[datetime.timedelta]: :rtype: ~datetime.timedelta or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -176,7 +176,7 @@ def put_positive_duration( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -224,7 +224,7 @@ def get_positive_duration(self, **kwargs: Any) -> datetime.timedelta: :rtype: ~datetime.timedelta :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -271,7 +271,7 @@ def get_invalid(self, **kwargs: Any) -> datetime.timedelta: :rtype: ~datetime.timedelta :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFile/bodyfile/aio/operations/_files_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFile/bodyfile/aio/operations/_files_operations.py index c270ce7e214..dba12f7900d 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFile/bodyfile/aio/operations/_files_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFile/bodyfile/aio/operations/_files_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterator, Callable, Dict, Optional, Type, TypeVar +from typing import Any, AsyncIterator, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -65,7 +65,7 @@ async def get_file(self, **kwargs: Any) -> AsyncIterator[bytes]: :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -112,7 +112,7 @@ async def get_file_large(self, **kwargs: Any) -> AsyncIterator[bytes]: :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -159,7 +159,7 @@ async def get_empty_file(self, **kwargs: Any) -> AsyncIterator[bytes]: :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFile/bodyfile/operations/_files_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFile/bodyfile/operations/_files_operations.py index 4bd2c99d2be..335a0db7eb3 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFile/bodyfile/operations/_files_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFile/bodyfile/operations/_files_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterator, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterator, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -107,7 +107,7 @@ def get_file(self, **kwargs: Any) -> Iterator[bytes]: :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -154,7 +154,7 @@ def get_file_large(self, **kwargs: Any) -> Iterator[bytes]: :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -201,7 +201,7 @@ def get_empty_file(self, **kwargs: Any) -> Iterator[bytes]: :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFormData/bodyformdata/aio/operations/_formdata_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFormData/bodyformdata/aio/operations/_formdata_operations.py index 89347b894c9..4b15553584e 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFormData/bodyformdata/aio/operations/_formdata_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFormData/bodyformdata/aio/operations/_formdata_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterator, Callable, Dict, IO, List, Optional, Type, TypeVar +from typing import Any, AsyncIterator, Callable, Dict, IO, List, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -71,7 +71,7 @@ async def upload_file(self, file_content: IO[bytes], file_name: str, **kwargs: A :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -129,7 +129,7 @@ async def upload_file_via_body(self, file_content: IO[bytes], **kwargs: Any) -> :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -183,7 +183,7 @@ async def upload_files(self, file_content: List[IO[bytes]], **kwargs: Any) -> As :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFormData/bodyformdata/operations/_formdata_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFormData/bodyformdata/operations/_formdata_operations.py index 78b62c77516..a2a4ab92bfd 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFormData/bodyformdata/operations/_formdata_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFormData/bodyformdata/operations/_formdata_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, IO, Iterator, List, Optional, Type, TypeVar +from typing import Any, Callable, Dict, IO, Iterator, List, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -117,7 +117,7 @@ def upload_file(self, file_content: IO[bytes], file_name: str, **kwargs: Any) -> :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -175,7 +175,7 @@ def upload_file_via_body(self, file_content: IO[bytes], **kwargs: Any) -> Iterat :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -229,7 +229,7 @@ def upload_files(self, file_content: List[IO[bytes]], **kwargs: Any) -> Iterator :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFormUrlEncodedData/bodyformurlencodeddata/aio/operations/_formdataurlencoded_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFormUrlEncodedData/bodyformurlencodeddata/aio/operations/_formdataurlencoded_operations.py index 992d73a395e..596efb2ede0 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFormUrlEncodedData/bodyformurlencodeddata/aio/operations/_formdataurlencoded_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFormUrlEncodedData/bodyformurlencodeddata/aio/operations/_formdataurlencoded_operations.py @@ -90,7 +90,7 @@ async def update_pet_with_form( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -155,7 +155,7 @@ async def partial_constant_body( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFormUrlEncodedData/bodyformurlencodeddata/operations/_formdataurlencoded_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFormUrlEncodedData/bodyformurlencodeddata/operations/_formdataurlencoded_operations.py index 87ab98c293b..ebb5ad2aa48 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFormUrlEncodedData/bodyformurlencodeddata/operations/_formdataurlencoded_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyFormUrlEncodedData/bodyformurlencodeddata/operations/_formdataurlencoded_operations.py @@ -115,7 +115,7 @@ def update_pet_with_form( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -180,7 +180,7 @@ def partial_constant_body( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyInteger/bodyinteger/aio/operations/_int_operations_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyInteger/bodyinteger/aio/operations/_int_operations_operations.py index 37829f7ab55..b6cd992f531 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyInteger/bodyinteger/aio/operations/_int_operations_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyInteger/bodyinteger/aio/operations/_int_operations_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -78,7 +78,7 @@ async def get_null(self, **kwargs: Any) -> Optional[int]: :rtype: int or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -125,7 +125,7 @@ async def get_invalid(self, **kwargs: Any) -> int: :rtype: int :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +172,7 @@ async def get_overflow_int32(self, **kwargs: Any) -> int: :rtype: int :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -219,7 +219,7 @@ async def get_underflow_int32(self, **kwargs: Any) -> int: :rtype: int :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -266,7 +266,7 @@ async def get_overflow_int64(self, **kwargs: Any) -> int: :rtype: int :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -313,7 +313,7 @@ async def get_underflow_int64(self, **kwargs: Any) -> int: :rtype: int :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -362,7 +362,7 @@ async def put_max32(self, int_body: int, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -412,7 +412,7 @@ async def put_max64(self, int_body: int, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +462,7 @@ async def put_min32(self, int_body: int, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -512,7 +512,7 @@ async def put_min64(self, int_body: int, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -560,7 +560,7 @@ async def get_unix_time(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -611,7 +611,7 @@ async def put_unix_time_date( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -659,7 +659,7 @@ async def get_invalid_unix_time(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -706,7 +706,7 @@ async def get_null_unix_time(self, **kwargs: Any) -> Optional[datetime.datetime] :rtype: ~datetime.datetime or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyInteger/bodyinteger/operations/_int_operations_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyInteger/bodyinteger/operations/_int_operations_operations.py index ad9efa9e143..4e33f40e303 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyInteger/bodyinteger/operations/_int_operations_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyInteger/bodyinteger/operations/_int_operations_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -277,7 +277,7 @@ def get_null(self, **kwargs: Any) -> Optional[int]: :rtype: int or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -324,7 +324,7 @@ def get_invalid(self, **kwargs: Any) -> int: :rtype: int :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -371,7 +371,7 @@ def get_overflow_int32(self, **kwargs: Any) -> int: :rtype: int :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -418,7 +418,7 @@ def get_underflow_int32(self, **kwargs: Any) -> int: :rtype: int :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -465,7 +465,7 @@ def get_overflow_int64(self, **kwargs: Any) -> int: :rtype: int :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -512,7 +512,7 @@ def get_underflow_int64(self, **kwargs: Any) -> int: :rtype: int :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -561,7 +561,7 @@ def put_max32(self, int_body: int, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -611,7 +611,7 @@ def put_max64(self, int_body: int, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -661,7 +661,7 @@ def put_min32(self, int_body: int, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -711,7 +711,7 @@ def put_min64(self, int_body: int, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -759,7 +759,7 @@ def get_unix_time(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -810,7 +810,7 @@ def put_unix_time_date( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -858,7 +858,7 @@ def get_invalid_unix_time(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -905,7 +905,7 @@ def get_null_unix_time(self, **kwargs: Any) -> Optional[datetime.datetime]: :rtype: ~datetime.datetime or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyNumber/bodynumber/aio/operations/_number_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyNumber/bodynumber/aio/operations/_number_operations.py index 1c9d563dc9c..bb68343e074 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyNumber/bodynumber/aio/operations/_number_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyNumber/bodynumber/aio/operations/_number_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -87,7 +87,7 @@ async def get_null(self, **kwargs: Any) -> Optional[float]: :rtype: float or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -134,7 +134,7 @@ async def get_invalid_float(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -181,7 +181,7 @@ async def get_invalid_double(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -228,7 +228,7 @@ async def get_invalid_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -279,7 +279,7 @@ async def put_big_float( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -327,7 +327,7 @@ async def get_big_float(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +378,7 @@ async def put_big_double( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -426,7 +426,7 @@ async def get_big_double(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -475,7 +475,7 @@ async def put_big_double_positive_decimal( # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -524,7 +524,7 @@ async def get_big_double_positive_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -573,7 +573,7 @@ async def put_big_double_negative_decimal( # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -622,7 +622,7 @@ async def get_big_double_negative_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -673,7 +673,7 @@ async def put_big_decimal( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -721,7 +721,7 @@ async def get_big_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -770,7 +770,7 @@ async def put_big_decimal_positive_decimal( # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -819,7 +819,7 @@ async def get_big_decimal_positive_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -868,7 +868,7 @@ async def put_big_decimal_negative_decimal( # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -917,7 +917,7 @@ async def get_big_decimal_negative_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -968,7 +968,7 @@ async def put_small_float( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1016,7 +1016,7 @@ async def get_small_float(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1067,7 +1067,7 @@ async def put_small_double( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1115,7 +1115,7 @@ async def get_small_double(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1166,7 +1166,7 @@ async def put_small_decimal( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1214,7 +1214,7 @@ async def get_small_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyNumber/bodynumber/operations/_number_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyNumber/bodynumber/operations/_number_operations.py index 439a2b0755b..542685ca26b 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyNumber/bodynumber/operations/_number_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyNumber/bodynumber/operations/_number_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -435,7 +435,7 @@ def get_null(self, **kwargs: Any) -> Optional[float]: :rtype: float or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -482,7 +482,7 @@ def get_invalid_float(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -529,7 +529,7 @@ def get_invalid_double(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -576,7 +576,7 @@ def get_invalid_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -627,7 +627,7 @@ def put_big_float( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -675,7 +675,7 @@ def get_big_float(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -726,7 +726,7 @@ def put_big_double( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -774,7 +774,7 @@ def get_big_double(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -821,7 +821,7 @@ def put_big_double_positive_decimal(self, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -870,7 +870,7 @@ def get_big_double_positive_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -917,7 +917,7 @@ def put_big_double_negative_decimal(self, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -966,7 +966,7 @@ def get_big_double_negative_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1017,7 +1017,7 @@ def put_big_decimal( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1065,7 +1065,7 @@ def get_big_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1112,7 +1112,7 @@ def put_big_decimal_positive_decimal(self, **kwargs: Any) -> None: # pylint: di :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1161,7 +1161,7 @@ def get_big_decimal_positive_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1208,7 +1208,7 @@ def put_big_decimal_negative_decimal(self, **kwargs: Any) -> None: # pylint: di :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1257,7 +1257,7 @@ def get_big_decimal_negative_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1308,7 +1308,7 @@ def put_small_float( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1356,7 +1356,7 @@ def get_small_float(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1407,7 +1407,7 @@ def put_small_double( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1455,7 +1455,7 @@ def get_small_double(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1506,7 +1506,7 @@ def put_small_decimal( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1554,7 +1554,7 @@ def get_small_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyString/bodystring/aio/operations/_enum_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyString/bodystring/aio/operations/_enum_operations.py index 4d4a8e2758a..2160b49f289 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyString/bodystring/aio/operations/_enum_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyString/bodystring/aio/operations/_enum_operations.py @@ -69,7 +69,7 @@ async def get_not_expandable(self, **kwargs: Any) -> Union[str, _models.Colors]: :rtype: str or ~bodystring.models.Colors :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -121,7 +121,7 @@ async def put_not_expandable( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +169,7 @@ async def get_referenced(self, **kwargs: Any) -> Union[str, _models.Colors]: :rtype: str or ~bodystring.models.Colors :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -221,7 +221,7 @@ async def put_referenced( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -269,7 +269,7 @@ async def get_referenced_constant(self, **kwargs: Any) -> _models.RefColorConsta :rtype: ~bodystring.models.RefColorConstant :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -320,7 +320,7 @@ async def put_referenced_constant( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyString/bodystring/aio/operations/_string_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyString/bodystring/aio/operations/_string_operations.py index a1ee2062b79..ee55a9a5c1a 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyString/bodystring/aio/operations/_string_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyString/bodystring/aio/operations/_string_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -76,7 +76,7 @@ async def get_null(self, **kwargs: Any) -> Optional[str]: :rtype: str or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -127,7 +127,7 @@ async def put_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -178,7 +178,7 @@ async def get_empty(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -225,7 +225,7 @@ async def put_empty(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -274,7 +274,7 @@ async def get_mbcs(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -321,7 +321,7 @@ async def put_mbcs(self, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -374,7 +374,7 @@ async def get_whitespace(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -423,7 +423,7 @@ async def put_whitespace(self, **kwargs: Any) -> None: # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -474,7 +474,7 @@ async def get_not_provided(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -521,7 +521,7 @@ async def get_base64_encoded(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -568,7 +568,7 @@ async def get_base64_url_encoded(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -619,7 +619,7 @@ async def put_base64_url_encoded( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -667,7 +667,7 @@ async def get_null_base64_url_encoded(self, **kwargs: Any) -> Optional[bytes]: :rtype: bytes or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyString/bodystring/operations/_enum_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyString/bodystring/operations/_enum_operations.py index 64d22f7a987..b6c071d576f 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyString/bodystring/operations/_enum_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyString/bodystring/operations/_enum_operations.py @@ -159,7 +159,7 @@ def get_not_expandable(self, **kwargs: Any) -> Union[str, _models.Colors]: :rtype: str or ~bodystring.models.Colors :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -211,7 +211,7 @@ def put_not_expandable( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -259,7 +259,7 @@ def get_referenced(self, **kwargs: Any) -> Union[str, _models.Colors]: :rtype: str or ~bodystring.models.Colors :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -311,7 +311,7 @@ def put_referenced( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -359,7 +359,7 @@ def get_referenced_constant(self, **kwargs: Any) -> _models.RefColorConstant: :rtype: ~bodystring.models.RefColorConstant :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -410,7 +410,7 @@ def put_referenced_constant( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyString/bodystring/operations/_string_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyString/bodystring/operations/_string_operations.py index 283a9e663ac..c6645060a72 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyString/bodystring/operations/_string_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyString/bodystring/operations/_string_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -269,7 +269,7 @@ def get_null(self, **kwargs: Any) -> Optional[str]: :rtype: str or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -320,7 +320,7 @@ def put_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -371,7 +371,7 @@ def get_empty(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -418,7 +418,7 @@ def put_empty(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -467,7 +467,7 @@ def get_mbcs(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -514,7 +514,7 @@ def put_mbcs(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -567,7 +567,7 @@ def get_whitespace(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -616,7 +616,7 @@ def put_whitespace(self, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -667,7 +667,7 @@ def get_not_provided(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -714,7 +714,7 @@ def get_base64_encoded(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -761,7 +761,7 @@ def get_base64_url_encoded(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -812,7 +812,7 @@ def put_base64_url_encoded( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -860,7 +860,7 @@ def get_null_base64_url_encoded(self, **kwargs: Any) -> Optional[bytes]: :rtype: bytes or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyTime/bodytime/aio/operations/_time_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyTime/bodytime/aio/operations/_time_operations.py index 447e5daedd2..94422f8374b 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyTime/bodytime/aio/operations/_time_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyTime/bodytime/aio/operations/_time_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -63,7 +63,7 @@ async def get(self, **kwargs: Any) -> datetime.time: :rtype: ~datetime.time :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -112,7 +112,7 @@ async def put(self, time_body: datetime.time, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyTime/bodytime/operations/_time_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyTime/bodytime/operations/_time_operations.py index 2aa93fd9b29..1f18260f093 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyTime/bodytime/operations/_time_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/BodyTime/bodytime/operations/_time_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -97,7 +97,7 @@ def get(self, **kwargs: Any) -> datetime.time: :rtype: ~datetime.time :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -146,7 +146,7 @@ def put(self, time_body: datetime.time, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ClientEnum/clientenum/aio/operations/_client_with_enum_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ClientEnum/clientenum/aio/operations/_client_with_enum_operations.py index 894e195b1db..9dcdab12547 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ClientEnum/clientenum/aio/operations/_client_with_enum_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ClientEnum/clientenum/aio/operations/_client_with_enum_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -43,7 +43,7 @@ async def head(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ClientEnum/clientenum/operations/_client_with_enum_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ClientEnum/clientenum/operations/_client_with_enum_operations.py index ffe4635b1e7..f3230713804 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ClientEnum/clientenum/operations/_client_with_enum_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ClientEnum/clientenum/operations/_client_with_enum_operations.py @@ -59,7 +59,7 @@ def head(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Constants/constants/aio/operations/_contants_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Constants/constants/aio/operations/_contants_operations.py index db3d8099d93..2d1ff661dda 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Constants/constants/aio/operations/_contants_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Constants/constants/aio/operations/_contants_operations.py @@ -88,7 +88,7 @@ async def put_no_model_as_string_no_required_two_value_no_default( # pylint: di :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -137,7 +137,7 @@ async def put_no_model_as_string_no_required_two_value_default( # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -186,7 +186,7 @@ async def put_no_model_as_string_no_required_one_value_no_default( # pylint: di :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -235,7 +235,7 @@ async def put_no_model_as_string_no_required_one_value_default( # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -284,7 +284,7 @@ async def put_no_model_as_string_required_two_value_no_default( # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +333,7 @@ async def put_no_model_as_string_required_two_value_default( # pylint: disable= :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -380,7 +380,7 @@ async def put_no_model_as_string_required_one_value_no_default( # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -428,7 +428,7 @@ async def put_no_model_as_string_required_one_value_default( # pylint: disable= :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -478,7 +478,7 @@ async def put_model_as_string_no_required_two_value_no_default( # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -527,7 +527,7 @@ async def put_model_as_string_no_required_two_value_default( # pylint: disable= :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -576,7 +576,7 @@ async def put_model_as_string_no_required_one_value_no_default( # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -625,7 +625,7 @@ async def put_model_as_string_no_required_one_value_default( # pylint: disable= :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -674,7 +674,7 @@ async def put_model_as_string_required_two_value_no_default( # pylint: disable= :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -723,7 +723,7 @@ async def put_model_as_string_required_two_value_default( # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -772,7 +772,7 @@ async def put_model_as_string_required_one_value_no_default( # pylint: disable= :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -821,7 +821,7 @@ async def put_model_as_string_required_one_value_default( # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -865,7 +865,7 @@ async def put_client_constants(self, **kwargs: Any) -> None: # pylint: disable= :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Constants/constants/operations/_contants_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Constants/constants/operations/_contants_operations.py index 8e59a3e773a..bc86a6a419f 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Constants/constants/operations/_contants_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Constants/constants/operations/_contants_operations.py @@ -331,7 +331,7 @@ def put_no_model_as_string_no_required_two_value_no_default( # pylint: disable= :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -380,7 +380,7 @@ def put_no_model_as_string_no_required_two_value_default( # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -429,7 +429,7 @@ def put_no_model_as_string_no_required_one_value_no_default( # pylint: disable= :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -478,7 +478,7 @@ def put_no_model_as_string_no_required_one_value_default( # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -527,7 +527,7 @@ def put_no_model_as_string_required_two_value_no_default( # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -576,7 +576,7 @@ def put_no_model_as_string_required_two_value_default( # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -623,7 +623,7 @@ def put_no_model_as_string_required_one_value_no_default( # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -671,7 +671,7 @@ def put_no_model_as_string_required_one_value_default( # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -721,7 +721,7 @@ def put_model_as_string_no_required_two_value_no_default( # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -770,7 +770,7 @@ def put_model_as_string_no_required_two_value_default( # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -819,7 +819,7 @@ def put_model_as_string_no_required_one_value_no_default( # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -868,7 +868,7 @@ def put_model_as_string_no_required_one_value_default( # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -917,7 +917,7 @@ def put_model_as_string_required_two_value_no_default( # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -966,7 +966,7 @@ def put_model_as_string_required_two_value_default( # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1015,7 +1015,7 @@ def put_model_as_string_required_one_value_no_default( # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1064,7 +1064,7 @@ def put_model_as_string_required_one_value_default( # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1108,7 +1108,7 @@ def put_client_constants(self, **kwargs: Any) -> None: # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/aio/operations/_paths_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/aio/operations/_paths_operations.py index 9bc8bf896e1..a87023f8309 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/aio/operations/_paths_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/aio/operations/_paths_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -65,7 +65,7 @@ async def get_empty( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/operations/_paths_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/operations/_paths_operations.py index 470325040a6..266e536d967 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/operations/_paths_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/CustomBaseUri/custombaseurl/operations/_paths_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from msrest import Serializer @@ -81,7 +81,7 @@ def get_empty(self, account_name: str, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/CustomBaseUriMoreOptions/custombaseurlmoreoptions/aio/operations/_paths_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/CustomBaseUriMoreOptions/custombaseurlmoreoptions/aio/operations/_paths_operations.py index 21239a0c989..4b216878fb2 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/CustomBaseUriMoreOptions/custombaseurlmoreoptions/aio/operations/_paths_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/CustomBaseUriMoreOptions/custombaseurlmoreoptions/aio/operations/_paths_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -71,7 +71,7 @@ async def get_empty( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/CustomBaseUriMoreOptions/custombaseurlmoreoptions/operations/_paths_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/CustomBaseUriMoreOptions/custombaseurlmoreoptions/operations/_paths_operations.py index 846b2c27f14..216ad613c68 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/CustomBaseUriMoreOptions/custombaseurlmoreoptions/operations/_paths_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/CustomBaseUriMoreOptions/custombaseurlmoreoptions/operations/_paths_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -102,7 +102,7 @@ def get_empty( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ErrorWithSecrets/errorwithsecrets/aio/operations/_error_with_secrets_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ErrorWithSecrets/errorwithsecrets/aio/operations/_error_with_secrets_operations.py index 89645388b55..877f62e15de 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ErrorWithSecrets/errorwithsecrets/aio/operations/_error_with_secrets_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ErrorWithSecrets/errorwithsecrets/aio/operations/_error_with_secrets_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -47,7 +47,7 @@ async def create_secret(self, **kwargs: Any) -> _models.SecretResponse: :rtype: ~errorwithsecrets.models.SecretResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -94,7 +94,7 @@ async def get_error_with_secrets(self, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ErrorWithSecrets/errorwithsecrets/operations/_error_with_secrets_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ErrorWithSecrets/errorwithsecrets/operations/_error_with_secrets_operations.py index a9e787dea9a..3e9a7173229 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ErrorWithSecrets/errorwithsecrets/operations/_error_with_secrets_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ErrorWithSecrets/errorwithsecrets/operations/_error_with_secrets_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -75,7 +75,7 @@ def create_secret(self, **kwargs: Any) -> _models.SecretResponse: :rtype: ~errorwithsecrets.models.SecretResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -122,7 +122,7 @@ def get_error_with_secrets(self, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ExtensibleEnums/extensibleenumsswagger/aio/operations/_pet_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ExtensibleEnums/extensibleenumsswagger/aio/operations/_pet_operations.py index fc4893d2244..e61c2ba14ee 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ExtensibleEnums/extensibleenumsswagger/aio/operations/_pet_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ExtensibleEnums/extensibleenumsswagger/aio/operations/_pet_operations.py @@ -65,7 +65,7 @@ async def get_by_pet_id(self, pet_id: str, **kwargs: Any) -> _models.Pet: :rtype: ~extensibleenumsswagger.models.Pet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -146,7 +146,7 @@ async def add_pet(self, pet_param: Optional[Union[_models.Pet, IO[bytes]]] = Non :rtype: ~extensibleenumsswagger.models.Pet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ExtensibleEnums/extensibleenumsswagger/operations/_pet_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ExtensibleEnums/extensibleenumsswagger/operations/_pet_operations.py index b76d3d93158..a8c08794ac3 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ExtensibleEnums/extensibleenumsswagger/operations/_pet_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ExtensibleEnums/extensibleenumsswagger/operations/_pet_operations.py @@ -104,7 +104,7 @@ def get_by_pet_id(self, pet_id: str, **kwargs: Any) -> _models.Pet: :rtype: ~extensibleenumsswagger.models.Pet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -185,7 +185,7 @@ def add_pet(self, pet_param: Optional[Union[_models.Pet, IO[bytes]]] = None, **k :rtype: ~extensibleenumsswagger.models.Pet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Header/header/aio/operations/_header_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Header/header/aio/operations/_header_operations.py index 0e05aea8dd6..5969adda62c 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Header/header/aio/operations/_header_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Header/header/aio/operations/_header_operations.py @@ -97,7 +97,7 @@ async def param_existing_key( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -141,7 +141,7 @@ async def response_existing_key(self, **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -187,7 +187,7 @@ async def param_protected_key(self, **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -232,7 +232,7 @@ async def response_protected_key(self, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -286,7 +286,7 @@ async def param_integer( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -336,7 +336,7 @@ async def response_integer( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -391,7 +391,7 @@ async def param_long( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -441,7 +441,7 @@ async def response_long( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -496,7 +496,7 @@ async def param_float( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -546,7 +546,7 @@ async def response_float( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -601,7 +601,7 @@ async def param_double( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -651,7 +651,7 @@ async def response_double( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -706,7 +706,7 @@ async def param_bool( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -756,7 +756,7 @@ async def response_bool( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -812,7 +812,7 @@ async def param_string( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -862,7 +862,7 @@ async def response_string( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -916,7 +916,7 @@ async def param_date( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -965,7 +965,7 @@ async def response_date( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1020,7 +1020,7 @@ async def param_datetime( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1069,7 +1069,7 @@ async def response_datetime( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1124,7 +1124,7 @@ async def param_datetime_rfc1123( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1174,7 +1174,7 @@ async def response_datetime_rfc1123( # pylint: disable=inconsistent-return-stat :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1227,7 +1227,7 @@ async def param_duration( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1276,7 +1276,7 @@ async def response_duration( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1329,7 +1329,7 @@ async def param_byte( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1378,7 +1378,7 @@ async def response_byte( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1434,7 +1434,7 @@ async def param_enum( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1484,7 +1484,7 @@ async def response_enum( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1532,7 +1532,7 @@ async def custom_request_id(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Header/header/operations/_header_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Header/header/operations/_header_operations.py index 2b4adc3891b..411bf8f33cd 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Header/header/operations/_header_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Header/header/operations/_header_operations.py @@ -523,7 +523,7 @@ def param_existing_key( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -567,7 +567,7 @@ def response_existing_key(self, **kwargs: Any) -> None: # pylint: disable=incon :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -613,7 +613,7 @@ def param_protected_key(self, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -658,7 +658,7 @@ def response_protected_key(self, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -712,7 +712,7 @@ def param_integer( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -760,7 +760,7 @@ def response_integer(self, scenario: str, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -815,7 +815,7 @@ def param_long( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -863,7 +863,7 @@ def response_long(self, scenario: str, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -918,7 +918,7 @@ def param_float( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -966,7 +966,7 @@ def response_float(self, scenario: str, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1021,7 +1021,7 @@ def param_double( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1069,7 +1069,7 @@ def response_double(self, scenario: str, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1124,7 +1124,7 @@ def param_bool( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1172,7 +1172,7 @@ def response_bool(self, scenario: str, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1228,7 +1228,7 @@ def param_string( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1276,7 +1276,7 @@ def response_string(self, scenario: str, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1330,7 +1330,7 @@ def param_date( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1377,7 +1377,7 @@ def response_date(self, scenario: str, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1432,7 +1432,7 @@ def param_datetime( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1479,7 +1479,7 @@ def response_datetime(self, scenario: str, **kwargs: Any) -> None: # pylint: di :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1534,7 +1534,7 @@ def param_datetime_rfc1123( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1584,7 +1584,7 @@ def response_datetime_rfc1123( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1637,7 +1637,7 @@ def param_duration( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1684,7 +1684,7 @@ def response_duration(self, scenario: str, **kwargs: Any) -> None: # pylint: di :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1737,7 +1737,7 @@ def param_byte( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1784,7 +1784,7 @@ def response_byte(self, scenario: str, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1840,7 +1840,7 @@ def param_enum( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1888,7 +1888,7 @@ def response_enum(self, scenario: str, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1936,7 +1936,7 @@ def custom_request_id(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_client_failure_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_client_failure_operations.py index 47592529acf..d65b97ad934 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_client_failure_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_client_failure_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -89,7 +89,7 @@ async def head400(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -132,7 +132,7 @@ async def get400(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -175,7 +175,7 @@ async def options400(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -223,7 +223,7 @@ async def put400( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -279,7 +279,7 @@ async def patch400( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -335,7 +335,7 @@ async def post400( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -391,7 +391,7 @@ async def delete400( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -442,7 +442,7 @@ async def head401(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -485,7 +485,7 @@ async def get402(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -528,7 +528,7 @@ async def options403(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -571,7 +571,7 @@ async def get403(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -619,7 +619,7 @@ async def put404( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -675,7 +675,7 @@ async def patch405( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -731,7 +731,7 @@ async def post406( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -787,7 +787,7 @@ async def delete407( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -843,7 +843,7 @@ async def put409( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -894,7 +894,7 @@ async def head410(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -937,7 +937,7 @@ async def get411(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -980,7 +980,7 @@ async def options412(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1023,7 +1023,7 @@ async def get412(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1071,7 +1071,7 @@ async def put413( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1127,7 +1127,7 @@ async def patch414( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1183,7 +1183,7 @@ async def post415( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1234,7 +1234,7 @@ async def get416(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1282,7 +1282,7 @@ async def delete417( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1333,7 +1333,7 @@ async def head429(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_failure_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_failure_operations.py index 7477da622c9..0f82bea07a7 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_failure_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_failure_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -65,7 +65,7 @@ async def get_empty_error(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -112,7 +112,7 @@ async def get_no_model_error(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -158,7 +158,7 @@ async def get_no_model_empty(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_redirects_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_redirects_operations.py index db535692f02..c6c17e5fe65 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_redirects_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_redirects_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, List, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, List, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -79,7 +79,7 @@ async def head300(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -126,7 +126,7 @@ async def get300(self, **kwargs: Any) -> Optional[List[str]]: :rtype: list[str] or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -178,7 +178,7 @@ async def head301(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -225,7 +225,7 @@ async def get301(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -278,7 +278,7 @@ async def put301( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -332,7 +332,7 @@ async def head302(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -379,7 +379,7 @@ async def get302(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -432,7 +432,7 @@ async def patch302( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -492,7 +492,7 @@ async def post303( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -547,7 +547,7 @@ async def head307(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -594,7 +594,7 @@ async def get307(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -641,7 +641,7 @@ async def options307(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -693,7 +693,7 @@ async def put307( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -753,7 +753,7 @@ async def patch307( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -813,7 +813,7 @@ async def post307( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -873,7 +873,7 @@ async def delete307( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_retry_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_retry_operations.py index bf37d0efdbe..f8171ca06b9 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_retry_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_retry_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -72,7 +72,7 @@ async def head408(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -120,7 +120,7 @@ async def put500( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -176,7 +176,7 @@ async def patch500( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -227,7 +227,7 @@ async def get502(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -270,7 +270,7 @@ async def options502(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +322,7 @@ async def post503( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +378,7 @@ async def delete503( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -434,7 +434,7 @@ async def put504( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -490,7 +490,7 @@ async def patch504( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_server_failure_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_server_failure_operations.py index 09e7fd5758d..5fd76e8365d 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_server_failure_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_server_failure_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -67,7 +67,7 @@ async def head501(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -110,7 +110,7 @@ async def get501(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -158,7 +158,7 @@ async def post505( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -214,7 +214,7 @@ async def delete505( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_success_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_success_operations.py index 84896e6dd48..fa694288d52 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_success_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_http_success_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -82,7 +82,7 @@ async def head200(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -125,7 +125,7 @@ async def get200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +172,7 @@ async def options200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -224,7 +224,7 @@ async def put200( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -280,7 +280,7 @@ async def patch200( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -336,7 +336,7 @@ async def post200( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -392,7 +392,7 @@ async def delete200( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -448,7 +448,7 @@ async def put201( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -504,7 +504,7 @@ async def post201( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -560,7 +560,7 @@ async def put202( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -616,7 +616,7 @@ async def patch202( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -672,7 +672,7 @@ async def post202( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -728,7 +728,7 @@ async def delete202( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -779,7 +779,7 @@ async def head204(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -827,7 +827,7 @@ async def put204( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -883,7 +883,7 @@ async def patch204( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -939,7 +939,7 @@ async def post204( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -995,7 +995,7 @@ async def delete204( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1046,7 +1046,7 @@ async def head404(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_multiple_responses_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_multiple_responses_operations.py index fc432aa70a9..131b8340bed 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_multiple_responses_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/aio/operations/_multiple_responses_operations.py @@ -98,7 +98,7 @@ async def get200_model204_no_model_default_error200_valid( # pylint: disable=na :rtype: ~httpinfrastructure.models.MyException or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -149,7 +149,7 @@ async def get200_model204_no_model_default_error204_valid( # pylint: disable=na :rtype: ~httpinfrastructure.models.MyException or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -200,7 +200,7 @@ async def get200_model204_no_model_default_error201_invalid( # pylint: disable= :rtype: ~httpinfrastructure.models.MyException or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -251,7 +251,7 @@ async def get200_model204_no_model_default_error202_none( # pylint: disable=nam :rtype: ~httpinfrastructure.models.MyException or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -302,7 +302,7 @@ async def get200_model204_no_model_default_error400_valid( # pylint: disable=na :rtype: ~httpinfrastructure.models.MyException or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -353,7 +353,7 @@ async def get200_model201_model_default_error200_valid( # pylint: disable=name- :rtype: ~httpinfrastructure.models.MyException or ~httpinfrastructure.models.B :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -406,7 +406,7 @@ async def get200_model201_model_default_error201_valid( # pylint: disable=name- :rtype: ~httpinfrastructure.models.MyException or ~httpinfrastructure.models.B :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -459,7 +459,7 @@ async def get200_model201_model_default_error400_valid( # pylint: disable=name- :rtype: ~httpinfrastructure.models.MyException or ~httpinfrastructure.models.B :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -513,7 +513,7 @@ async def get200_model_a201_model_c404_model_d_default_error200_valid( # pylint ~httpinfrastructure.models.D :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -570,7 +570,7 @@ async def get200_model_a201_model_c404_model_d_default_error201_valid( # pylint ~httpinfrastructure.models.D :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -627,7 +627,7 @@ async def get200_model_a201_model_c404_model_d_default_error404_valid( # pylint ~httpinfrastructure.models.D :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -684,7 +684,7 @@ async def get200_model_a201_model_c404_model_d_default_error400_valid( # pylint ~httpinfrastructure.models.D :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -740,7 +740,7 @@ async def get202_none204_none_default_error202_none( # pylint: disable=inconsis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -785,7 +785,7 @@ async def get202_none204_none_default_error204_none( # pylint: disable=inconsis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -830,7 +830,7 @@ async def get202_none204_none_default_error400_valid( # pylint: disable=inconsi :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -875,7 +875,7 @@ async def get202_none204_none_default_none202_invalid( # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -919,7 +919,7 @@ async def get202_none204_none_default_none204_none( # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -963,7 +963,7 @@ async def get202_none204_none_default_none400_none( # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1007,7 +1007,7 @@ async def get202_none204_none_default_none400_invalid( # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1049,7 +1049,7 @@ async def get_default_model_a200_valid(self, **kwargs: Any) -> _models.MyExcepti :rtype: ~httpinfrastructure.models.MyException :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1095,7 +1095,7 @@ async def get_default_model_a200_none(self, **kwargs: Any) -> _models.MyExceptio :rtype: ~httpinfrastructure.models.MyException :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1143,7 +1143,7 @@ async def get_default_model_a400_valid( # pylint: disable=inconsistent-return-s :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1188,7 +1188,7 @@ async def get_default_model_a400_none( # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1233,7 +1233,7 @@ async def get_default_none200_invalid( # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1275,7 +1275,7 @@ async def get_default_none200_none(self, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1319,7 +1319,7 @@ async def get_default_none400_invalid( # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1361,7 +1361,7 @@ async def get_default_none400_none(self, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1404,7 +1404,7 @@ async def get200_model_a200_none(self, **kwargs: Any) -> _models.MyException: :rtype: ~httpinfrastructure.models.MyException :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1450,7 +1450,7 @@ async def get200_model_a200_valid(self, **kwargs: Any) -> _models.MyException: :rtype: ~httpinfrastructure.models.MyException :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1496,7 +1496,7 @@ async def get200_model_a200_invalid(self, **kwargs: Any) -> _models.MyException: :rtype: ~httpinfrastructure.models.MyException :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1542,7 +1542,7 @@ async def get200_model_a400_none(self, **kwargs: Any) -> _models.MyException: :rtype: ~httpinfrastructure.models.MyException :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1588,7 +1588,7 @@ async def get200_model_a400_valid(self, **kwargs: Any) -> _models.MyException: :rtype: ~httpinfrastructure.models.MyException :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1634,7 +1634,7 @@ async def get200_model_a400_invalid(self, **kwargs: Any) -> _models.MyException: :rtype: ~httpinfrastructure.models.MyException :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1680,7 +1680,7 @@ async def get200_model_a202_valid(self, **kwargs: Any) -> _models.MyException: :rtype: ~httpinfrastructure.models.MyException :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_client_failure_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_client_failure_operations.py index d75d6d01e28..0415cd56b4d 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_client_failure_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_client_failure_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -468,7 +468,7 @@ def head400(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -511,7 +511,7 @@ def get400(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -554,7 +554,7 @@ def options400(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -602,7 +602,7 @@ def put400( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -658,7 +658,7 @@ def patch400( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -714,7 +714,7 @@ def post400( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -770,7 +770,7 @@ def delete400( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -821,7 +821,7 @@ def head401(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -864,7 +864,7 @@ def get402(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -907,7 +907,7 @@ def options403(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -950,7 +950,7 @@ def get403(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -998,7 +998,7 @@ def put404( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1054,7 +1054,7 @@ def patch405( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1110,7 +1110,7 @@ def post406( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1166,7 +1166,7 @@ def delete407( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1222,7 +1222,7 @@ def put409( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1273,7 +1273,7 @@ def head410(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1316,7 +1316,7 @@ def get411(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1359,7 +1359,7 @@ def options412(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1402,7 +1402,7 @@ def get412(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1450,7 +1450,7 @@ def put413( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1506,7 +1506,7 @@ def patch414( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1562,7 +1562,7 @@ def post415( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1613,7 +1613,7 @@ def get416(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1661,7 +1661,7 @@ def delete417( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1712,7 +1712,7 @@ def head429(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_failure_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_failure_operations.py index b64355798c4..3f9242c105f 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_failure_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_failure_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -107,7 +107,7 @@ def get_empty_error(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -154,7 +154,7 @@ def get_no_model_error(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -200,7 +200,7 @@ def get_no_model_empty(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_redirects_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_redirects_operations.py index 4460394152a..61ef70de9d3 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_redirects_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_redirects_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, List, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, List, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -310,7 +310,7 @@ def head300(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -357,7 +357,7 @@ def get300(self, **kwargs: Any) -> Optional[List[str]]: :rtype: list[str] or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -409,7 +409,7 @@ def head301(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -456,7 +456,7 @@ def get301(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -509,7 +509,7 @@ def put301( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -563,7 +563,7 @@ def head302(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -610,7 +610,7 @@ def get302(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -663,7 +663,7 @@ def patch302( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -723,7 +723,7 @@ def post303( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -778,7 +778,7 @@ def head307(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -825,7 +825,7 @@ def get307(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -872,7 +872,7 @@ def options307(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -924,7 +924,7 @@ def put307( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -984,7 +984,7 @@ def patch307( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1044,7 +1044,7 @@ def post307( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1104,7 +1104,7 @@ def delete307( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_retry_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_retry_operations.py index 4ffd0a08c7c..94fc587be6c 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_retry_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_retry_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -209,7 +209,7 @@ def head408(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -257,7 +257,7 @@ def put500( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -313,7 +313,7 @@ def patch500( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -364,7 +364,7 @@ def get502(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -407,7 +407,7 @@ def options502(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -459,7 +459,7 @@ def post503( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -515,7 +515,7 @@ def delete503( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -571,7 +571,7 @@ def put504( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -627,7 +627,7 @@ def patch504( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_server_failure_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_server_failure_operations.py index c685625fba6..bba03393d2f 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_server_failure_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_server_failure_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -127,7 +127,7 @@ def head501(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +170,7 @@ def get501(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -218,7 +218,7 @@ def post505( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -274,7 +274,7 @@ def delete505( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_success_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_success_operations.py index 0833c794138..af30ed1e8c0 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_success_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_http_success_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -373,7 +373,7 @@ def head200(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -416,7 +416,7 @@ def get200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -463,7 +463,7 @@ def options200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -515,7 +515,7 @@ def put200( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -571,7 +571,7 @@ def patch200( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -627,7 +627,7 @@ def post200( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -683,7 +683,7 @@ def delete200( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -739,7 +739,7 @@ def put201( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -795,7 +795,7 @@ def post201( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -851,7 +851,7 @@ def put202( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -907,7 +907,7 @@ def patch202( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -963,7 +963,7 @@ def post202( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1019,7 +1019,7 @@ def delete202( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1070,7 +1070,7 @@ def head204(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1118,7 +1118,7 @@ def put204( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1174,7 +1174,7 @@ def patch204( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1230,7 +1230,7 @@ def post204( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1286,7 +1286,7 @@ def delete204( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1337,7 +1337,7 @@ def head404(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_multiple_responses_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_multiple_responses_operations.py index 2e6effc07f3..070d47b821e 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_multiple_responses_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Http/httpinfrastructure/operations/_multiple_responses_operations.py @@ -525,7 +525,7 @@ def get200_model204_no_model_default_error200_valid( # pylint: disable=name-too :rtype: ~httpinfrastructure.models.MyException or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -576,7 +576,7 @@ def get200_model204_no_model_default_error204_valid( # pylint: disable=name-too :rtype: ~httpinfrastructure.models.MyException or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -627,7 +627,7 @@ def get200_model204_no_model_default_error201_invalid( # pylint: disable=name-t :rtype: ~httpinfrastructure.models.MyException or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -678,7 +678,7 @@ def get200_model204_no_model_default_error202_none( # pylint: disable=name-too- :rtype: ~httpinfrastructure.models.MyException or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -729,7 +729,7 @@ def get200_model204_no_model_default_error400_valid( # pylint: disable=name-too :rtype: ~httpinfrastructure.models.MyException or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -780,7 +780,7 @@ def get200_model201_model_default_error200_valid( # pylint: disable=name-too-lo :rtype: ~httpinfrastructure.models.MyException or ~httpinfrastructure.models.B :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -833,7 +833,7 @@ def get200_model201_model_default_error201_valid( # pylint: disable=name-too-lo :rtype: ~httpinfrastructure.models.MyException or ~httpinfrastructure.models.B :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -886,7 +886,7 @@ def get200_model201_model_default_error400_valid( # pylint: disable=name-too-lo :rtype: ~httpinfrastructure.models.MyException or ~httpinfrastructure.models.B :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -940,7 +940,7 @@ def get200_model_a201_model_c404_model_d_default_error200_valid( # pylint: disa ~httpinfrastructure.models.D :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -997,7 +997,7 @@ def get200_model_a201_model_c404_model_d_default_error201_valid( # pylint: disa ~httpinfrastructure.models.D :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1054,7 +1054,7 @@ def get200_model_a201_model_c404_model_d_default_error404_valid( # pylint: disa ~httpinfrastructure.models.D :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1111,7 +1111,7 @@ def get200_model_a201_model_c404_model_d_default_error400_valid( # pylint: disa ~httpinfrastructure.models.D :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1167,7 +1167,7 @@ def get202_none204_none_default_error202_none( # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1212,7 +1212,7 @@ def get202_none204_none_default_error204_none( # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1257,7 +1257,7 @@ def get202_none204_none_default_error400_valid( # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1302,7 +1302,7 @@ def get202_none204_none_default_none202_invalid( # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1346,7 +1346,7 @@ def get202_none204_none_default_none204_none( # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1390,7 +1390,7 @@ def get202_none204_none_default_none400_none( # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1434,7 +1434,7 @@ def get202_none204_none_default_none400_invalid( # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1476,7 +1476,7 @@ def get_default_model_a200_valid(self, **kwargs: Any) -> _models.MyException: :rtype: ~httpinfrastructure.models.MyException :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1522,7 +1522,7 @@ def get_default_model_a200_none(self, **kwargs: Any) -> _models.MyException: :rtype: ~httpinfrastructure.models.MyException :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1568,7 +1568,7 @@ def get_default_model_a400_valid(self, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1611,7 +1611,7 @@ def get_default_model_a400_none(self, **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1654,7 +1654,7 @@ def get_default_none200_invalid(self, **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1696,7 +1696,7 @@ def get_default_none200_none(self, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1738,7 +1738,7 @@ def get_default_none400_invalid(self, **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1780,7 +1780,7 @@ def get_default_none400_none(self, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1823,7 +1823,7 @@ def get200_model_a200_none(self, **kwargs: Any) -> _models.MyException: :rtype: ~httpinfrastructure.models.MyException :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1869,7 +1869,7 @@ def get200_model_a200_valid(self, **kwargs: Any) -> _models.MyException: :rtype: ~httpinfrastructure.models.MyException :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1915,7 +1915,7 @@ def get200_model_a200_invalid(self, **kwargs: Any) -> _models.MyException: :rtype: ~httpinfrastructure.models.MyException :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1961,7 +1961,7 @@ def get200_model_a400_none(self, **kwargs: Any) -> _models.MyException: :rtype: ~httpinfrastructure.models.MyException :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2007,7 +2007,7 @@ def get200_model_a400_valid(self, **kwargs: Any) -> _models.MyException: :rtype: ~httpinfrastructure.models.MyException :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2053,7 +2053,7 @@ def get200_model_a400_invalid(self, **kwargs: Any) -> _models.MyException: :rtype: ~httpinfrastructure.models.MyException :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2099,7 +2099,7 @@ def get200_model_a202_valid(self, **kwargs: Any) -> _models.MyException: :rtype: ~httpinfrastructure.models.MyException :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/IncorrectErrorResponse/incorrecterrorresponse/aio/operations/_incorrect_returned_error_model_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/IncorrectErrorResponse/incorrecterrorresponse/aio/operations/_incorrect_returned_error_model_operations.py index 5a662fe2459..b30d3a8f1d9 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/IncorrectErrorResponse/incorrecterrorresponse/aio/operations/_incorrect_returned_error_model_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/IncorrectErrorResponse/incorrecterrorresponse/aio/operations/_incorrect_returned_error_model_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -46,7 +46,7 @@ async def get_incorrect_error_from_server( # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/IncorrectErrorResponse/incorrecterrorresponse/operations/_incorrect_returned_error_model_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/IncorrectErrorResponse/incorrecterrorresponse/operations/_incorrect_returned_error_model_operations.py index 5ec03add982..930af1f41f5 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/IncorrectErrorResponse/incorrecterrorresponse/operations/_incorrect_returned_error_model_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/IncorrectErrorResponse/incorrecterrorresponse/operations/_incorrect_returned_error_model_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -53,7 +53,7 @@ def get_incorrect_error_from_server(self, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/InternalOperation/internaloperation/aio/operations/_media_types_client_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/InternalOperation/internaloperation/aio/operations/_media_types_client_operations.py index 3cda0530234..93168bcd857 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/InternalOperation/internaloperation/aio/operations/_media_types_client_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/InternalOperation/internaloperation/aio/operations/_media_types_client_operations.py @@ -90,7 +90,7 @@ async def analyze_body(self, input: Optional[Union[_models.SourcePath, IO[bytes] :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -192,7 +192,7 @@ async def analyze_body_no_accept_header( # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -251,7 +251,7 @@ async def content_type_with_encoding(self, input: Optional[str] = None, **kwargs :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -308,7 +308,7 @@ async def binary_body_with_two_content_types(self, message: IO[bytes], **kwargs: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -363,7 +363,7 @@ async def binary_body_with_three_content_types(self, message: IO[bytes], **kwarg :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -432,7 +432,7 @@ async def _body_three_types(self, message: Union[Any, IO[bytes], str], **kwargs: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -493,7 +493,7 @@ async def put_text_and_json_body(self, message: str, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/InternalOperation/internaloperation/operations/_media_types_client_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/InternalOperation/internaloperation/operations/_media_types_client_operations.py index fc63eb6e197..04ccfea5792 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/InternalOperation/internaloperation/operations/_media_types_client_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/InternalOperation/internaloperation/operations/_media_types_client_operations.py @@ -204,7 +204,7 @@ def analyze_body(self, input: Optional[Union[_models.SourcePath, IO[bytes]]] = N :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -306,7 +306,7 @@ def analyze_body_no_accept_header( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -365,7 +365,7 @@ def content_type_with_encoding(self, input: Optional[str] = None, **kwargs: Any) :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -422,7 +422,7 @@ def binary_body_with_two_content_types(self, message: IO[bytes], **kwargs: Any) :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -477,7 +477,7 @@ def binary_body_with_three_content_types(self, message: IO[bytes], **kwargs: Any :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -546,7 +546,7 @@ def _body_three_types(self, message: Union[Any, IO[bytes], str], **kwargs: Any) :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -607,7 +607,7 @@ def put_text_and_json_body(self, message: str, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MediaTypes/mediatypes/aio/operations/_media_types_client_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MediaTypes/mediatypes/aio/operations/_media_types_client_operations.py index 897d99a8825..861dae37ac1 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MediaTypes/mediatypes/aio/operations/_media_types_client_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MediaTypes/mediatypes/aio/operations/_media_types_client_operations.py @@ -90,7 +90,7 @@ async def analyze_body(self, input: Optional[Union[_models.SourcePath, IO[bytes] :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -192,7 +192,7 @@ async def analyze_body_no_accept_header( # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -251,7 +251,7 @@ async def content_type_with_encoding(self, input: Optional[str] = None, **kwargs :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -308,7 +308,7 @@ async def binary_body_with_two_content_types(self, message: IO[bytes], **kwargs: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -363,7 +363,7 @@ async def binary_body_with_three_content_types(self, message: IO[bytes], **kwarg :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -469,7 +469,7 @@ async def body_three_types(self, message: Union[Any, IO[bytes], str], **kwargs: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -530,7 +530,7 @@ async def put_text_and_json_body(self, message: str, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MediaTypes/mediatypes/operations/_media_types_client_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MediaTypes/mediatypes/operations/_media_types_client_operations.py index b0e9cab956c..af9b4a99a1c 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MediaTypes/mediatypes/operations/_media_types_client_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MediaTypes/mediatypes/operations/_media_types_client_operations.py @@ -204,7 +204,7 @@ def analyze_body(self, input: Optional[Union[_models.SourcePath, IO[bytes]]] = N :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -306,7 +306,7 @@ def analyze_body_no_accept_header( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -365,7 +365,7 @@ def content_type_with_encoding(self, input: Optional[str] = None, **kwargs: Any) :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -422,7 +422,7 @@ def binary_body_with_two_content_types(self, message: IO[bytes], **kwargs: Any) :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -477,7 +477,7 @@ def binary_body_with_three_content_types(self, message: IO[bytes], **kwargs: Any :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +583,7 @@ def body_three_types(self, message: Union[Any, IO[bytes], str], **kwargs: Any) - :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -644,7 +644,7 @@ def put_text_and_json_body(self, message: str, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MergePatchJson/mergepatchjson/aio/operations/_merge_patch_json_client_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MergePatchJson/mergepatchjson/aio/operations/_merge_patch_json_client_operations.py index 847eba28771..8e1f3d6db8d 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MergePatchJson/mergepatchjson/aio/operations/_merge_patch_json_client_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MergePatchJson/mergepatchjson/aio/operations/_merge_patch_json_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -47,7 +47,7 @@ async def patch_single(self, body: JSON, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MergePatchJson/mergepatchjson/operations/_merge_patch_json_client_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MergePatchJson/mergepatchjson/operations/_merge_patch_json_client_operations.py index ab09c1cde5d..b6912caa309 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MergePatchJson/mergepatchjson/operations/_merge_patch_json_client_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MergePatchJson/mergepatchjson/operations/_merge_patch_json_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -66,7 +66,7 @@ def patch_single(self, body: JSON, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ModelFlattening/modelflattening/aio/operations/_auto_rest_resource_flattening_test_service_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ModelFlattening/modelflattening/aio/operations/_auto_rest_resource_flattening_test_service_operations.py index 3c6c1858235..12597d48577 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ModelFlattening/modelflattening/aio/operations/_auto_rest_resource_flattening_test_service_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ModelFlattening/modelflattening/aio/operations/_auto_rest_resource_flattening_test_service_operations.py @@ -110,7 +110,7 @@ async def put_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -171,7 +171,7 @@ async def get_array(self, **kwargs: Any) -> List[_models.FlattenedProduct]: :rtype: list[~modelflattening.models.FlattenedProduct] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -271,7 +271,7 @@ async def put_wrapped_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +333,7 @@ async def get_wrapped_array(self, **kwargs: Any) -> List[_models.ProductWrapper] :rtype: list[~modelflattening.models.ProductWrapper] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -430,7 +430,7 @@ async def put_dictionary( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -491,7 +491,7 @@ async def get_dictionary(self, **kwargs: Any) -> Dict[str, _models.FlattenedProd :rtype: dict[str, ~modelflattening.models.FlattenedProduct] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -594,7 +594,7 @@ async def put_resource_collection( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -655,7 +655,7 @@ async def get_resource_collection(self, **kwargs: Any) -> _models.ResourceCollec :rtype: ~modelflattening.models.ResourceCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -752,7 +752,7 @@ async def put_simple_product( :rtype: ~modelflattening.models.SimpleProduct :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -841,7 +841,7 @@ async def post_flattened_simple_product( :rtype: ~modelflattening.models.SimpleProduct :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -911,7 +911,7 @@ async def put_simple_product_with_grouping( :rtype: ~modelflattening.models.SimpleProduct :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ModelFlattening/modelflattening/operations/_auto_rest_resource_flattening_test_service_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ModelFlattening/modelflattening/operations/_auto_rest_resource_flattening_test_service_operations.py index 3210224ad36..26c07dd76f4 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ModelFlattening/modelflattening/operations/_auto_rest_resource_flattening_test_service_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ModelFlattening/modelflattening/operations/_auto_rest_resource_flattening_test_service_operations.py @@ -282,7 +282,7 @@ def put_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -343,7 +343,7 @@ def get_array(self, **kwargs: Any) -> List[_models.FlattenedProduct]: :rtype: list[~modelflattening.models.FlattenedProduct] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -443,7 +443,7 @@ def put_wrapped_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +505,7 @@ def get_wrapped_array(self, **kwargs: Any) -> List[_models.ProductWrapper]: :rtype: list[~modelflattening.models.ProductWrapper] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -602,7 +602,7 @@ def put_dictionary( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -663,7 +663,7 @@ def get_dictionary(self, **kwargs: Any) -> Dict[str, _models.FlattenedProduct]: :rtype: dict[str, ~modelflattening.models.FlattenedProduct] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -766,7 +766,7 @@ def put_resource_collection( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -827,7 +827,7 @@ def get_resource_collection(self, **kwargs: Any) -> _models.ResourceCollection: :rtype: ~modelflattening.models.ResourceCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -924,7 +924,7 @@ def put_simple_product( :rtype: ~modelflattening.models.SimpleProduct :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1013,7 +1013,7 @@ def post_flattened_simple_product( :rtype: ~modelflattening.models.SimpleProduct :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1083,7 +1083,7 @@ def put_simple_product_with_grouping( :rtype: ~modelflattening.models.SimpleProduct :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/operations/_multiple_inheritance_service_client_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/operations/_multiple_inheritance_service_client_operations.py index 865d3dcfb35..b79e1ff2e56 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/operations/_multiple_inheritance_service_client_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/operations/_multiple_inheritance_service_client_operations.py @@ -59,7 +59,7 @@ async def get_horse(self, **kwargs: Any) -> _models.Horse: :rtype: ~multipleinheritance.models.Horse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -137,7 +137,7 @@ async def put_horse(self, horse: Union[_models.Horse, IO[bytes]], **kwargs: Any) :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -195,7 +195,7 @@ async def get_pet(self, **kwargs: Any) -> _models.Pet: :rtype: ~multipleinheritance.models.Pet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -244,7 +244,7 @@ async def put_pet(self, name: str, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -296,7 +296,7 @@ async def get_feline(self, **kwargs: Any) -> _models.Feline: :rtype: ~multipleinheritance.models.Feline :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -374,7 +374,7 @@ async def put_feline(self, feline: Union[_models.Feline, IO[bytes]], **kwargs: A :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -432,7 +432,7 @@ async def get_cat(self, **kwargs: Any) -> _models.Cat: :rtype: ~multipleinheritance.models.Cat :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -512,7 +512,7 @@ async def put_cat(self, cat: Union[_models.Cat, IO[bytes]], **kwargs: Any) -> st :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -571,7 +571,7 @@ async def get_kitten(self, **kwargs: Any) -> _models.Kitten: :rtype: ~multipleinheritance.models.Kitten :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -654,7 +654,7 @@ async def put_kitten(self, kitten: Union[_models.Kitten, IO[bytes]], **kwargs: A :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/operations/_multiple_inheritance_service_client_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/operations/_multiple_inheritance_service_client_operations.py index c27c55d2e9b..1bd0973d8d7 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/operations/_multiple_inheritance_service_client_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/operations/_multiple_inheritance_service_client_operations.py @@ -205,7 +205,7 @@ def get_horse(self, **kwargs: Any) -> _models.Horse: :rtype: ~multipleinheritance.models.Horse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -283,7 +283,7 @@ def put_horse(self, horse: Union[_models.Horse, IO[bytes]], **kwargs: Any) -> st :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -341,7 +341,7 @@ def get_pet(self, **kwargs: Any) -> _models.Pet: :rtype: ~multipleinheritance.models.Pet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -390,7 +390,7 @@ def put_pet(self, name: str, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -442,7 +442,7 @@ def get_feline(self, **kwargs: Any) -> _models.Feline: :rtype: ~multipleinheritance.models.Feline :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -520,7 +520,7 @@ def put_feline(self, feline: Union[_models.Feline, IO[bytes]], **kwargs: Any) -> :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -578,7 +578,7 @@ def get_cat(self, **kwargs: Any) -> _models.Cat: :rtype: ~multipleinheritance.models.Cat :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -658,7 +658,7 @@ def put_cat(self, cat: Union[_models.Cat, IO[bytes]], **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -717,7 +717,7 @@ def get_kitten(self, **kwargs: Any) -> _models.Kitten: :rtype: ~multipleinheritance.models.Kitten :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -800,7 +800,7 @@ def put_kitten(self, kitten: Union[_models.Kitten, IO[bytes]], **kwargs: Any) -> :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/NonStringEnums/nonstringenums/aio/operations/_float_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/NonStringEnums/nonstringenums/aio/operations/_float_operations.py index 68bf635cf8a..aa1267bfdb6 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/NonStringEnums/nonstringenums/aio/operations/_float_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/NonStringEnums/nonstringenums/aio/operations/_float_operations.py @@ -63,7 +63,7 @@ async def put(self, input: Optional[Union[float, _models.FloatEnum]] = None, **k :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -117,7 +117,7 @@ async def get(self, **kwargs: Any) -> Union[float, _models.FloatEnum]: :rtype: float or ~nonstringenums.models.FloatEnum :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/NonStringEnums/nonstringenums/aio/operations/_int_operations_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/NonStringEnums/nonstringenums/aio/operations/_int_operations_operations.py index 2cc594802b6..3ccbfb71ae2 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/NonStringEnums/nonstringenums/aio/operations/_int_operations_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/NonStringEnums/nonstringenums/aio/operations/_int_operations_operations.py @@ -63,7 +63,7 @@ async def put(self, input: Optional[Union[int, _models.IntEnum]] = None, **kwarg :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -117,7 +117,7 @@ async def get(self, **kwargs: Any) -> Union[int, _models.IntEnum]: :rtype: int or ~nonstringenums.models.IntEnum :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/NonStringEnums/nonstringenums/operations/_float_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/NonStringEnums/nonstringenums/operations/_float_operations.py index 099418af4f2..1fedc3b94f2 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/NonStringEnums/nonstringenums/operations/_float_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/NonStringEnums/nonstringenums/operations/_float_operations.py @@ -97,7 +97,7 @@ def put(self, input: Optional[Union[float, _models.FloatEnum]] = None, **kwargs: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -151,7 +151,7 @@ def get(self, **kwargs: Any) -> Union[float, _models.FloatEnum]: :rtype: float or ~nonstringenums.models.FloatEnum :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/NonStringEnums/nonstringenums/operations/_int_operations_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/NonStringEnums/nonstringenums/operations/_int_operations_operations.py index 4f03dc0e17d..b9a799f13e9 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/NonStringEnums/nonstringenums/operations/_int_operations_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/NonStringEnums/nonstringenums/operations/_int_operations_operations.py @@ -97,7 +97,7 @@ def put(self, input: Optional[Union[int, _models.IntEnum]] = None, **kwargs: Any :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -151,7 +151,7 @@ def get(self, **kwargs: Any) -> Union[int, _models.IntEnum]: :rtype: int or ~nonstringenums.models.IntEnum :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ObjectType/objecttype/aio/operations/_object_type_client_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ObjectType/objecttype/aio/operations/_object_type_client_operations.py index 67836765488..1d84a053718 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ObjectType/objecttype/aio/operations/_object_type_client_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ObjectType/objecttype/aio/operations/_object_type_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -46,7 +46,7 @@ async def get(self, **kwargs: Any) -> JSON: :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -97,7 +97,7 @@ async def put(self, put_object: JSON, **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ObjectType/objecttype/operations/_object_type_client_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ObjectType/objecttype/operations/_object_type_client_operations.py index b2716f1c919..18910d4521d 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ObjectType/objecttype/operations/_object_type_client_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ObjectType/objecttype/operations/_object_type_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -79,7 +79,7 @@ def get(self, **kwargs: Any) -> JSON: :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -130,7 +130,7 @@ def put(self, put_object: JSON, **kwargs: Any) -> None: # pylint: disable=incon :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/PackageModeDataPlane/packagemode/aio/operations/_anything_client_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/PackageModeDataPlane/packagemode/aio/operations/_anything_client_operations.py index d12850400fa..3834e8eb6a4 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/PackageModeDataPlane/packagemode/aio/operations/_anything_client_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/PackageModeDataPlane/packagemode/aio/operations/_anything_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -52,7 +52,7 @@ async def get_object(self, **kwargs: Any) -> Any: :rtype: any :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -101,7 +101,7 @@ async def put_object(self, input: Any, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -148,7 +148,7 @@ async def get_string(self, **kwargs: Any) -> Any: :rtype: any :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -197,7 +197,7 @@ async def put_string(self, input: Any, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -244,7 +244,7 @@ async def get_array(self, **kwargs: Any) -> Any: :rtype: any :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -293,7 +293,7 @@ async def put_array(self, input: Any, **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/PackageModeDataPlane/packagemode/operations/_anything_client_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/PackageModeDataPlane/packagemode/operations/_anything_client_operations.py index 978d2a14679..01f2bc4bba6 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/PackageModeDataPlane/packagemode/operations/_anything_client_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/PackageModeDataPlane/packagemode/operations/_anything_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -131,7 +131,7 @@ def get_object(self, **kwargs: Any) -> Any: :rtype: any :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -180,7 +180,7 @@ def put_object(self, input: Any, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -227,7 +227,7 @@ def get_string(self, **kwargs: Any) -> Any: :rtype: any :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -276,7 +276,7 @@ def put_string(self, input: Any, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -323,7 +323,7 @@ def get_array(self, **kwargs: Any) -> Any: :rtype: any :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -372,7 +372,7 @@ def put_array(self, input: Any, **kwargs: Any) -> None: # pylint: disable=incon :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ParameterFlattening/parameterflattening/aio/operations/_availability_sets_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ParameterFlattening/parameterflattening/aio/operations/_availability_sets_operations.py index 905e75e3b53..743082759aa 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ParameterFlattening/parameterflattening/aio/operations/_availability_sets_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ParameterFlattening/parameterflattening/aio/operations/_availability_sets_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -70,7 +70,7 @@ async def update( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ParameterFlattening/parameterflattening/operations/_availability_sets_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ParameterFlattening/parameterflattening/operations/_availability_sets_operations.py index fbf104dcb0d..5459487b896 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ParameterFlattening/parameterflattening/operations/_availability_sets_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ParameterFlattening/parameterflattening/operations/_availability_sets_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -93,7 +93,7 @@ def update( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ParameterizedEndpoint/parameterizedendpoint/aio/operations/_parmaterized_endpoint_client_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ParameterizedEndpoint/parameterizedendpoint/aio/operations/_parmaterized_endpoint_client_operations.py index 85c197daed0..e44c1f6d039 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ParameterizedEndpoint/parameterizedendpoint/aio/operations/_parmaterized_endpoint_client_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ParameterizedEndpoint/parameterizedendpoint/aio/operations/_parmaterized_endpoint_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -43,7 +43,7 @@ async def get(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ParameterizedEndpoint/parameterizedendpoint/operations/_parmaterized_endpoint_client_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ParameterizedEndpoint/parameterizedendpoint/operations/_parmaterized_endpoint_client_operations.py index 0251a7b4f66..f806c17d3f0 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ParameterizedEndpoint/parameterizedendpoint/operations/_parmaterized_endpoint_client_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ParameterizedEndpoint/parameterizedendpoint/operations/_parmaterized_endpoint_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -52,7 +52,7 @@ def get(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Report/report/aio/operations/_auto_rest_report_service_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Report/report/aio/operations/_auto_rest_report_service_operations.py index c5cc6b74137..eb7cac462cc 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Report/report/aio/operations/_auto_rest_report_service_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Report/report/aio/operations/_auto_rest_report_service_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -51,7 +51,7 @@ async def get_report(self, qualifier: Optional[str] = None, **kwargs: Any) -> Di :rtype: dict[str, int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -103,7 +103,7 @@ async def get_optional_report(self, qualifier: Optional[str] = None, **kwargs: A :rtype: dict[str, int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Report/report/operations/_auto_rest_report_service_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Report/report/operations/_auto_rest_report_service_operations.py index a4e3dc235c5..a37e5abcb75 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Report/report/operations/_auto_rest_report_service_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Report/report/operations/_auto_rest_report_service_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -89,7 +89,7 @@ def get_report(self, qualifier: Optional[str] = None, **kwargs: Any) -> Dict[str :rtype: dict[str, int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -141,7 +141,7 @@ def get_optional_report(self, qualifier: Optional[str] = None, **kwargs: Any) -> :rtype: dict[str, int] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/RequiredOptional/requiredoptional/aio/operations/_explicit_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/RequiredOptional/requiredoptional/aio/operations/_explicit_operations.py index d6657feda81..fd96081d85d 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/RequiredOptional/requiredoptional/aio/operations/_explicit_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/RequiredOptional/requiredoptional/aio/operations/_explicit_operations.py @@ -92,7 +92,7 @@ async def put_optional_binary_body( # pylint: disable=inconsistent-return-state :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -144,7 +144,7 @@ async def put_required_binary_body( # pylint: disable=inconsistent-return-state :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -197,7 +197,7 @@ async def post_required_integer_parameter( # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -249,7 +249,7 @@ async def post_optional_integer_parameter( # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -305,7 +305,7 @@ async def post_required_integer_property( # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -358,7 +358,7 @@ async def post_optional_integer_property( # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -415,7 +415,7 @@ async def post_required_integer_header( # pylint: disable=inconsistent-return-s :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -463,7 +463,7 @@ async def post_optional_integer_header( # pylint: disable=inconsistent-return-s :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -512,7 +512,7 @@ async def post_required_string_parameter( # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -564,7 +564,7 @@ async def post_optional_string_parameter( # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -620,7 +620,7 @@ async def post_required_string_property( # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -673,7 +673,7 @@ async def post_optional_string_property( # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -730,7 +730,7 @@ async def post_required_string_header( # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -778,7 +778,7 @@ async def post_optional_string_header( # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -861,7 +861,7 @@ async def post_required_class_parameter( # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -952,7 +952,7 @@ async def post_optional_class_parameter( # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1015,7 +1015,7 @@ async def post_required_class_property( # pylint: disable=inconsistent-return-s :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1068,7 +1068,7 @@ async def post_optional_class_property( # pylint: disable=inconsistent-return-s :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1159,7 +1159,7 @@ async def post_required_array_parameter( # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1250,7 +1250,7 @@ async def post_optional_array_parameter( # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1313,7 +1313,7 @@ async def post_required_array_property( # pylint: disable=inconsistent-return-s :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1366,7 +1366,7 @@ async def post_optional_array_property( # pylint: disable=inconsistent-return-s :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1423,7 +1423,7 @@ async def post_required_array_header( # pylint: disable=inconsistent-return-sta :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1471,7 +1471,7 @@ async def post_optional_array_header( # pylint: disable=inconsistent-return-sta :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/RequiredOptional/requiredoptional/aio/operations/_implicit_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/RequiredOptional/requiredoptional/aio/operations/_implicit_operations.py index 322bc41c59a..965ab72b49a 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/RequiredOptional/requiredoptional/aio/operations/_implicit_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/RequiredOptional/requiredoptional/aio/operations/_implicit_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -75,7 +75,7 @@ async def get_required_path( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -123,7 +123,7 @@ async def put_optional_query( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -171,7 +171,7 @@ async def put_optional_header( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -219,7 +219,7 @@ async def put_optional_body( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -274,7 +274,7 @@ async def put_optional_binary_body( # pylint: disable=inconsistent-return-state :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +322,7 @@ async def get_required_global_path(self, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -366,7 +366,7 @@ async def get_required_global_query(self, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -410,7 +410,7 @@ async def get_optional_global_query(self, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/RequiredOptional/requiredoptional/operations/_explicit_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/RequiredOptional/requiredoptional/operations/_explicit_operations.py index 669edcff3d5..0603e7be705 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/RequiredOptional/requiredoptional/operations/_explicit_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/RequiredOptional/requiredoptional/operations/_explicit_operations.py @@ -487,7 +487,7 @@ def put_optional_binary_body( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -539,7 +539,7 @@ def put_required_binary_body( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -592,7 +592,7 @@ def post_required_integer_parameter( # pylint: disable=inconsistent-return-stat :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -644,7 +644,7 @@ def post_optional_integer_parameter( # pylint: disable=inconsistent-return-stat :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -700,7 +700,7 @@ def post_required_integer_property( # pylint: disable=inconsistent-return-state :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -753,7 +753,7 @@ def post_optional_integer_property( # pylint: disable=inconsistent-return-state :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -810,7 +810,7 @@ def post_required_integer_header( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -858,7 +858,7 @@ def post_optional_integer_header( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -907,7 +907,7 @@ def post_required_string_parameter( # pylint: disable=inconsistent-return-state :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -959,7 +959,7 @@ def post_optional_string_parameter( # pylint: disable=inconsistent-return-state :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1015,7 +1015,7 @@ def post_required_string_property( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1068,7 +1068,7 @@ def post_optional_string_property( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1125,7 +1125,7 @@ def post_required_string_header( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1173,7 +1173,7 @@ def post_optional_string_header( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1256,7 +1256,7 @@ def post_required_class_parameter( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1347,7 +1347,7 @@ def post_optional_class_parameter( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1410,7 +1410,7 @@ def post_required_class_property( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1463,7 +1463,7 @@ def post_optional_class_property( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1554,7 +1554,7 @@ def post_required_array_parameter( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1645,7 +1645,7 @@ def post_optional_array_parameter( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1708,7 +1708,7 @@ def post_required_array_property( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1761,7 +1761,7 @@ def post_optional_array_property( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1818,7 +1818,7 @@ def post_required_array_header( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1866,7 +1866,7 @@ def post_optional_array_header( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/RequiredOptional/requiredoptional/operations/_implicit_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/RequiredOptional/requiredoptional/operations/_implicit_operations.py index 8a1fc1311fa..d419a9186ee 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/RequiredOptional/requiredoptional/operations/_implicit_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/RequiredOptional/requiredoptional/operations/_implicit_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union from msrest import Serializer @@ -215,7 +215,7 @@ def get_required_path( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -263,7 +263,7 @@ def put_optional_query( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -311,7 +311,7 @@ def put_optional_header( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -359,7 +359,7 @@ def put_optional_body( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -414,7 +414,7 @@ def put_optional_binary_body( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +462,7 @@ def get_required_global_path(self, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -506,7 +506,7 @@ def get_required_global_query(self, **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -550,7 +550,7 @@ def get_optional_global_query(self, **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ReservedWords/reservedwords/aio/operations/_import_operations_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ReservedWords/reservedwords/aio/operations/_import_operations_operations.py index 80f0522c1a7..e96d0239b47 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ReservedWords/reservedwords/aio/operations/_import_operations_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ReservedWords/reservedwords/aio/operations/_import_operations_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -65,7 +65,7 @@ async def operation_one(self, parameter1: str, **kwargs: Any) -> JSON: :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ReservedWords/reservedwords/aio/operations/_reserved_words_client_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ReservedWords/reservedwords/aio/operations/_reserved_words_client_operations.py index 9541880789b..9354eaedac6 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ReservedWords/reservedwords/aio/operations/_reserved_words_client_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ReservedWords/reservedwords/aio/operations/_reserved_words_client_operations.py @@ -55,7 +55,7 @@ async def operation_with_content_param(self, content: IO[bytes], **kwargs: Any) :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -108,7 +108,7 @@ async def operation_with_json_param(self, json: Any, **kwargs: Any) -> JSON: :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -163,7 +163,7 @@ async def operation_with_data_param(self, data: str, world: str, **kwargs: Any) :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -224,7 +224,7 @@ async def operation_with_files_param(self, files: IO[bytes], file_name: str, **k :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -290,7 +290,7 @@ async def operation_with_url( :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -342,7 +342,7 @@ async def reserved_enum(self, enum_parameter: Union[str, _models.MyEnum], **kwar :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ReservedWords/reservedwords/operations/_import_operations_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ReservedWords/reservedwords/operations/_import_operations_operations.py index 96cc06cee8f..9260b7f35c2 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ReservedWords/reservedwords/operations/_import_operations_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ReservedWords/reservedwords/operations/_import_operations_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -86,7 +86,7 @@ def operation_one(self, parameter1: str, **kwargs: Any) -> JSON: :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ReservedWords/reservedwords/operations/_reserved_words_client_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ReservedWords/reservedwords/operations/_reserved_words_client_operations.py index 843bae8612b..96e7b68dfcc 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ReservedWords/reservedwords/operations/_reserved_words_client_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/ReservedWords/reservedwords/operations/_reserved_words_client_operations.py @@ -160,7 +160,7 @@ def operation_with_content_param(self, content: IO[bytes], **kwargs: Any) -> JSO :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -213,7 +213,7 @@ def operation_with_json_param(self, json: Any, **kwargs: Any) -> JSON: :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -268,7 +268,7 @@ def operation_with_data_param(self, data: str, world: str, **kwargs: Any) -> JSO :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -329,7 +329,7 @@ def operation_with_files_param(self, files: IO[bytes], file_name: str, **kwargs: :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -395,7 +395,7 @@ def operation_with_url( :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -447,7 +447,7 @@ def reserved_enum(self, enum_parameter: Union[str, _models.MyEnum], **kwargs: An :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityAadSwagger/securityaadswagger/aio/operations/_autorest_security_aad_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityAadSwagger/securityaadswagger/aio/operations/_autorest_security_aad_operations.py index fe9ad109078..59306a35465 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityAadSwagger/securityaadswagger/aio/operations/_autorest_security_aad_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityAadSwagger/securityaadswagger/aio/operations/_autorest_security_aad_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -43,7 +43,7 @@ async def head(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityAadSwagger/securityaadswagger/operations/_autorest_security_aad_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityAadSwagger/securityaadswagger/operations/_autorest_security_aad_operations.py index cd2d524e4b0..c29434fc154 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityAadSwagger/securityaadswagger/operations/_autorest_security_aad_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityAadSwagger/securityaadswagger/operations/_autorest_security_aad_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -52,7 +52,7 @@ def head(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityAadSwaggerCredentialFlag/securityaadswaggercredentialflag/aio/operations/_security_aad_swagger_credential_flag_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityAadSwaggerCredentialFlag/securityaadswaggercredentialflag/aio/operations/_security_aad_swagger_credential_flag_operations.py index c7f9f6ffa3a..1b4eb9bc712 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityAadSwaggerCredentialFlag/securityaadswaggercredentialflag/aio/operations/_security_aad_swagger_credential_flag_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityAadSwaggerCredentialFlag/securityaadswaggercredentialflag/aio/operations/_security_aad_swagger_credential_flag_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -45,7 +45,7 @@ async def head(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityAadSwaggerCredentialFlag/securityaadswaggercredentialflag/operations/_security_aad_swagger_credential_flag_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityAadSwaggerCredentialFlag/securityaadswaggercredentialflag/operations/_security_aad_swagger_credential_flag_operations.py index c40438dff5f..6f40486dc2f 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityAadSwaggerCredentialFlag/securityaadswaggercredentialflag/operations/_security_aad_swagger_credential_flag_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityAadSwaggerCredentialFlag/securityaadswaggercredentialflag/operations/_security_aad_swagger_credential_flag_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -54,7 +54,7 @@ def head(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityKeySwagger/securitykeyswagger/aio/operations/_autorest_security_key_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityKeySwagger/securitykeyswagger/aio/operations/_autorest_security_key_operations.py index 9665c34c85a..7303a37a1ad 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityKeySwagger/securitykeyswagger/aio/operations/_autorest_security_key_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityKeySwagger/securitykeyswagger/aio/operations/_autorest_security_key_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -43,7 +43,7 @@ async def head(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityKeySwagger/securitykeyswagger/operations/_autorest_security_key_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityKeySwagger/securitykeyswagger/operations/_autorest_security_key_operations.py index a364c697844..5424993271e 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityKeySwagger/securitykeyswagger/operations/_autorest_security_key_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityKeySwagger/securitykeyswagger/operations/_autorest_security_key_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -52,7 +52,7 @@ def head(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityKeySwaggerCredentialFlag/securitykeyswaggercredentialflag/aio/operations/_security_key_swagger_credential_flag_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityKeySwaggerCredentialFlag/securitykeyswaggercredentialflag/aio/operations/_security_key_swagger_credential_flag_operations.py index 712386a16d7..76113a5c62b 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityKeySwaggerCredentialFlag/securitykeyswaggercredentialflag/aio/operations/_security_key_swagger_credential_flag_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityKeySwaggerCredentialFlag/securitykeyswaggercredentialflag/aio/operations/_security_key_swagger_credential_flag_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -45,7 +45,7 @@ async def head(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityKeySwaggerCredentialFlag/securitykeyswaggercredentialflag/operations/_security_key_swagger_credential_flag_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityKeySwaggerCredentialFlag/securitykeyswaggercredentialflag/operations/_security_key_swagger_credential_flag_operations.py index b8822e502a6..8bbd78d57a8 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityKeySwaggerCredentialFlag/securitykeyswaggercredentialflag/operations/_security_key_swagger_credential_flag_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/SecurityKeySwaggerCredentialFlag/securitykeyswaggercredentialflag/operations/_security_key_swagger_credential_flag_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -54,7 +54,7 @@ def head(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/url/aio/operations/_path_items_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/url/aio/operations/_path_items_operations.py index 62a1cb5ee11..5c318d18610 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/url/aio/operations/_path_items_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/url/aio/operations/_path_items_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -85,7 +85,7 @@ async def get_all_with_values( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -153,7 +153,7 @@ async def get_global_query_null( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -221,7 +221,7 @@ async def get_global_and_local_query_null( # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -288,7 +288,7 @@ async def get_local_path_item_query_null( # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/url/aio/operations/_paths_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/url/aio/operations/_paths_operations.py index 3aca9d7ca9c..45a98952da1 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/url/aio/operations/_paths_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/url/aio/operations/_paths_operations.py @@ -90,7 +90,7 @@ async def get_boolean_true(self, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -135,7 +135,7 @@ async def get_boolean_false(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -180,7 +180,7 @@ async def get_int_one_million(self, **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -227,7 +227,7 @@ async def get_int_negative_one_million( # pylint: disable=inconsistent-return-s :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -272,7 +272,7 @@ async def get_ten_billion(self, **kwargs: Any) -> None: # pylint: disable=incon :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -317,7 +317,7 @@ async def get_negative_ten_billion(self, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -362,7 +362,7 @@ async def float_scientific_positive(self, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -407,7 +407,7 @@ async def float_scientific_negative(self, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -452,7 +452,7 @@ async def double_decimal_positive(self, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -497,7 +497,7 @@ async def double_decimal_negative(self, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -542,7 +542,7 @@ async def string_unicode(self, **kwargs: Any) -> None: # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -587,7 +587,7 @@ async def string_url_encoded(self, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -634,7 +634,7 @@ async def string_url_non_encoded(self, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -679,7 +679,7 @@ async def string_empty(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -728,7 +728,7 @@ async def string_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -777,7 +777,7 @@ async def enum_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -826,7 +826,7 @@ async def enum_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -874,7 +874,7 @@ async def byte_multi_byte( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -918,7 +918,7 @@ async def byte_empty(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -967,7 +967,7 @@ async def byte_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1011,7 +1011,7 @@ async def date_valid(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1061,7 +1061,7 @@ async def date_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1105,7 +1105,7 @@ async def date_time_valid(self, **kwargs: Any) -> None: # pylint: disable=incon :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1154,7 +1154,7 @@ async def date_time_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1202,7 +1202,7 @@ async def base64_url( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1252,7 +1252,7 @@ async def array_csv_in_path( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1300,7 +1300,7 @@ async def unix_time_url( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/url/aio/operations/_queries_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/url/aio/operations/_queries_operations.py index d8d55a2ecce..7eb2590d1f8 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/url/aio/operations/_queries_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/url/aio/operations/_queries_operations.py @@ -99,7 +99,7 @@ async def get_boolean_true(self, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -144,7 +144,7 @@ async def get_boolean_false(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -193,7 +193,7 @@ async def get_boolean_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -237,7 +237,7 @@ async def get_int_one_million(self, **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -284,7 +284,7 @@ async def get_int_negative_one_million( # pylint: disable=inconsistent-return-s :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +333,7 @@ async def get_int_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -377,7 +377,7 @@ async def get_ten_billion(self, **kwargs: Any) -> None: # pylint: disable=incon :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -422,7 +422,7 @@ async def get_negative_ten_billion(self, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -471,7 +471,7 @@ async def get_long_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -515,7 +515,7 @@ async def float_scientific_positive(self, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -560,7 +560,7 @@ async def float_scientific_negative(self, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -609,7 +609,7 @@ async def float_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -653,7 +653,7 @@ async def double_decimal_positive(self, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -698,7 +698,7 @@ async def double_decimal_negative(self, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -747,7 +747,7 @@ async def double_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -791,7 +791,7 @@ async def string_unicode(self, **kwargs: Any) -> None: # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -836,7 +836,7 @@ async def string_url_encoded(self, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -883,7 +883,7 @@ async def string_empty(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -932,7 +932,7 @@ async def string_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -981,7 +981,7 @@ async def enum_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1030,7 +1030,7 @@ async def enum_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1079,7 +1079,7 @@ async def byte_multi_byte( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1123,7 +1123,7 @@ async def byte_empty(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1172,7 +1172,7 @@ async def byte_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1216,7 +1216,7 @@ async def date_valid(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1265,7 +1265,7 @@ async def date_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1309,7 +1309,7 @@ async def date_time_valid(self, **kwargs: Any) -> None: # pylint: disable=incon :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1360,7 +1360,7 @@ async def date_time_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1410,7 +1410,7 @@ async def array_string_csv_valid( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1458,7 +1458,7 @@ async def array_string_csv_null( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1507,7 +1507,7 @@ async def array_string_csv_empty( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1557,7 +1557,7 @@ async def array_string_no_collection_format_empty( # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1607,7 +1607,7 @@ async def array_string_ssv_valid( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1657,7 +1657,7 @@ async def array_string_tsv_valid( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1707,7 +1707,7 @@ async def array_string_pipes_valid( # pylint: disable=inconsistent-return-state :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/url/operations/_path_items_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/url/operations/_path_items_operations.py index 2773bb8ec5b..792106ec82a 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/url/operations/_path_items_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/url/operations/_path_items_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from msrest import Serializer @@ -252,7 +252,7 @@ def get_all_with_values( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -320,7 +320,7 @@ def get_global_query_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -388,7 +388,7 @@ def get_global_and_local_query_null( # pylint: disable=inconsistent-return-stat :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -455,7 +455,7 @@ def get_local_path_item_query_null( # pylint: disable=inconsistent-return-state :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/url/operations/_paths_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/url/operations/_paths_operations.py index 035cc79e6b0..244c1dc99d9 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/url/operations/_paths_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/url/operations/_paths_operations.py @@ -601,7 +601,7 @@ def get_boolean_true(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -646,7 +646,7 @@ def get_boolean_false(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -691,7 +691,7 @@ def get_int_one_million(self, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -736,7 +736,7 @@ def get_int_negative_one_million(self, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -781,7 +781,7 @@ def get_ten_billion(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -826,7 +826,7 @@ def get_negative_ten_billion(self, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -871,7 +871,7 @@ def float_scientific_positive(self, **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -916,7 +916,7 @@ def float_scientific_negative(self, **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -961,7 +961,7 @@ def double_decimal_positive(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1006,7 +1006,7 @@ def double_decimal_negative(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1051,7 +1051,7 @@ def string_unicode(self, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1096,7 +1096,7 @@ def string_url_encoded(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1143,7 +1143,7 @@ def string_url_non_encoded(self, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1188,7 +1188,7 @@ def string_empty(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1235,7 +1235,7 @@ def string_null(self, string_path: str, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1284,7 +1284,7 @@ def enum_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1333,7 +1333,7 @@ def enum_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1381,7 +1381,7 @@ def byte_multi_byte( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1425,7 +1425,7 @@ def byte_empty(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1472,7 +1472,7 @@ def byte_null(self, byte_path: bytes, **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1516,7 +1516,7 @@ def date_valid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1566,7 +1566,7 @@ def date_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1610,7 +1610,7 @@ def date_time_valid(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1659,7 +1659,7 @@ def date_time_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1707,7 +1707,7 @@ def base64_url( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1757,7 +1757,7 @@ def array_csv_in_path( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1805,7 +1805,7 @@ def unix_time_url( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/url/operations/_queries_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/url/operations/_queries_operations.py index 48c7e93b28d..8a26398ce72 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/url/operations/_queries_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Url/url/operations/_queries_operations.py @@ -741,7 +741,7 @@ def get_boolean_true(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -786,7 +786,7 @@ def get_boolean_false(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -835,7 +835,7 @@ def get_boolean_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -879,7 +879,7 @@ def get_int_one_million(self, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -924,7 +924,7 @@ def get_int_negative_one_million(self, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -973,7 +973,7 @@ def get_int_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1017,7 +1017,7 @@ def get_ten_billion(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1062,7 +1062,7 @@ def get_negative_ten_billion(self, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1111,7 +1111,7 @@ def get_long_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1155,7 +1155,7 @@ def float_scientific_positive(self, **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1200,7 +1200,7 @@ def float_scientific_negative(self, **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1249,7 +1249,7 @@ def float_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1293,7 +1293,7 @@ def double_decimal_positive(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1338,7 +1338,7 @@ def double_decimal_negative(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1387,7 +1387,7 @@ def double_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1431,7 +1431,7 @@ def string_unicode(self, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1476,7 +1476,7 @@ def string_url_encoded(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1523,7 +1523,7 @@ def string_empty(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1572,7 +1572,7 @@ def string_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1621,7 +1621,7 @@ def enum_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1670,7 +1670,7 @@ def enum_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1719,7 +1719,7 @@ def byte_multi_byte( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1763,7 +1763,7 @@ def byte_empty(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1812,7 +1812,7 @@ def byte_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1856,7 +1856,7 @@ def date_valid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1905,7 +1905,7 @@ def date_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1949,7 +1949,7 @@ def date_time_valid(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2000,7 +2000,7 @@ def date_time_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2050,7 +2050,7 @@ def array_string_csv_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2098,7 +2098,7 @@ def array_string_csv_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2147,7 +2147,7 @@ def array_string_csv_empty( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2197,7 +2197,7 @@ def array_string_no_collection_format_empty( # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2247,7 +2247,7 @@ def array_string_ssv_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2297,7 +2297,7 @@ def array_string_tsv_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2347,7 +2347,7 @@ def array_string_pipes_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/UrlMultiCollectionFormat/urlmulticollectionformat/aio/operations/_queries_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/UrlMultiCollectionFormat/urlmulticollectionformat/aio/operations/_queries_operations.py index 3d5ae26e52f..2eeb57af33c 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/UrlMultiCollectionFormat/urlmulticollectionformat/aio/operations/_queries_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/UrlMultiCollectionFormat/urlmulticollectionformat/aio/operations/_queries_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, List, Optional, Type, TypeVar +from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -69,7 +69,7 @@ async def array_string_multi_null( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -118,7 +118,7 @@ async def array_string_multi_empty( # pylint: disable=inconsistent-return-state :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +168,7 @@ async def array_string_multi_valid( # pylint: disable=inconsistent-return-state :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/UrlMultiCollectionFormat/urlmulticollectionformat/operations/_queries_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/UrlMultiCollectionFormat/urlmulticollectionformat/operations/_queries_operations.py index 586565c7247..477db98aeca 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/UrlMultiCollectionFormat/urlmulticollectionformat/operations/_queries_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/UrlMultiCollectionFormat/urlmulticollectionformat/operations/_queries_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, List, Optional, Type, TypeVar +from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -132,7 +132,7 @@ def array_string_multi_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -181,7 +181,7 @@ def array_string_multi_empty( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -231,7 +231,7 @@ def array_string_multi_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Validation/validation/aio/operations/_auto_rest_validation_test_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Validation/validation/aio/operations/_auto_rest_validation_test_operations.py index ada1cd2a9da..9c859ea9efb 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Validation/validation/aio/operations/_auto_rest_validation_test_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Validation/validation/aio/operations/_auto_rest_validation_test_operations.py @@ -58,7 +58,7 @@ async def validation_of_method_parameters( :rtype: ~validation.models.Product :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -173,7 +173,7 @@ async def validation_of_body( :rtype: ~validation.models.Product :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -240,7 +240,7 @@ async def get_with_constant_in_path(self, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -320,7 +320,7 @@ async def post_with_constant_in_body( :rtype: ~validation.models.Product :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Validation/validation/operations/_auto_rest_validation_test_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Validation/validation/operations/_auto_rest_validation_test_operations.py index 9b8c0319501..04136ffc7cc 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Validation/validation/operations/_auto_rest_validation_test_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Validation/validation/operations/_auto_rest_validation_test_operations.py @@ -152,7 +152,7 @@ def validation_of_method_parameters(self, resource_group_name: str, id: int, **k :rtype: ~validation.models.Product :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -267,7 +267,7 @@ def validation_of_body( :rtype: ~validation.models.Product :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -334,7 +334,7 @@ def get_with_constant_in_path(self, **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -414,7 +414,7 @@ def post_with_constant_in_body( :rtype: ~validation.models.Product :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Xml/xmlservice/aio/operations/_xml_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Xml/xmlservice/aio/operations/_xml_operations.py index f689b8b480b..ca4983346b9 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Xml/xmlservice/aio/operations/_xml_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Xml/xmlservice/aio/operations/_xml_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, List, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, List, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -97,7 +97,7 @@ async def get_complex_type_ref_no_meta(self, **kwargs: Any) -> _models.RootWithR :rtype: ~xmlservice.models.RootWithRefAndNoMeta :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -147,7 +147,7 @@ async def put_complex_type_ref_no_meta( # pylint: disable=inconsistent-return-s :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -194,7 +194,7 @@ async def get_complex_type_ref_with_meta(self, **kwargs: Any) -> _models.RootWit :rtype: ~xmlservice.models.RootWithRefAndMeta :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -244,7 +244,7 @@ async def put_complex_type_ref_with_meta( # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -291,7 +291,7 @@ async def get_simple(self, **kwargs: Any) -> _models.Slideshow: :rtype: ~xmlservice.models.Slideshow :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -342,7 +342,7 @@ async def put_simple( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -390,7 +390,7 @@ async def get_wrapped_lists(self, **kwargs: Any) -> _models.AppleBarrel: :rtype: ~xmlservice.models.AppleBarrel :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -440,7 +440,7 @@ async def put_wrapped_lists( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -488,7 +488,7 @@ async def get_headers(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -533,7 +533,7 @@ async def get_empty_list(self, **kwargs: Any) -> _models.Slideshow: :rtype: ~xmlservice.models.Slideshow :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +583,7 @@ async def put_empty_list( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -630,7 +630,7 @@ async def get_empty_wrapped_lists(self, **kwargs: Any) -> _models.AppleBarrel: :rtype: ~xmlservice.models.AppleBarrel :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -680,7 +680,7 @@ async def put_empty_wrapped_lists( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +727,7 @@ async def get_root_list(self, **kwargs: Any) -> List[_models.Banana]: :rtype: list[~xmlservice.models.Banana] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -777,7 +777,7 @@ async def put_root_list( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -825,7 +825,7 @@ async def get_root_list_single_item(self, **kwargs: Any) -> List[_models.Banana] :rtype: list[~xmlservice.models.Banana] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -875,7 +875,7 @@ async def put_root_list_single_item( # pylint: disable=inconsistent-return-stat :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -923,7 +923,7 @@ async def get_empty_root_list(self, **kwargs: Any) -> List[_models.Banana]: :rtype: list[~xmlservice.models.Banana] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -973,7 +973,7 @@ async def put_empty_root_list( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1021,7 +1021,7 @@ async def get_empty_child_element(self, **kwargs: Any) -> _models.Banana: :rtype: ~xmlservice.models.Banana :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1071,7 +1071,7 @@ async def put_empty_child_element( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1118,7 +1118,7 @@ async def list_containers(self, **kwargs: Any) -> _models.ListContainersResponse :rtype: ~xmlservice.models.ListContainersResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1166,7 +1166,7 @@ async def get_service_properties(self, **kwargs: Any) -> _models.StorageServiceP :rtype: ~xmlservice.models.StorageServiceProperties :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1220,7 +1220,7 @@ async def put_service_properties( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1271,7 +1271,7 @@ async def get_acls(self, **kwargs: Any) -> List[_models.SignedIdentifier]: :rtype: list[~xmlservice.models.SignedIdentifier] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1325,7 +1325,7 @@ async def put_acls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1379,7 +1379,7 @@ async def list_blobs(self, **kwargs: Any) -> _models.ListBlobsResponse: :rtype: ~xmlservice.models.ListBlobsResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1434,7 +1434,7 @@ async def json_input( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1482,7 +1482,7 @@ async def json_output(self, **kwargs: Any) -> _models.JSONOutput: :rtype: ~xmlservice.models.JSONOutput :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1529,7 +1529,7 @@ async def get_xms_text(self, **kwargs: Any) -> _models.ObjectWithXMsTextProperty :rtype: ~xmlservice.models.ObjectWithXMsTextProperty :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1575,7 +1575,7 @@ async def get_bytes(self, **kwargs: Any) -> _models.ModelWithByteProperty: :rtype: ~xmlservice.models.ModelWithByteProperty :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1626,7 +1626,7 @@ async def put_binary( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1675,7 +1675,7 @@ async def get_uri(self, **kwargs: Any) -> _models.ModelWithUrlProperty: :rtype: ~xmlservice.models.ModelWithUrlProperty :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1726,7 +1726,7 @@ async def put_uri( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Xml/xmlservice/operations/_xml_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Xml/xmlservice/operations/_xml_operations.py index ef8109a990b..a6b30887ed0 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Xml/xmlservice/operations/_xml_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/Xml/xmlservice/operations/_xml_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, List, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, List, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -590,7 +590,7 @@ def get_complex_type_ref_no_meta(self, **kwargs: Any) -> _models.RootWithRefAndN :rtype: ~xmlservice.models.RootWithRefAndNoMeta :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -640,7 +640,7 @@ def put_complex_type_ref_no_meta( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -687,7 +687,7 @@ def get_complex_type_ref_with_meta(self, **kwargs: Any) -> _models.RootWithRefAn :rtype: ~xmlservice.models.RootWithRefAndMeta :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -737,7 +737,7 @@ def put_complex_type_ref_with_meta( # pylint: disable=inconsistent-return-state :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -784,7 +784,7 @@ def get_simple(self, **kwargs: Any) -> _models.Slideshow: :rtype: ~xmlservice.models.Slideshow :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -835,7 +835,7 @@ def put_simple( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -883,7 +883,7 @@ def get_wrapped_lists(self, **kwargs: Any) -> _models.AppleBarrel: :rtype: ~xmlservice.models.AppleBarrel :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -933,7 +933,7 @@ def put_wrapped_lists( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -981,7 +981,7 @@ def get_headers(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1026,7 +1026,7 @@ def get_empty_list(self, **kwargs: Any) -> _models.Slideshow: :rtype: ~xmlservice.models.Slideshow :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1076,7 +1076,7 @@ def put_empty_list( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1123,7 +1123,7 @@ def get_empty_wrapped_lists(self, **kwargs: Any) -> _models.AppleBarrel: :rtype: ~xmlservice.models.AppleBarrel :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1173,7 +1173,7 @@ def put_empty_wrapped_lists( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1220,7 +1220,7 @@ def get_root_list(self, **kwargs: Any) -> List[_models.Banana]: :rtype: list[~xmlservice.models.Banana] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1270,7 +1270,7 @@ def put_root_list( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1318,7 +1318,7 @@ def get_root_list_single_item(self, **kwargs: Any) -> List[_models.Banana]: :rtype: list[~xmlservice.models.Banana] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1368,7 +1368,7 @@ def put_root_list_single_item( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1416,7 +1416,7 @@ def get_empty_root_list(self, **kwargs: Any) -> List[_models.Banana]: :rtype: list[~xmlservice.models.Banana] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1466,7 +1466,7 @@ def put_empty_root_list( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1514,7 +1514,7 @@ def get_empty_child_element(self, **kwargs: Any) -> _models.Banana: :rtype: ~xmlservice.models.Banana :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1564,7 +1564,7 @@ def put_empty_child_element( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1611,7 +1611,7 @@ def list_containers(self, **kwargs: Any) -> _models.ListContainersResponse: :rtype: ~xmlservice.models.ListContainersResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1659,7 +1659,7 @@ def get_service_properties(self, **kwargs: Any) -> _models.StorageServicePropert :rtype: ~xmlservice.models.StorageServiceProperties :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1713,7 +1713,7 @@ def put_service_properties( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1764,7 +1764,7 @@ def get_acls(self, **kwargs: Any) -> List[_models.SignedIdentifier]: :rtype: list[~xmlservice.models.SignedIdentifier] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1818,7 +1818,7 @@ def put_acls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1872,7 +1872,7 @@ def list_blobs(self, **kwargs: Any) -> _models.ListBlobsResponse: :rtype: ~xmlservice.models.ListBlobsResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1927,7 +1927,7 @@ def json_input( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1975,7 +1975,7 @@ def json_output(self, **kwargs: Any) -> _models.JSONOutput: :rtype: ~xmlservice.models.JSONOutput :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2022,7 +2022,7 @@ def get_xms_text(self, **kwargs: Any) -> _models.ObjectWithXMsTextProperty: :rtype: ~xmlservice.models.ObjectWithXMsTextProperty :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2068,7 +2068,7 @@ def get_bytes(self, **kwargs: Any) -> _models.ModelWithByteProperty: :rtype: ~xmlservice.models.ModelWithByteProperty :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2119,7 +2119,7 @@ def put_binary( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2168,7 +2168,7 @@ def get_uri(self, **kwargs: Any) -> _models.ModelWithUrlProperty: :rtype: ~xmlservice.models.ModelWithUrlProperty :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2219,7 +2219,7 @@ def put_uri( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/XmsErrorResponse/xmserrorresponse/aio/operations/_pet_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/XmsErrorResponse/xmserrorresponse/aio/operations/_pet_operations.py index e6db8207a9a..91beb0892b6 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/XmsErrorResponse/xmserrorresponse/aio/operations/_pet_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/XmsErrorResponse/xmserrorresponse/aio/operations/_pet_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -67,7 +67,7 @@ async def get_pet_by_id(self, pet_id: str, **kwargs: Any) -> Optional[_models.Pe :rtype: ~xmserrorresponse.models.Pet or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 409: ResourceExistsError, 304: ResourceNotModifiedError, @@ -122,7 +122,7 @@ async def do_something(self, what_action: str, **kwargs: Any) -> _models.PetActi :rtype: ~xmserrorresponse.models.PetAction :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -182,7 +182,7 @@ async def has_models_param( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/XmsErrorResponse/xmserrorresponse/operations/_pet_operations.py b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/XmsErrorResponse/xmserrorresponse/operations/_pet_operations.py index 4a141f55178..720f119b8e6 100644 --- a/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/XmsErrorResponse/xmserrorresponse/operations/_pet_operations.py +++ b/packages/autorest.python/test/vanilla/legacy/Expected/AcceptanceTests/XmsErrorResponse/xmserrorresponse/operations/_pet_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -124,7 +124,7 @@ def get_pet_by_id(self, pet_id: str, **kwargs: Any) -> Optional[_models.Pet]: :rtype: ~xmserrorresponse.models.Pet or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 409: ResourceExistsError, 304: ResourceNotModifiedError, @@ -179,7 +179,7 @@ def do_something(self, what_action: str, **kwargs: Any) -> _models.PetAction: :rtype: ~xmserrorresponse.models.PetAction :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +239,7 @@ def has_models_param( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/AdditionalPropertiesVersionTolerant/additionalpropertiesversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/AdditionalPropertiesVersionTolerant/additionalpropertiesversiontolerant/aio/operations/_operations.py index 94f750f899f..20fe127f314 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/AdditionalPropertiesVersionTolerant/additionalpropertiesversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/AdditionalPropertiesVersionTolerant/additionalpropertiesversiontolerant/aio/operations/_operations.py @@ -144,7 +144,7 @@ async def create_ap_true(self, create_parameters: Union[JSON, IO[bytes]], **kwar "status": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -289,7 +289,7 @@ async def create_cat_ap_true(self, create_parameters: Union[JSON, IO[bytes]], ** "status": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -429,7 +429,7 @@ async def create_ap_object(self, create_parameters: Union[JSON, IO[bytes]], **kw "status": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -569,7 +569,7 @@ async def create_ap_string(self, create_parameters: Union[JSON, IO[bytes]], **kw "status": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -709,7 +709,7 @@ async def create_ap_in_properties(self, create_parameters: Union[JSON, IO[bytes] "status": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -871,7 +871,7 @@ async def create_ap_in_properties_with_ap_string( "status": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/AdditionalPropertiesVersionTolerant/additionalpropertiesversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/AdditionalPropertiesVersionTolerant/additionalpropertiesversiontolerant/operations/_operations.py index e2f4474a810..92f286ca599 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/AdditionalPropertiesVersionTolerant/additionalpropertiesversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/AdditionalPropertiesVersionTolerant/additionalpropertiesversiontolerant/operations/_operations.py @@ -242,7 +242,7 @@ def create_ap_true(self, create_parameters: Union[JSON, IO[bytes]], **kwargs: An "status": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -387,7 +387,7 @@ def create_cat_ap_true(self, create_parameters: Union[JSON, IO[bytes]], **kwargs "status": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -527,7 +527,7 @@ def create_ap_object(self, create_parameters: Union[JSON, IO[bytes]], **kwargs: "status": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -667,7 +667,7 @@ def create_ap_string(self, create_parameters: Union[JSON, IO[bytes]], **kwargs: "status": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -807,7 +807,7 @@ def create_ap_in_properties(self, create_parameters: Union[JSON, IO[bytes]], **k "status": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -967,7 +967,7 @@ def create_ap_in_properties_with_ap_string(self, create_parameters: Union[JSON, "status": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/AnythingVersionTolerant/anythingversiontolerant/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/AnythingVersionTolerant/anythingversiontolerant/_operations/_operations.py index 500a58d58f9..ea2d2802804 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/AnythingVersionTolerant/anythingversiontolerant/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/AnythingVersionTolerant/anythingversiontolerant/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -130,7 +130,7 @@ def get_object(self, **kwargs: Any) -> Any: :rtype: any :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -183,7 +183,7 @@ def put_object(self, input: Any, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -231,7 +231,7 @@ def get_string(self, **kwargs: Any) -> Any: :rtype: any :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -284,7 +284,7 @@ def put_string(self, input: Any, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -332,7 +332,7 @@ def get_array(self, **kwargs: Any) -> Any: :rtype: any :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -385,7 +385,7 @@ def put_array(self, input: Any, **kwargs: Any) -> None: # pylint: disable=incon :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/AnythingVersionTolerant/anythingversiontolerant/aio/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/AnythingVersionTolerant/anythingversiontolerant/aio/_operations/_operations.py index 04b83dc94f7..bfd81349d5d 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/AnythingVersionTolerant/anythingversiontolerant/aio/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/AnythingVersionTolerant/anythingversiontolerant/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -50,7 +50,7 @@ async def get_object(self, **kwargs: Any) -> Any: :rtype: any :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -103,7 +103,7 @@ async def put_object(self, input: Any, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -151,7 +151,7 @@ async def get_string(self, **kwargs: Any) -> Any: :rtype: any :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -204,7 +204,7 @@ async def put_string(self, input: Any, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -252,7 +252,7 @@ async def get_array(self, **kwargs: Any) -> Any: :rtype: any :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -305,7 +305,7 @@ async def put_array(self, input: Any, **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyArrayVersionTolerant/bodyarrayversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyArrayVersionTolerant/bodyarrayversiontolerant/aio/operations/_operations.py index 6d3bcb94f96..2c0d1c2a2a6 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyArrayVersionTolerant/bodyarrayversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyArrayVersionTolerant/bodyarrayversiontolerant/aio/operations/_operations.py @@ -138,7 +138,7 @@ async def get_null(self, **kwargs: Any) -> List[int]: 0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -196,7 +196,7 @@ async def get_invalid(self, **kwargs: Any) -> List[int]: 0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -254,7 +254,7 @@ async def get_empty(self, **kwargs: Any) -> List[int]: 0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -348,7 +348,7 @@ async def put_empty( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -411,7 +411,7 @@ async def get_boolean_tfft(self, **kwargs: Any) -> List[bool]: bool # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +505,7 @@ async def put_boolean_tfft( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -568,7 +568,7 @@ async def get_boolean_invalid_null(self, **kwargs: Any) -> List[bool]: bool # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -626,7 +626,7 @@ async def get_boolean_invalid_string(self, **kwargs: Any) -> List[bool]: bool # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -684,7 +684,7 @@ async def get_integer_valid(self, **kwargs: Any) -> List[int]: 0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -778,7 +778,7 @@ async def put_integer_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -841,7 +841,7 @@ async def get_int_invalid_null(self, **kwargs: Any) -> List[int]: 0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -899,7 +899,7 @@ async def get_int_invalid_string(self, **kwargs: Any) -> List[int]: 0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -957,7 +957,7 @@ async def get_long_valid(self, **kwargs: Any) -> List[int]: 0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1051,7 +1051,7 @@ async def put_long_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1114,7 +1114,7 @@ async def get_long_invalid_null(self, **kwargs: Any) -> List[int]: 0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1172,7 +1172,7 @@ async def get_long_invalid_string(self, **kwargs: Any) -> List[int]: 0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1230,7 +1230,7 @@ async def get_float_valid(self, **kwargs: Any) -> List[float]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1324,7 +1324,7 @@ async def put_float_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1387,7 +1387,7 @@ async def get_float_invalid_null(self, **kwargs: Any) -> List[float]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1445,7 +1445,7 @@ async def get_float_invalid_string(self, **kwargs: Any) -> List[float]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1503,7 +1503,7 @@ async def get_double_valid(self, **kwargs: Any) -> List[float]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1597,7 +1597,7 @@ async def put_double_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1660,7 +1660,7 @@ async def get_double_invalid_null(self, **kwargs: Any) -> List[float]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1718,7 +1718,7 @@ async def get_double_invalid_string(self, **kwargs: Any) -> List[float]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1776,7 +1776,7 @@ async def get_string_valid(self, **kwargs: Any) -> List[str]: "str" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1870,7 +1870,7 @@ async def put_string_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1933,7 +1933,7 @@ async def get_enum_valid(self, **kwargs: Any) -> List[str]: "str" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2027,7 +2027,7 @@ async def put_enum_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2090,7 +2090,7 @@ async def get_string_enum_valid(self, **kwargs: Any) -> List[str]: "str" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2184,7 +2184,7 @@ async def put_string_enum_valid( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2247,7 +2247,7 @@ async def get_string_with_null(self, **kwargs: Any) -> List[str]: "str" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2305,7 +2305,7 @@ async def get_string_with_invalid(self, **kwargs: Any) -> List[str]: "str" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2364,7 +2364,7 @@ async def get_uuid_valid(self, **kwargs: Any) -> List[str]: "str" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2461,7 +2461,7 @@ async def put_uuid_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2524,7 +2524,7 @@ async def get_uuid_invalid_chars(self, **kwargs: Any) -> List[str]: "str" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2582,7 +2582,7 @@ async def get_date_valid(self, **kwargs: Any) -> List[datetime.date]: "2020-02-20" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2676,7 +2676,7 @@ async def put_date_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2739,7 +2739,7 @@ async def get_date_invalid_null(self, **kwargs: Any) -> List[datetime.date]: "2020-02-20" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2797,7 +2797,7 @@ async def get_date_invalid_chars(self, **kwargs: Any) -> List[datetime.date]: "2020-02-20" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2856,7 +2856,7 @@ async def get_date_time_valid(self, **kwargs: Any) -> List[datetime.datetime]: "2020-02-20 00:00:00" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2953,7 +2953,7 @@ async def put_date_time_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3016,7 +3016,7 @@ async def get_date_time_invalid_null(self, **kwargs: Any) -> List[datetime.datet "2020-02-20 00:00:00" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3074,7 +3074,7 @@ async def get_date_time_invalid_chars(self, **kwargs: Any) -> List[datetime.date "2020-02-20 00:00:00" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3133,7 +3133,7 @@ async def get_date_time_rfc1123_valid(self, **kwargs: Any) -> List[datetime.date "2020-02-20 00:00:00" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3230,7 +3230,7 @@ async def put_date_time_rfc1123_valid( # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3293,7 +3293,7 @@ async def get_duration_valid(self, **kwargs: Any) -> List[datetime.timedelta]: "1 day, 0:00:00" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3387,7 +3387,7 @@ async def put_duration_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3451,7 +3451,7 @@ async def get_byte_valid(self, **kwargs: Any) -> List[bytes]: bytes("bytes", encoding="utf-8") # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3548,7 +3548,7 @@ async def put_byte_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3611,7 +3611,7 @@ async def get_byte_invalid_null(self, **kwargs: Any) -> List[bytes]: bytes("bytes", encoding="utf-8") # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3670,7 +3670,7 @@ async def get_base64_url(self, **kwargs: Any) -> List[bytes]: bytes("bytes", encoding="utf-8") # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3731,7 +3731,7 @@ async def get_complex_null(self, **kwargs: Any) -> List[JSON]: } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3792,7 +3792,7 @@ async def get_complex_empty(self, **kwargs: Any) -> List[JSON]: } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3854,7 +3854,7 @@ async def get_complex_item_null(self, **kwargs: Any) -> List[JSON]: } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3916,7 +3916,7 @@ async def get_complex_item_empty(self, **kwargs: Any) -> List[JSON]: } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3978,7 +3978,7 @@ async def get_complex_valid(self, **kwargs: Any) -> List[JSON]: } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4078,7 +4078,7 @@ async def put_complex_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4143,7 +4143,7 @@ async def get_array_null(self, **kwargs: Any) -> List[List[str]]: ] ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4203,7 +4203,7 @@ async def get_array_empty(self, **kwargs: Any) -> List[List[str]]: ] ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4263,7 +4263,7 @@ async def get_array_item_null(self, **kwargs: Any) -> List[List[str]]: ] ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4323,7 +4323,7 @@ async def get_array_item_empty(self, **kwargs: Any) -> List[List[str]]: ] ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4383,7 +4383,7 @@ async def get_array_valid(self, **kwargs: Any) -> List[List[str]]: ] ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4479,7 +4479,7 @@ async def put_array_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4544,7 +4544,7 @@ async def get_dictionary_null(self, **kwargs: Any) -> List[Dict[str, str]]: } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4604,7 +4604,7 @@ async def get_dictionary_empty(self, **kwargs: Any) -> List[Dict[str, str]]: } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4665,7 +4665,7 @@ async def get_dictionary_item_null(self, **kwargs: Any) -> List[Dict[str, str]]: } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4726,7 +4726,7 @@ async def get_dictionary_item_empty(self, **kwargs: Any) -> List[Dict[str, str]] } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4787,7 +4787,7 @@ async def get_dictionary_valid(self, **kwargs: Any) -> List[Dict[str, str]]: } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4886,7 +4886,7 @@ async def put_dictionary_valid( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyArrayVersionTolerant/bodyarrayversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyArrayVersionTolerant/bodyarrayversiontolerant/operations/_operations.py index ee00384872e..e0e3c690fda 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyArrayVersionTolerant/bodyarrayversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyArrayVersionTolerant/bodyarrayversiontolerant/operations/_operations.py @@ -1091,7 +1091,7 @@ def get_null(self, **kwargs: Any) -> List[int]: 0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1149,7 +1149,7 @@ def get_invalid(self, **kwargs: Any) -> List[int]: 0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1207,7 +1207,7 @@ def get_empty(self, **kwargs: Any) -> List[int]: 0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1301,7 +1301,7 @@ def put_empty( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1364,7 +1364,7 @@ def get_boolean_tfft(self, **kwargs: Any) -> List[bool]: bool # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1458,7 +1458,7 @@ def put_boolean_tfft( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1521,7 +1521,7 @@ def get_boolean_invalid_null(self, **kwargs: Any) -> List[bool]: bool # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1579,7 +1579,7 @@ def get_boolean_invalid_string(self, **kwargs: Any) -> List[bool]: bool # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1637,7 +1637,7 @@ def get_integer_valid(self, **kwargs: Any) -> List[int]: 0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1731,7 +1731,7 @@ def put_integer_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1794,7 +1794,7 @@ def get_int_invalid_null(self, **kwargs: Any) -> List[int]: 0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1852,7 +1852,7 @@ def get_int_invalid_string(self, **kwargs: Any) -> List[int]: 0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1910,7 +1910,7 @@ def get_long_valid(self, **kwargs: Any) -> List[int]: 0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2004,7 +2004,7 @@ def put_long_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2067,7 +2067,7 @@ def get_long_invalid_null(self, **kwargs: Any) -> List[int]: 0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2125,7 +2125,7 @@ def get_long_invalid_string(self, **kwargs: Any) -> List[int]: 0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2183,7 +2183,7 @@ def get_float_valid(self, **kwargs: Any) -> List[float]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2277,7 +2277,7 @@ def put_float_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2340,7 +2340,7 @@ def get_float_invalid_null(self, **kwargs: Any) -> List[float]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2398,7 +2398,7 @@ def get_float_invalid_string(self, **kwargs: Any) -> List[float]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2456,7 +2456,7 @@ def get_double_valid(self, **kwargs: Any) -> List[float]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2550,7 +2550,7 @@ def put_double_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2613,7 +2613,7 @@ def get_double_invalid_null(self, **kwargs: Any) -> List[float]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2671,7 +2671,7 @@ def get_double_invalid_string(self, **kwargs: Any) -> List[float]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2729,7 +2729,7 @@ def get_string_valid(self, **kwargs: Any) -> List[str]: "str" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2823,7 +2823,7 @@ def put_string_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2886,7 +2886,7 @@ def get_enum_valid(self, **kwargs: Any) -> List[str]: "str" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2980,7 +2980,7 @@ def put_enum_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3043,7 +3043,7 @@ def get_string_enum_valid(self, **kwargs: Any) -> List[str]: "str" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3137,7 +3137,7 @@ def put_string_enum_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3200,7 +3200,7 @@ def get_string_with_null(self, **kwargs: Any) -> List[str]: "str" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3258,7 +3258,7 @@ def get_string_with_invalid(self, **kwargs: Any) -> List[str]: "str" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3317,7 +3317,7 @@ def get_uuid_valid(self, **kwargs: Any) -> List[str]: "str" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3414,7 +3414,7 @@ def put_uuid_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3477,7 +3477,7 @@ def get_uuid_invalid_chars(self, **kwargs: Any) -> List[str]: "str" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3535,7 +3535,7 @@ def get_date_valid(self, **kwargs: Any) -> List[datetime.date]: "2020-02-20" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3629,7 +3629,7 @@ def put_date_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3692,7 +3692,7 @@ def get_date_invalid_null(self, **kwargs: Any) -> List[datetime.date]: "2020-02-20" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3750,7 +3750,7 @@ def get_date_invalid_chars(self, **kwargs: Any) -> List[datetime.date]: "2020-02-20" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3809,7 +3809,7 @@ def get_date_time_valid(self, **kwargs: Any) -> List[datetime.datetime]: "2020-02-20 00:00:00" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3906,7 +3906,7 @@ def put_date_time_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3969,7 +3969,7 @@ def get_date_time_invalid_null(self, **kwargs: Any) -> List[datetime.datetime]: "2020-02-20 00:00:00" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4027,7 +4027,7 @@ def get_date_time_invalid_chars(self, **kwargs: Any) -> List[datetime.datetime]: "2020-02-20 00:00:00" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4086,7 +4086,7 @@ def get_date_time_rfc1123_valid(self, **kwargs: Any) -> List[datetime.datetime]: "2020-02-20 00:00:00" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4183,7 +4183,7 @@ def put_date_time_rfc1123_valid( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4246,7 +4246,7 @@ def get_duration_valid(self, **kwargs: Any) -> List[datetime.timedelta]: "1 day, 0:00:00" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4340,7 +4340,7 @@ def put_duration_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4404,7 +4404,7 @@ def get_byte_valid(self, **kwargs: Any) -> List[bytes]: bytes("bytes", encoding="utf-8") # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4501,7 +4501,7 @@ def put_byte_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4564,7 +4564,7 @@ def get_byte_invalid_null(self, **kwargs: Any) -> List[bytes]: bytes("bytes", encoding="utf-8") # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4623,7 +4623,7 @@ def get_base64_url(self, **kwargs: Any) -> List[bytes]: bytes("bytes", encoding="utf-8") # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4684,7 +4684,7 @@ def get_complex_null(self, **kwargs: Any) -> List[JSON]: } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4745,7 +4745,7 @@ def get_complex_empty(self, **kwargs: Any) -> List[JSON]: } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4807,7 +4807,7 @@ def get_complex_item_null(self, **kwargs: Any) -> List[JSON]: } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4869,7 +4869,7 @@ def get_complex_item_empty(self, **kwargs: Any) -> List[JSON]: } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4931,7 +4931,7 @@ def get_complex_valid(self, **kwargs: Any) -> List[JSON]: } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5031,7 +5031,7 @@ def put_complex_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5096,7 +5096,7 @@ def get_array_null(self, **kwargs: Any) -> List[List[str]]: ] ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5156,7 +5156,7 @@ def get_array_empty(self, **kwargs: Any) -> List[List[str]]: ] ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5216,7 +5216,7 @@ def get_array_item_null(self, **kwargs: Any) -> List[List[str]]: ] ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5276,7 +5276,7 @@ def get_array_item_empty(self, **kwargs: Any) -> List[List[str]]: ] ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5336,7 +5336,7 @@ def get_array_valid(self, **kwargs: Any) -> List[List[str]]: ] ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5432,7 +5432,7 @@ def put_array_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5497,7 +5497,7 @@ def get_dictionary_null(self, **kwargs: Any) -> List[Dict[str, str]]: } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5557,7 +5557,7 @@ def get_dictionary_empty(self, **kwargs: Any) -> List[Dict[str, str]]: } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5618,7 +5618,7 @@ def get_dictionary_item_null(self, **kwargs: Any) -> List[Dict[str, str]]: } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5679,7 +5679,7 @@ def get_dictionary_item_empty(self, **kwargs: Any) -> List[Dict[str, str]]: } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5740,7 +5740,7 @@ def get_dictionary_valid(self, **kwargs: Any) -> List[Dict[str, str]]: } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5839,7 +5839,7 @@ def put_dictionary_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyBinaryVersionTolerant/bodybinaryversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyBinaryVersionTolerant/bodybinaryversiontolerant/aio/operations/_operations.py index 53f4534d42c..959a2dc0dc4 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyBinaryVersionTolerant/bodybinaryversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyBinaryVersionTolerant/bodybinaryversiontolerant/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, cast +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -65,7 +65,7 @@ async def file( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -117,7 +117,7 @@ async def binary( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -183,7 +183,7 @@ async def error_stream(self, **kwargs: Any) -> AsyncIterator[bytes]: :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyBinaryVersionTolerant/bodybinaryversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyBinaryVersionTolerant/bodybinaryversiontolerant/operations/_operations.py index 0030d36849a..87f4992be61 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyBinaryVersionTolerant/bodybinaryversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyBinaryVersionTolerant/bodybinaryversiontolerant/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, IO, Iterator, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, IO, Iterator, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -104,7 +104,7 @@ def file(self, file_param: IO[bytes], **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -154,7 +154,7 @@ def binary(self, file_param: IO[bytes], **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +220,7 @@ def error_stream(self, **kwargs: Any) -> Iterator[bytes]: :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyBooleanVersionTolerant/bodybooleanversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyBooleanVersionTolerant/bodybooleanversiontolerant/aio/operations/_operations.py index 9fba3a923d5..1cd6d1ab128 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyBooleanVersionTolerant/bodybooleanversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyBooleanVersionTolerant/bodybooleanversiontolerant/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -64,7 +64,7 @@ async def get_true(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -114,7 +114,7 @@ async def put_true(self, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -163,7 +163,7 @@ async def get_false(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -213,7 +213,7 @@ async def put_false(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -262,7 +262,7 @@ async def get_null(self, **kwargs: Any) -> Optional[bool]: :rtype: bool or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -312,7 +312,7 @@ async def get_invalid(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyBooleanVersionTolerant/bodybooleanversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyBooleanVersionTolerant/bodybooleanversiontolerant/operations/_operations.py index f92d6abc705..a122d456152 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyBooleanVersionTolerant/bodybooleanversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyBooleanVersionTolerant/bodybooleanversiontolerant/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -152,7 +152,7 @@ def get_true(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -202,7 +202,7 @@ def put_true(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -251,7 +251,7 @@ def get_false(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -301,7 +301,7 @@ def put_false(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -350,7 +350,7 @@ def get_null(self, **kwargs: Any) -> Optional[bool]: :rtype: bool or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -400,7 +400,7 @@ def get_invalid(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyByteVersionTolerant/bodybyteversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyByteVersionTolerant/bodybyteversiontolerant/aio/operations/_operations.py index b21c752eb2c..b614f56789f 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyByteVersionTolerant/bodybyteversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyByteVersionTolerant/bodybyteversiontolerant/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -63,7 +63,7 @@ async def get_null(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -113,7 +113,7 @@ async def get_empty(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -163,7 +163,7 @@ async def get_non_ascii(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -218,7 +218,7 @@ async def put_non_ascii( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -266,7 +266,7 @@ async def get_invalid(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyByteVersionTolerant/bodybyteversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyByteVersionTolerant/bodybyteversiontolerant/operations/_operations.py index 48403d8627e..09d11ed588d 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyByteVersionTolerant/bodybyteversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyByteVersionTolerant/bodybyteversiontolerant/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -133,7 +133,7 @@ def get_null(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -183,7 +183,7 @@ def get_empty(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -233,7 +233,7 @@ def get_non_ascii(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -286,7 +286,7 @@ def put_non_ascii(self, byte_body: bytes, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -334,7 +334,7 @@ def get_invalid(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyComplexVersionTolerant/bodycomplexversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyComplexVersionTolerant/bodycomplexversiontolerant/aio/operations/_operations.py index 72a414e8816..d77ded702b7 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyComplexVersionTolerant/bodycomplexversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyComplexVersionTolerant/bodycomplexversiontolerant/aio/operations/_operations.py @@ -128,7 +128,7 @@ async def get_valid(self, **kwargs: Any) -> JSON: does not fit on a single line and a line break. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -241,7 +241,7 @@ async def put_valid( # pylint: disable=inconsistent-return-statements does not fit on a single line and a line break. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -310,7 +310,7 @@ async def get_invalid(self, **kwargs: Any) -> JSON: does not fit on a single line and a line break. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -373,7 +373,7 @@ async def get_empty(self, **kwargs: Any) -> JSON: does not fit on a single line and a line break. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -436,7 +436,7 @@ async def get_null(self, **kwargs: Any) -> JSON: does not fit on a single line and a line break. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -499,7 +499,7 @@ async def get_not_provided(self, **kwargs: Any) -> JSON: does not fit on a single line and a line break. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -576,7 +576,7 @@ async def get_int(self, **kwargs: Any) -> JSON: "field2": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -680,7 +680,7 @@ async def put_int( # pylint: disable=inconsistent-return-statements "field2": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -744,7 +744,7 @@ async def get_long(self, **kwargs: Any) -> JSON: "field2": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -849,7 +849,7 @@ async def put_long( # pylint: disable=inconsistent-return-statements "field2": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -913,7 +913,7 @@ async def get_float(self, **kwargs: Any) -> JSON: "field2": 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1018,7 +1018,7 @@ async def put_float( # pylint: disable=inconsistent-return-statements "field2": 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1084,7 +1084,7 @@ async def get_double(self, **kwargs: Any) -> JSON: 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1196,7 +1196,7 @@ async def put_double( # pylint: disable=inconsistent-return-statements 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1260,7 +1260,7 @@ async def get_bool(self, **kwargs: Any) -> JSON: "field_true": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1365,7 +1365,7 @@ async def put_bool( # pylint: disable=inconsistent-return-statements "field_true": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1430,7 +1430,7 @@ async def get_string(self, **kwargs: Any) -> JSON: "null": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1537,7 +1537,7 @@ async def put_string( # pylint: disable=inconsistent-return-statements "null": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1601,7 +1601,7 @@ async def get_date(self, **kwargs: Any) -> JSON: "leap": "2020-02-20" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1706,7 +1706,7 @@ async def put_date( # pylint: disable=inconsistent-return-statements "leap": "2020-02-20" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1770,7 +1770,7 @@ async def get_date_time(self, **kwargs: Any) -> JSON: "now": "2020-02-20 00:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1877,7 +1877,7 @@ async def put_date_time( # pylint: disable=inconsistent-return-statements "now": "2020-02-20 00:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1941,7 +1941,7 @@ async def get_date_time_rfc1123(self, **kwargs: Any) -> JSON: "now": "2020-02-20 00:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2048,7 +2048,7 @@ async def put_date_time_rfc1123( # pylint: disable=inconsistent-return-statemen "now": "2020-02-20 00:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2111,7 +2111,7 @@ async def get_duration(self, **kwargs: Any) -> JSON: "field": "1 day, 0:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2214,7 +2214,7 @@ async def put_duration( # pylint: disable=inconsistent-return-statements "field": "1 day, 0:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2277,7 +2277,7 @@ async def get_byte(self, **kwargs: Any) -> JSON: "field": bytes("bytes", encoding="utf-8") # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2382,7 +2382,7 @@ async def put_byte( # pylint: disable=inconsistent-return-statements "field": bytes("bytes", encoding="utf-8") # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2465,7 +2465,7 @@ async def get_valid(self, **kwargs: Any) -> JSON: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2574,7 +2574,7 @@ async def put_valid( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2639,7 +2639,7 @@ async def get_empty(self, **kwargs: Any) -> JSON: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2746,7 +2746,7 @@ async def put_empty( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2811,7 +2811,7 @@ async def get_not_provided(self, **kwargs: Any) -> JSON: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2889,7 +2889,7 @@ async def get_valid(self, **kwargs: Any) -> JSON: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2999,7 +2999,7 @@ async def put_valid( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3064,7 +3064,7 @@ async def get_empty(self, **kwargs: Any) -> JSON: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3171,7 +3171,7 @@ async def put_empty( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3236,7 +3236,7 @@ async def get_null(self, **kwargs: Any) -> JSON: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3296,7 +3296,7 @@ async def get_not_provided(self, **kwargs: Any) -> JSON: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3382,7 +3382,7 @@ async def get_valid(self, **kwargs: Any) -> JSON: "name": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3511,7 +3511,7 @@ async def put_valid( # pylint: disable=inconsistent-return-statements "name": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3647,7 +3647,7 @@ async def get_valid(self, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3955,7 +3955,7 @@ async def put_valid( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. complex_body = fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4027,7 +4027,7 @@ async def get_dot_syntax(self, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == dot_fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4115,7 +4115,7 @@ async def get_composed_with_discriminator(self, **kwargs: Any) -> JSON: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4203,7 +4203,7 @@ async def get_composed_without_discriminator(self, **kwargs: Any) -> JSON: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4276,7 +4276,7 @@ async def get_complicated(self, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == salmon """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4409,7 +4409,7 @@ async def put_complicated( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. complex_body = salmon """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4602,7 +4602,7 @@ async def put_missing_discriminator(self, complex_body: Union[JSON, IO[bytes]], # response body for status code(s): 200 response == salmon """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4907,7 +4907,7 @@ async def put_valid_missing_required( # pylint: disable=inconsistent-return-sta # JSON input template you can fill out and use as your body input. complex_body = fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5043,7 +5043,7 @@ async def get_valid(self, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5411,7 +5411,7 @@ async def put_valid( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. complex_body = fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5493,7 +5493,7 @@ async def get_valid(self, **kwargs: Any) -> JSON: "size": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5597,7 +5597,7 @@ async def put_valid( # pylint: disable=inconsistent-return-statements "size": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5689,7 +5689,7 @@ async def get_valid(self, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == my_base_type """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyComplexVersionTolerant/bodycomplexversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyComplexVersionTolerant/bodycomplexversiontolerant/operations/_operations.py index e5af732518e..c28232f2a7d 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyComplexVersionTolerant/bodycomplexversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyComplexVersionTolerant/bodycomplexversiontolerant/operations/_operations.py @@ -925,7 +925,7 @@ def get_valid(self, **kwargs: Any) -> JSON: does not fit on a single line and a line break. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1038,7 +1038,7 @@ def put_valid( # pylint: disable=inconsistent-return-statements does not fit on a single line and a line break. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1107,7 +1107,7 @@ def get_invalid(self, **kwargs: Any) -> JSON: does not fit on a single line and a line break. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1170,7 +1170,7 @@ def get_empty(self, **kwargs: Any) -> JSON: does not fit on a single line and a line break. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1233,7 +1233,7 @@ def get_null(self, **kwargs: Any) -> JSON: does not fit on a single line and a line break. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1296,7 +1296,7 @@ def get_not_provided(self, **kwargs: Any) -> JSON: does not fit on a single line and a line break. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1373,7 +1373,7 @@ def get_int(self, **kwargs: Any) -> JSON: "field2": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1477,7 +1477,7 @@ def put_int( # pylint: disable=inconsistent-return-statements "field2": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1541,7 +1541,7 @@ def get_long(self, **kwargs: Any) -> JSON: "field2": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1646,7 +1646,7 @@ def put_long( # pylint: disable=inconsistent-return-statements "field2": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1710,7 +1710,7 @@ def get_float(self, **kwargs: Any) -> JSON: "field2": 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1815,7 +1815,7 @@ def put_float( # pylint: disable=inconsistent-return-statements "field2": 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1881,7 +1881,7 @@ def get_double(self, **kwargs: Any) -> JSON: 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1993,7 +1993,7 @@ def put_double( # pylint: disable=inconsistent-return-statements 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2057,7 +2057,7 @@ def get_bool(self, **kwargs: Any) -> JSON: "field_true": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2162,7 +2162,7 @@ def put_bool( # pylint: disable=inconsistent-return-statements "field_true": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2227,7 +2227,7 @@ def get_string(self, **kwargs: Any) -> JSON: "null": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2334,7 +2334,7 @@ def put_string( # pylint: disable=inconsistent-return-statements "null": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2398,7 +2398,7 @@ def get_date(self, **kwargs: Any) -> JSON: "leap": "2020-02-20" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2503,7 +2503,7 @@ def put_date( # pylint: disable=inconsistent-return-statements "leap": "2020-02-20" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2567,7 +2567,7 @@ def get_date_time(self, **kwargs: Any) -> JSON: "now": "2020-02-20 00:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2674,7 +2674,7 @@ def put_date_time( # pylint: disable=inconsistent-return-statements "now": "2020-02-20 00:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2738,7 +2738,7 @@ def get_date_time_rfc1123(self, **kwargs: Any) -> JSON: "now": "2020-02-20 00:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2845,7 +2845,7 @@ def put_date_time_rfc1123( # pylint: disable=inconsistent-return-statements "now": "2020-02-20 00:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2908,7 +2908,7 @@ def get_duration(self, **kwargs: Any) -> JSON: "field": "1 day, 0:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3011,7 +3011,7 @@ def put_duration( # pylint: disable=inconsistent-return-statements "field": "1 day, 0:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3074,7 +3074,7 @@ def get_byte(self, **kwargs: Any) -> JSON: "field": bytes("bytes", encoding="utf-8") # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3179,7 +3179,7 @@ def put_byte( # pylint: disable=inconsistent-return-statements "field": bytes("bytes", encoding="utf-8") # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3262,7 +3262,7 @@ def get_valid(self, **kwargs: Any) -> JSON: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3371,7 +3371,7 @@ def put_valid( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3436,7 +3436,7 @@ def get_empty(self, **kwargs: Any) -> JSON: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3543,7 +3543,7 @@ def put_empty( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3608,7 +3608,7 @@ def get_not_provided(self, **kwargs: Any) -> JSON: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3686,7 +3686,7 @@ def get_valid(self, **kwargs: Any) -> JSON: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3796,7 +3796,7 @@ def put_valid( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3861,7 +3861,7 @@ def get_empty(self, **kwargs: Any) -> JSON: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3968,7 +3968,7 @@ def put_empty( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4033,7 +4033,7 @@ def get_null(self, **kwargs: Any) -> JSON: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4093,7 +4093,7 @@ def get_not_provided(self, **kwargs: Any) -> JSON: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4179,7 +4179,7 @@ def get_valid(self, **kwargs: Any) -> JSON: "name": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4308,7 +4308,7 @@ def put_valid( # pylint: disable=inconsistent-return-statements "name": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4444,7 +4444,7 @@ def get_valid(self, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4752,7 +4752,7 @@ def put_valid( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. complex_body = fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4824,7 +4824,7 @@ def get_dot_syntax(self, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == dot_fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4912,7 +4912,7 @@ def get_composed_with_discriminator(self, **kwargs: Any) -> JSON: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5000,7 +5000,7 @@ def get_composed_without_discriminator(self, **kwargs: Any) -> JSON: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5073,7 +5073,7 @@ def get_complicated(self, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == salmon """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5206,7 +5206,7 @@ def put_complicated( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. complex_body = salmon """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5399,7 +5399,7 @@ def put_missing_discriminator(self, complex_body: Union[JSON, IO[bytes]], **kwar # response body for status code(s): 200 response == salmon """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5704,7 +5704,7 @@ def put_valid_missing_required( # pylint: disable=inconsistent-return-statement # JSON input template you can fill out and use as your body input. complex_body = fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5840,7 +5840,7 @@ def get_valid(self, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6208,7 +6208,7 @@ def put_valid( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. complex_body = fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6290,7 +6290,7 @@ def get_valid(self, **kwargs: Any) -> JSON: "size": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6394,7 +6394,7 @@ def put_valid( # pylint: disable=inconsistent-return-statements "size": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6486,7 +6486,7 @@ def get_valid(self, **kwargs: Any) -> JSON: # response body for status code(s): 200 response == my_base_type """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateTimeRfc1123VersionTolerant/bodydatetimerfc1123versiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateTimeRfc1123VersionTolerant/bodydatetimerfc1123versiontolerant/aio/operations/_operations.py index 022f2664ada..bf52b981b30 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateTimeRfc1123VersionTolerant/bodydatetimerfc1123versiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateTimeRfc1123VersionTolerant/bodydatetimerfc1123versiontolerant/aio/operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -68,7 +68,7 @@ async def get_null(self, **kwargs: Any) -> Optional[datetime.datetime]: :rtype: ~datetime.datetime or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -118,7 +118,7 @@ async def get_invalid(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +168,7 @@ async def get_overflow(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -218,7 +218,7 @@ async def get_underflow(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -272,7 +272,7 @@ async def put_utc_max_date_time( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -320,7 +320,7 @@ async def get_utc_lowercase_max_date_time(self, **kwargs: Any) -> datetime.datet :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +370,7 @@ async def get_utc_uppercase_max_date_time(self, **kwargs: Any) -> datetime.datet :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -424,7 +424,7 @@ async def put_utc_min_date_time( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +472,7 @@ async def get_utc_min_date_time(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateTimeRfc1123VersionTolerant/bodydatetimerfc1123versiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateTimeRfc1123VersionTolerant/bodydatetimerfc1123versiontolerant/operations/_operations.py index bdd7477418b..bdc135b22f8 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateTimeRfc1123VersionTolerant/bodydatetimerfc1123versiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateTimeRfc1123VersionTolerant/bodydatetimerfc1123versiontolerant/operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -201,7 +201,7 @@ def get_null(self, **kwargs: Any) -> Optional[datetime.datetime]: :rtype: ~datetime.datetime or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -251,7 +251,7 @@ def get_invalid(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -301,7 +301,7 @@ def get_overflow(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -351,7 +351,7 @@ def get_underflow(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -405,7 +405,7 @@ def put_utc_max_date_time( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -453,7 +453,7 @@ def get_utc_lowercase_max_date_time(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -503,7 +503,7 @@ def get_utc_uppercase_max_date_time(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -557,7 +557,7 @@ def put_utc_min_date_time( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -605,7 +605,7 @@ def get_utc_min_date_time(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateTimeVersionTolerant/bodydatetimeversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateTimeVersionTolerant/bodydatetimeversiontolerant/aio/operations/_operations.py index a40998c25c6..5b4d88d0539 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateTimeVersionTolerant/bodydatetimeversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateTimeVersionTolerant/bodydatetimeversiontolerant/aio/operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -81,7 +81,7 @@ async def get_null(self, **kwargs: Any) -> Optional[datetime.datetime]: :rtype: ~datetime.datetime or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -131,7 +131,7 @@ async def get_invalid(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -181,7 +181,7 @@ async def get_overflow(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -231,7 +231,7 @@ async def get_underflow(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -285,7 +285,7 @@ async def put_utc_max_date_time( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -340,7 +340,7 @@ async def put_utc_max_date_time7_digits( # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -388,7 +388,7 @@ async def get_utc_lowercase_max_date_time(self, **kwargs: Any) -> datetime.datet :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -438,7 +438,7 @@ async def get_utc_uppercase_max_date_time(self, **kwargs: Any) -> datetime.datet :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -491,7 +491,7 @@ async def get_utc_uppercase_max_date_time7_digits(self, **kwargs: Any) -> dateti :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -545,7 +545,7 @@ async def put_local_positive_offset_max_date_time( # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -595,7 +595,7 @@ async def get_local_positive_offset_lowercase_max_date_time( # pylint: disable= :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -647,7 +647,7 @@ async def get_local_positive_offset_uppercase_max_date_time( # pylint: disable= :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -701,7 +701,7 @@ async def put_local_negative_offset_max_date_time( # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -751,7 +751,7 @@ async def get_local_negative_offset_uppercase_max_date_time( # pylint: disable= :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -803,7 +803,7 @@ async def get_local_negative_offset_lowercase_max_date_time( # pylint: disable= :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -857,7 +857,7 @@ async def put_utc_min_date_time( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -905,7 +905,7 @@ async def get_utc_min_date_time(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -959,7 +959,7 @@ async def put_local_positive_offset_min_date_time( # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1007,7 +1007,7 @@ async def get_local_positive_offset_min_date_time(self, **kwargs: Any) -> dateti :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1061,7 +1061,7 @@ async def put_local_negative_offset_min_date_time( # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1109,7 +1109,7 @@ async def get_local_negative_offset_min_date_time(self, **kwargs: Any) -> dateti :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1159,7 +1159,7 @@ async def get_local_no_offset_min_date_time(self, **kwargs: Any) -> datetime.dat :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateTimeVersionTolerant/bodydatetimeversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateTimeVersionTolerant/bodydatetimeversiontolerant/operations/_operations.py index 0137a9edd50..b584b381bcb 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateTimeVersionTolerant/bodydatetimeversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateTimeVersionTolerant/bodydatetimeversiontolerant/operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -424,7 +424,7 @@ def get_null(self, **kwargs: Any) -> Optional[datetime.datetime]: :rtype: ~datetime.datetime or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -474,7 +474,7 @@ def get_invalid(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -524,7 +524,7 @@ def get_overflow(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -574,7 +574,7 @@ def get_underflow(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -628,7 +628,7 @@ def put_utc_max_date_time( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -683,7 +683,7 @@ def put_utc_max_date_time7_digits( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -731,7 +731,7 @@ def get_utc_lowercase_max_date_time(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -781,7 +781,7 @@ def get_utc_uppercase_max_date_time(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -834,7 +834,7 @@ def get_utc_uppercase_max_date_time7_digits(self, **kwargs: Any) -> datetime.dat :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -888,7 +888,7 @@ def put_local_positive_offset_max_date_time( # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -938,7 +938,7 @@ def get_local_positive_offset_lowercase_max_date_time( # pylint: disable=name-t :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -990,7 +990,7 @@ def get_local_positive_offset_uppercase_max_date_time( # pylint: disable=name-t :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1044,7 +1044,7 @@ def put_local_negative_offset_max_date_time( # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1094,7 +1094,7 @@ def get_local_negative_offset_uppercase_max_date_time( # pylint: disable=name-t :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1146,7 +1146,7 @@ def get_local_negative_offset_lowercase_max_date_time( # pylint: disable=name-t :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1200,7 +1200,7 @@ def put_utc_min_date_time( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1248,7 +1248,7 @@ def get_utc_min_date_time(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1302,7 +1302,7 @@ def put_local_positive_offset_min_date_time( # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1350,7 +1350,7 @@ def get_local_positive_offset_min_date_time(self, **kwargs: Any) -> datetime.dat :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1404,7 +1404,7 @@ def put_local_negative_offset_min_date_time( # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1452,7 +1452,7 @@ def get_local_negative_offset_min_date_time(self, **kwargs: Any) -> datetime.dat :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1502,7 +1502,7 @@ def get_local_no_offset_min_date_time(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateVersionTolerant/bodydateversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateVersionTolerant/bodydateversiontolerant/aio/operations/_operations.py index ec1e41a56bb..b90c4cac4e0 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateVersionTolerant/bodydateversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateVersionTolerant/bodydateversiontolerant/aio/operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -67,7 +67,7 @@ async def get_null(self, **kwargs: Any) -> Optional[datetime.date]: :rtype: ~datetime.date or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -117,7 +117,7 @@ async def get_invalid_date(self, **kwargs: Any) -> datetime.date: :rtype: ~datetime.date :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -167,7 +167,7 @@ async def get_overflow_date(self, **kwargs: Any) -> datetime.date: :rtype: ~datetime.date :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -217,7 +217,7 @@ async def get_underflow_date(self, **kwargs: Any) -> datetime.date: :rtype: ~datetime.date :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -271,7 +271,7 @@ async def put_max_date( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -319,7 +319,7 @@ async def get_max_date(self, **kwargs: Any) -> datetime.date: :rtype: ~datetime.date :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -373,7 +373,7 @@ async def put_min_date( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -421,7 +421,7 @@ async def get_min_date(self, **kwargs: Any) -> datetime.date: :rtype: ~datetime.date :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateVersionTolerant/bodydateversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateVersionTolerant/bodydateversiontolerant/operations/_operations.py index 7f429566cb9..5cf5d1811c8 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateVersionTolerant/bodydateversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDateVersionTolerant/bodydateversiontolerant/operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -179,7 +179,7 @@ def get_null(self, **kwargs: Any) -> Optional[datetime.date]: :rtype: ~datetime.date or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -229,7 +229,7 @@ def get_invalid_date(self, **kwargs: Any) -> datetime.date: :rtype: ~datetime.date :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -279,7 +279,7 @@ def get_overflow_date(self, **kwargs: Any) -> datetime.date: :rtype: ~datetime.date :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -329,7 +329,7 @@ def get_underflow_date(self, **kwargs: Any) -> datetime.date: :rtype: ~datetime.date :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -383,7 +383,7 @@ def put_max_date( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -431,7 +431,7 @@ def get_max_date(self, **kwargs: Any) -> datetime.date: :rtype: ~datetime.date :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -485,7 +485,7 @@ def put_min_date( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -533,7 +533,7 @@ def get_min_date(self, **kwargs: Any) -> datetime.date: :rtype: ~datetime.date :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDictionaryVersionTolerant/bodydictionaryversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDictionaryVersionTolerant/bodydictionaryversiontolerant/aio/operations/_operations.py index 6ebd96dc078..04ceac3f504 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDictionaryVersionTolerant/bodydictionaryversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDictionaryVersionTolerant/bodydictionaryversiontolerant/aio/operations/_operations.py @@ -134,7 +134,7 @@ async def get_null(self, **kwargs: Any) -> Dict[str, int]: "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -192,7 +192,7 @@ async def get_empty(self, **kwargs: Any) -> Dict[str, int]: "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -286,7 +286,7 @@ async def put_empty( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -349,7 +349,7 @@ async def get_null_value(self, **kwargs: Any) -> Dict[str, str]: "str": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -407,7 +407,7 @@ async def get_null_key(self, **kwargs: Any) -> Dict[str, str]: "str": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -465,7 +465,7 @@ async def get_empty_string_key(self, **kwargs: Any) -> Dict[str, str]: "str": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -523,7 +523,7 @@ async def get_invalid(self, **kwargs: Any) -> Dict[str, str]: "str": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -581,7 +581,7 @@ async def get_boolean_tfft(self, **kwargs: Any) -> Dict[str, bool]: "str": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -675,7 +675,7 @@ async def put_boolean_tfft( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -738,7 +738,7 @@ async def get_boolean_invalid_null(self, **kwargs: Any) -> Dict[str, bool]: "str": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -796,7 +796,7 @@ async def get_boolean_invalid_string(self, **kwargs: Any) -> Dict[str, bool]: "str": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -854,7 +854,7 @@ async def get_integer_valid(self, **kwargs: Any) -> Dict[str, int]: "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -948,7 +948,7 @@ async def put_integer_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1011,7 +1011,7 @@ async def get_int_invalid_null(self, **kwargs: Any) -> Dict[str, int]: "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1069,7 +1069,7 @@ async def get_int_invalid_string(self, **kwargs: Any) -> Dict[str, int]: "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1127,7 +1127,7 @@ async def get_long_valid(self, **kwargs: Any) -> Dict[str, int]: "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1221,7 +1221,7 @@ async def put_long_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1284,7 +1284,7 @@ async def get_long_invalid_null(self, **kwargs: Any) -> Dict[str, int]: "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1342,7 +1342,7 @@ async def get_long_invalid_string(self, **kwargs: Any) -> Dict[str, int]: "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1400,7 +1400,7 @@ async def get_float_valid(self, **kwargs: Any) -> Dict[str, float]: "str": 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1494,7 +1494,7 @@ async def put_float_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1557,7 +1557,7 @@ async def get_float_invalid_null(self, **kwargs: Any) -> Dict[str, float]: "str": 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1615,7 +1615,7 @@ async def get_float_invalid_string(self, **kwargs: Any) -> Dict[str, float]: "str": 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1673,7 +1673,7 @@ async def get_double_valid(self, **kwargs: Any) -> Dict[str, float]: "str": 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1767,7 +1767,7 @@ async def put_double_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1830,7 +1830,7 @@ async def get_double_invalid_null(self, **kwargs: Any) -> Dict[str, float]: "str": 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1888,7 +1888,7 @@ async def get_double_invalid_string(self, **kwargs: Any) -> Dict[str, float]: "str": 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1946,7 +1946,7 @@ async def get_string_valid(self, **kwargs: Any) -> Dict[str, str]: "str": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2040,7 +2040,7 @@ async def put_string_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2103,7 +2103,7 @@ async def get_string_with_null(self, **kwargs: Any) -> Dict[str, str]: "str": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2161,7 +2161,7 @@ async def get_string_with_invalid(self, **kwargs: Any) -> Dict[str, str]: "str": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2219,7 +2219,7 @@ async def get_date_valid(self, **kwargs: Any) -> Dict[str, datetime.date]: "str": "2020-02-20" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2313,7 +2313,7 @@ async def put_date_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2376,7 +2376,7 @@ async def get_date_invalid_null(self, **kwargs: Any) -> Dict[str, datetime.date] "str": "2020-02-20" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2434,7 +2434,7 @@ async def get_date_invalid_chars(self, **kwargs: Any) -> Dict[str, datetime.date "str": "2020-02-20" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2493,7 +2493,7 @@ async def get_date_time_valid(self, **kwargs: Any) -> Dict[str, datetime.datetim "str": "2020-02-20 00:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2590,7 +2590,7 @@ async def put_date_time_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2653,7 +2653,7 @@ async def get_date_time_invalid_null(self, **kwargs: Any) -> Dict[str, datetime. "str": "2020-02-20 00:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2711,7 +2711,7 @@ async def get_date_time_invalid_chars(self, **kwargs: Any) -> Dict[str, datetime "str": "2020-02-20 00:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2770,7 +2770,7 @@ async def get_date_time_rfc1123_valid(self, **kwargs: Any) -> Dict[str, datetime "str": "2020-02-20 00:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2867,7 +2867,7 @@ async def put_date_time_rfc1123_valid( # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2930,7 +2930,7 @@ async def get_duration_valid(self, **kwargs: Any) -> Dict[str, datetime.timedelt "str": "1 day, 0:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3024,7 +3024,7 @@ async def put_duration_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3088,7 +3088,7 @@ async def get_byte_valid(self, **kwargs: Any) -> Dict[str, bytes]: "str": bytes("bytes", encoding="utf-8") # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3185,7 +3185,7 @@ async def put_byte_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3249,7 +3249,7 @@ async def get_byte_invalid_null(self, **kwargs: Any) -> Dict[str, bytes]: "str": bytes("bytes", encoding="utf-8") # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3308,7 +3308,7 @@ async def get_base64_url(self, **kwargs: Any) -> Dict[str, bytes]: "str": bytes("bytes", encoding="utf-8") # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3369,7 +3369,7 @@ async def get_complex_null(self, **kwargs: Any) -> Optional[Dict[str, JSON]]: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3430,7 +3430,7 @@ async def get_complex_empty(self, **kwargs: Any) -> Dict[str, JSON]: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3492,7 +3492,7 @@ async def get_complex_item_null(self, **kwargs: Any) -> Dict[str, JSON]: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3554,7 +3554,7 @@ async def get_complex_item_empty(self, **kwargs: Any) -> Dict[str, JSON]: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3616,7 +3616,7 @@ async def get_complex_valid(self, **kwargs: Any) -> Dict[str, JSON]: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3716,7 +3716,7 @@ async def put_complex_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3781,7 +3781,7 @@ async def get_array_null(self, **kwargs: Any) -> Optional[Dict[str, List[str]]]: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3841,7 +3841,7 @@ async def get_array_empty(self, **kwargs: Any) -> Dict[str, List[str]]: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3901,7 +3901,7 @@ async def get_array_item_null(self, **kwargs: Any) -> Dict[str, List[str]]: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3961,7 +3961,7 @@ async def get_array_item_empty(self, **kwargs: Any) -> Dict[str, List[str]]: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4022,7 +4022,7 @@ async def get_array_valid(self, **kwargs: Any) -> Dict[str, List[str]]: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4121,7 +4121,7 @@ async def put_array_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4186,7 +4186,7 @@ async def get_dictionary_null(self, **kwargs: Any) -> Dict[str, Dict[str, str]]: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4246,7 +4246,7 @@ async def get_dictionary_empty(self, **kwargs: Any) -> Dict[str, Dict[str, str]] } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4307,7 +4307,7 @@ async def get_dictionary_item_null(self, **kwargs: Any) -> Dict[str, Dict[str, s } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4368,7 +4368,7 @@ async def get_dictionary_item_empty(self, **kwargs: Any) -> Dict[str, Dict[str, } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4430,7 +4430,7 @@ async def get_dictionary_valid(self, **kwargs: Any) -> Dict[str, Dict[str, str]] } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4532,7 +4532,7 @@ async def put_dictionary_valid( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDictionaryVersionTolerant/bodydictionaryversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDictionaryVersionTolerant/bodydictionaryversiontolerant/operations/_operations.py index a947474723a..189cb904362 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDictionaryVersionTolerant/bodydictionaryversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDictionaryVersionTolerant/bodydictionaryversiontolerant/operations/_operations.py @@ -1026,7 +1026,7 @@ def get_null(self, **kwargs: Any) -> Dict[str, int]: "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1084,7 +1084,7 @@ def get_empty(self, **kwargs: Any) -> Dict[str, int]: "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1178,7 +1178,7 @@ def put_empty( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1241,7 +1241,7 @@ def get_null_value(self, **kwargs: Any) -> Dict[str, str]: "str": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1299,7 +1299,7 @@ def get_null_key(self, **kwargs: Any) -> Dict[str, str]: "str": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1357,7 +1357,7 @@ def get_empty_string_key(self, **kwargs: Any) -> Dict[str, str]: "str": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1415,7 +1415,7 @@ def get_invalid(self, **kwargs: Any) -> Dict[str, str]: "str": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1473,7 +1473,7 @@ def get_boolean_tfft(self, **kwargs: Any) -> Dict[str, bool]: "str": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1567,7 +1567,7 @@ def put_boolean_tfft( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1630,7 +1630,7 @@ def get_boolean_invalid_null(self, **kwargs: Any) -> Dict[str, bool]: "str": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1688,7 +1688,7 @@ def get_boolean_invalid_string(self, **kwargs: Any) -> Dict[str, bool]: "str": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1746,7 +1746,7 @@ def get_integer_valid(self, **kwargs: Any) -> Dict[str, int]: "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1840,7 +1840,7 @@ def put_integer_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1903,7 +1903,7 @@ def get_int_invalid_null(self, **kwargs: Any) -> Dict[str, int]: "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1961,7 +1961,7 @@ def get_int_invalid_string(self, **kwargs: Any) -> Dict[str, int]: "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2019,7 +2019,7 @@ def get_long_valid(self, **kwargs: Any) -> Dict[str, int]: "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2113,7 +2113,7 @@ def put_long_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2176,7 +2176,7 @@ def get_long_invalid_null(self, **kwargs: Any) -> Dict[str, int]: "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2234,7 +2234,7 @@ def get_long_invalid_string(self, **kwargs: Any) -> Dict[str, int]: "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2292,7 +2292,7 @@ def get_float_valid(self, **kwargs: Any) -> Dict[str, float]: "str": 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2386,7 +2386,7 @@ def put_float_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2449,7 +2449,7 @@ def get_float_invalid_null(self, **kwargs: Any) -> Dict[str, float]: "str": 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2507,7 +2507,7 @@ def get_float_invalid_string(self, **kwargs: Any) -> Dict[str, float]: "str": 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2565,7 +2565,7 @@ def get_double_valid(self, **kwargs: Any) -> Dict[str, float]: "str": 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2659,7 +2659,7 @@ def put_double_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2722,7 +2722,7 @@ def get_double_invalid_null(self, **kwargs: Any) -> Dict[str, float]: "str": 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2780,7 +2780,7 @@ def get_double_invalid_string(self, **kwargs: Any) -> Dict[str, float]: "str": 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2838,7 +2838,7 @@ def get_string_valid(self, **kwargs: Any) -> Dict[str, str]: "str": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2932,7 +2932,7 @@ def put_string_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2995,7 +2995,7 @@ def get_string_with_null(self, **kwargs: Any) -> Dict[str, str]: "str": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3053,7 +3053,7 @@ def get_string_with_invalid(self, **kwargs: Any) -> Dict[str, str]: "str": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3111,7 +3111,7 @@ def get_date_valid(self, **kwargs: Any) -> Dict[str, datetime.date]: "str": "2020-02-20" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3205,7 +3205,7 @@ def put_date_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3268,7 +3268,7 @@ def get_date_invalid_null(self, **kwargs: Any) -> Dict[str, datetime.date]: "str": "2020-02-20" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3326,7 +3326,7 @@ def get_date_invalid_chars(self, **kwargs: Any) -> Dict[str, datetime.date]: "str": "2020-02-20" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3385,7 +3385,7 @@ def get_date_time_valid(self, **kwargs: Any) -> Dict[str, datetime.datetime]: "str": "2020-02-20 00:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3482,7 +3482,7 @@ def put_date_time_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3545,7 +3545,7 @@ def get_date_time_invalid_null(self, **kwargs: Any) -> Dict[str, datetime.dateti "str": "2020-02-20 00:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3603,7 +3603,7 @@ def get_date_time_invalid_chars(self, **kwargs: Any) -> Dict[str, datetime.datet "str": "2020-02-20 00:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3662,7 +3662,7 @@ def get_date_time_rfc1123_valid(self, **kwargs: Any) -> Dict[str, datetime.datet "str": "2020-02-20 00:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3759,7 +3759,7 @@ def put_date_time_rfc1123_valid( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3822,7 +3822,7 @@ def get_duration_valid(self, **kwargs: Any) -> Dict[str, datetime.timedelta]: "str": "1 day, 0:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3916,7 +3916,7 @@ def put_duration_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3980,7 +3980,7 @@ def get_byte_valid(self, **kwargs: Any) -> Dict[str, bytes]: "str": bytes("bytes", encoding="utf-8") # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4077,7 +4077,7 @@ def put_byte_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4141,7 +4141,7 @@ def get_byte_invalid_null(self, **kwargs: Any) -> Dict[str, bytes]: "str": bytes("bytes", encoding="utf-8") # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4200,7 +4200,7 @@ def get_base64_url(self, **kwargs: Any) -> Dict[str, bytes]: "str": bytes("bytes", encoding="utf-8") # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4261,7 +4261,7 @@ def get_complex_null(self, **kwargs: Any) -> Optional[Dict[str, JSON]]: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4322,7 +4322,7 @@ def get_complex_empty(self, **kwargs: Any) -> Dict[str, JSON]: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4384,7 +4384,7 @@ def get_complex_item_null(self, **kwargs: Any) -> Dict[str, JSON]: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4446,7 +4446,7 @@ def get_complex_item_empty(self, **kwargs: Any) -> Dict[str, JSON]: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4508,7 +4508,7 @@ def get_complex_valid(self, **kwargs: Any) -> Dict[str, JSON]: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4608,7 +4608,7 @@ def put_complex_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4673,7 +4673,7 @@ def get_array_null(self, **kwargs: Any) -> Optional[Dict[str, List[str]]]: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4733,7 +4733,7 @@ def get_array_empty(self, **kwargs: Any) -> Dict[str, List[str]]: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4793,7 +4793,7 @@ def get_array_item_null(self, **kwargs: Any) -> Dict[str, List[str]]: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4853,7 +4853,7 @@ def get_array_item_empty(self, **kwargs: Any) -> Dict[str, List[str]]: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4914,7 +4914,7 @@ def get_array_valid(self, **kwargs: Any) -> Dict[str, List[str]]: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5013,7 +5013,7 @@ def put_array_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5078,7 +5078,7 @@ def get_dictionary_null(self, **kwargs: Any) -> Dict[str, Dict[str, str]]: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5138,7 +5138,7 @@ def get_dictionary_empty(self, **kwargs: Any) -> Dict[str, Dict[str, str]]: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5199,7 +5199,7 @@ def get_dictionary_item_null(self, **kwargs: Any) -> Dict[str, Dict[str, str]]: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5260,7 +5260,7 @@ def get_dictionary_item_empty(self, **kwargs: Any) -> Dict[str, Dict[str, str]]: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5322,7 +5322,7 @@ def get_dictionary_valid(self, **kwargs: Any) -> Dict[str, Dict[str, str]]: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5424,7 +5424,7 @@ def put_dictionary_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDurationVersionTolerant/bodydurationversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDurationVersionTolerant/bodydurationversiontolerant/aio/operations/_operations.py index d83541e2e02..b09d2393546 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDurationVersionTolerant/bodydurationversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDurationVersionTolerant/bodydurationversiontolerant/aio/operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -63,7 +63,7 @@ async def get_null(self, **kwargs: Any) -> Optional[datetime.timedelta]: :rtype: ~datetime.timedelta or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -117,7 +117,7 @@ async def put_positive_duration( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +165,7 @@ async def get_positive_duration(self, **kwargs: Any) -> datetime.timedelta: :rtype: ~datetime.timedelta :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -215,7 +215,7 @@ async def get_invalid(self, **kwargs: Any) -> datetime.timedelta: :rtype: ~datetime.timedelta :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDurationVersionTolerant/bodydurationversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDurationVersionTolerant/bodydurationversiontolerant/operations/_operations.py index 50e1d1adc5d..721a011698b 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDurationVersionTolerant/bodydurationversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyDurationVersionTolerant/bodydurationversiontolerant/operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -122,7 +122,7 @@ def get_null(self, **kwargs: Any) -> Optional[datetime.timedelta]: :rtype: ~datetime.timedelta or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -176,7 +176,7 @@ def put_positive_duration( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -224,7 +224,7 @@ def get_positive_duration(self, **kwargs: Any) -> datetime.timedelta: :rtype: ~datetime.timedelta :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -274,7 +274,7 @@ def get_invalid(self, **kwargs: Any) -> datetime.timedelta: :rtype: ~datetime.timedelta :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFileVersionTolerant/bodyfileversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFileVersionTolerant/bodyfileversiontolerant/aio/operations/_operations.py index dcd16a8650c..ece55e6a8a5 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFileVersionTolerant/bodyfileversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFileVersionTolerant/bodyfileversiontolerant/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterator, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, AsyncIterator, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -60,7 +60,7 @@ async def get_file(self, **kwargs: Any) -> AsyncIterator[bytes]: :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -107,7 +107,7 @@ async def get_file_large(self, **kwargs: Any) -> AsyncIterator[bytes]: :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -154,7 +154,7 @@ async def get_empty_file(self, **kwargs: Any) -> AsyncIterator[bytes]: :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFileVersionTolerant/bodyfileversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFileVersionTolerant/bodyfileversiontolerant/operations/_operations.py index 562f3db9f79..284bcbaa7cf 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFileVersionTolerant/bodyfileversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFileVersionTolerant/bodyfileversiontolerant/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterator, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Iterator, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -102,7 +102,7 @@ def get_file(self, **kwargs: Any) -> Iterator[bytes]: :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -149,7 +149,7 @@ def get_file_large(self, **kwargs: Any) -> Iterator[bytes]: :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -196,7 +196,7 @@ def get_empty_file(self, **kwargs: Any) -> Iterator[bytes]: :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFormDataVersionTolerant/bodyformdataversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFormDataVersionTolerant/bodyformdataversiontolerant/aio/operations/_operations.py index ff249a03d38..e5df7181f0a 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFormDataVersionTolerant/bodyformdataversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFormDataVersionTolerant/bodyformdataversiontolerant/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, cast +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -68,7 +68,7 @@ async def upload_file_via_body(self, file_content: IO[bytes], **kwargs: Any) -> :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFormDataVersionTolerant/bodyformdataversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFormDataVersionTolerant/bodyformdataversiontolerant/operations/_operations.py index b6e0e95bc2d..8669e10fc25 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFormDataVersionTolerant/bodyformdataversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFormDataVersionTolerant/bodyformdataversiontolerant/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, IO, Iterator, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, IO, Iterator, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -90,7 +90,7 @@ def upload_file_via_body(self, file_content: IO[bytes], **kwargs: Any) -> Iterat :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyIntegerVersionTolerant/bodyintegerversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyIntegerVersionTolerant/bodyintegerversiontolerant/aio/operations/_operations.py index 3f24e1aac01..27f34b5a6cd 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyIntegerVersionTolerant/bodyintegerversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyIntegerVersionTolerant/bodyintegerversiontolerant/aio/operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -73,7 +73,7 @@ async def get_null(self, **kwargs: Any) -> Optional[int]: :rtype: int or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -123,7 +123,7 @@ async def get_invalid(self, **kwargs: Any) -> int: :rtype: int :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -173,7 +173,7 @@ async def get_overflow_int32(self, **kwargs: Any) -> int: :rtype: int :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -223,7 +223,7 @@ async def get_underflow_int32(self, **kwargs: Any) -> int: :rtype: int :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -273,7 +273,7 @@ async def get_overflow_int64(self, **kwargs: Any) -> int: :rtype: int :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -323,7 +323,7 @@ async def get_underflow_int64(self, **kwargs: Any) -> int: :rtype: int :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -375,7 +375,7 @@ async def put_max32(self, int_body: int, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -425,7 +425,7 @@ async def put_max64(self, int_body: int, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -475,7 +475,7 @@ async def put_min32(self, int_body: int, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -525,7 +525,7 @@ async def put_min64(self, int_body: int, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -573,7 +573,7 @@ async def get_unix_time(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -627,7 +627,7 @@ async def put_unix_time_date( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -675,7 +675,7 @@ async def get_invalid_unix_time(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -725,7 +725,7 @@ async def get_null_unix_time(self, **kwargs: Any) -> Optional[datetime.datetime] :rtype: ~datetime.datetime or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyIntegerVersionTolerant/bodyintegerversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyIntegerVersionTolerant/bodyintegerversiontolerant/operations/_operations.py index 14d2bbab314..da8fb92ad21 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyIntegerVersionTolerant/bodyintegerversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyIntegerVersionTolerant/bodyintegerversiontolerant/operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -274,7 +274,7 @@ def get_null(self, **kwargs: Any) -> Optional[int]: :rtype: int or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -324,7 +324,7 @@ def get_invalid(self, **kwargs: Any) -> int: :rtype: int :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -374,7 +374,7 @@ def get_overflow_int32(self, **kwargs: Any) -> int: :rtype: int :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -424,7 +424,7 @@ def get_underflow_int32(self, **kwargs: Any) -> int: :rtype: int :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -474,7 +474,7 @@ def get_overflow_int64(self, **kwargs: Any) -> int: :rtype: int :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -524,7 +524,7 @@ def get_underflow_int64(self, **kwargs: Any) -> int: :rtype: int :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -576,7 +576,7 @@ def put_max32(self, int_body: int, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -626,7 +626,7 @@ def put_max64(self, int_body: int, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -676,7 +676,7 @@ def put_min32(self, int_body: int, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -726,7 +726,7 @@ def put_min64(self, int_body: int, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -774,7 +774,7 @@ def get_unix_time(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -828,7 +828,7 @@ def put_unix_time_date( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -876,7 +876,7 @@ def get_invalid_unix_time(self, **kwargs: Any) -> datetime.datetime: :rtype: ~datetime.datetime :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -926,7 +926,7 @@ def get_null_unix_time(self, **kwargs: Any) -> Optional[datetime.datetime]: :rtype: ~datetime.datetime or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyNumberVersionTolerant/bodynumberversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyNumberVersionTolerant/bodynumberversiontolerant/aio/operations/_operations.py index 53978940eb3..df043d96523 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyNumberVersionTolerant/bodynumberversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyNumberVersionTolerant/bodynumberversiontolerant/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -82,7 +82,7 @@ async def get_null(self, **kwargs: Any) -> Optional[float]: :rtype: float or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -132,7 +132,7 @@ async def get_invalid_float(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -182,7 +182,7 @@ async def get_invalid_double(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -232,7 +232,7 @@ async def get_invalid_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -286,7 +286,7 @@ async def put_big_float( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -334,7 +334,7 @@ async def get_big_float(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -388,7 +388,7 @@ async def put_big_double( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -436,7 +436,7 @@ async def get_big_double(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -488,7 +488,7 @@ async def put_big_double_positive_decimal( # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -537,7 +537,7 @@ async def get_big_double_positive_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -589,7 +589,7 @@ async def put_big_double_negative_decimal( # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -638,7 +638,7 @@ async def get_big_double_negative_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -692,7 +692,7 @@ async def put_big_decimal( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -740,7 +740,7 @@ async def get_big_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -792,7 +792,7 @@ async def put_big_decimal_positive_decimal( # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -841,7 +841,7 @@ async def get_big_decimal_positive_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -893,7 +893,7 @@ async def put_big_decimal_negative_decimal( # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -942,7 +942,7 @@ async def get_big_decimal_negative_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -996,7 +996,7 @@ async def put_small_float( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1044,7 +1044,7 @@ async def get_small_float(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1098,7 +1098,7 @@ async def put_small_double( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1146,7 +1146,7 @@ async def get_small_double(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1200,7 +1200,7 @@ async def put_small_decimal( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1248,7 +1248,7 @@ async def get_small_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyNumberVersionTolerant/bodynumberversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyNumberVersionTolerant/bodynumberversiontolerant/operations/_operations.py index 1ff8367fc79..0eb4ab58c9a 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyNumberVersionTolerant/bodynumberversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyNumberVersionTolerant/bodynumberversiontolerant/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -438,7 +438,7 @@ def get_null(self, **kwargs: Any) -> Optional[float]: :rtype: float or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -488,7 +488,7 @@ def get_invalid_float(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -538,7 +538,7 @@ def get_invalid_double(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +588,7 @@ def get_invalid_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -642,7 +642,7 @@ def put_big_float( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -690,7 +690,7 @@ def get_big_float(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -744,7 +744,7 @@ def put_big_double( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -792,7 +792,7 @@ def get_big_double(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -842,7 +842,7 @@ def put_big_double_positive_decimal(self, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -891,7 +891,7 @@ def get_big_double_positive_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -941,7 +941,7 @@ def put_big_double_negative_decimal(self, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -990,7 +990,7 @@ def get_big_double_negative_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1044,7 +1044,7 @@ def put_big_decimal( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1092,7 +1092,7 @@ def get_big_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1142,7 +1142,7 @@ def put_big_decimal_positive_decimal(self, **kwargs: Any) -> None: # pylint: di :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1191,7 +1191,7 @@ def get_big_decimal_positive_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1241,7 +1241,7 @@ def put_big_decimal_negative_decimal(self, **kwargs: Any) -> None: # pylint: di :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1290,7 +1290,7 @@ def get_big_decimal_negative_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1344,7 +1344,7 @@ def put_small_float( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1392,7 +1392,7 @@ def get_small_float(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1446,7 +1446,7 @@ def put_small_double( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1494,7 +1494,7 @@ def get_small_double(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1548,7 +1548,7 @@ def put_small_decimal( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1596,7 +1596,7 @@ def get_small_decimal(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyStringVersionTolerant/bodystringversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyStringVersionTolerant/bodystringversiontolerant/aio/operations/_operations.py index 6578c7dcdfa..7623bbdac3b 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyStringVersionTolerant/bodystringversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyStringVersionTolerant/bodystringversiontolerant/aio/operations/_operations.py @@ -79,7 +79,7 @@ async def get_null(self, **kwargs: Any) -> Optional[str]: :rtype: str or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -133,7 +133,7 @@ async def put_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -184,7 +184,7 @@ async def get_empty(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -234,7 +234,7 @@ async def put_empty(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -283,7 +283,7 @@ async def get_mbcs(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +333,7 @@ async def put_mbcs(self, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +386,7 @@ async def get_whitespace(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -438,7 +438,7 @@ async def put_whitespace(self, **kwargs: Any) -> None: # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -489,7 +489,7 @@ async def get_not_provided(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -539,7 +539,7 @@ async def get_base64_encoded(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -589,7 +589,7 @@ async def get_base64_url_encoded(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -643,7 +643,7 @@ async def put_base64_url_encoded( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -691,7 +691,7 @@ async def get_null_base64_url_encoded(self, **kwargs: Any) -> Optional[bytes]: :rtype: bytes or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -759,7 +759,7 @@ async def get_not_expandable(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -814,7 +814,7 @@ async def put_not_expandable( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -862,7 +862,7 @@ async def get_referenced(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -917,7 +917,7 @@ async def put_referenced( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -975,7 +975,7 @@ async def get_referenced_constant(self, **kwargs: Any) -> JSON: "field1": "str" # Optional. Sample string. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1081,7 +1081,7 @@ async def put_referenced_constant( # pylint: disable=inconsistent-return-statem "field1": "str" # Optional. Sample string. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyStringVersionTolerant/bodystringversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyStringVersionTolerant/bodystringversiontolerant/operations/_operations.py index f049a91b427..b565d71cb03 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyStringVersionTolerant/bodystringversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyStringVersionTolerant/bodystringversiontolerant/operations/_operations.py @@ -361,7 +361,7 @@ def get_null(self, **kwargs: Any) -> Optional[str]: :rtype: str or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -415,7 +415,7 @@ def put_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -466,7 +466,7 @@ def get_empty(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -516,7 +516,7 @@ def put_empty(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -565,7 +565,7 @@ def get_mbcs(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -615,7 +615,7 @@ def put_mbcs(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -668,7 +668,7 @@ def get_whitespace(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -720,7 +720,7 @@ def put_whitespace(self, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -771,7 +771,7 @@ def get_not_provided(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -821,7 +821,7 @@ def get_base64_encoded(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -871,7 +871,7 @@ def get_base64_url_encoded(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -925,7 +925,7 @@ def put_base64_url_encoded( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -973,7 +973,7 @@ def get_null_base64_url_encoded(self, **kwargs: Any) -> Optional[bytes]: :rtype: bytes or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1041,7 +1041,7 @@ def get_not_expandable(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1096,7 +1096,7 @@ def put_not_expandable( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1144,7 +1144,7 @@ def get_referenced(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1199,7 +1199,7 @@ def put_referenced( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1257,7 +1257,7 @@ def get_referenced_constant(self, **kwargs: Any) -> JSON: "field1": "str" # Optional. Sample string. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1363,7 +1363,7 @@ def put_referenced_constant( # pylint: disable=inconsistent-return-statements "field1": "str" # Optional. Sample string. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyTimeVersionTolerant/bodytimeversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyTimeVersionTolerant/bodytimeversiontolerant/aio/operations/_operations.py index 5e4b3a41aca..49014835ee2 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyTimeVersionTolerant/bodytimeversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyTimeVersionTolerant/bodytimeversiontolerant/aio/operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -58,7 +58,7 @@ async def get(self, **kwargs: Any) -> datetime.time: :rtype: ~datetime.time :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -110,7 +110,7 @@ async def put(self, time_body: datetime.time, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyTimeVersionTolerant/bodytimeversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyTimeVersionTolerant/bodytimeversiontolerant/operations/_operations.py index 5f19c1354af..b1751c2c0e3 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyTimeVersionTolerant/bodytimeversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyTimeVersionTolerant/bodytimeversiontolerant/operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -92,7 +92,7 @@ def get(self, **kwargs: Any) -> datetime.time: :rtype: ~datetime.time :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -144,7 +144,7 @@ def put(self, time_body: datetime.time, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ClientEnumVersionTolerant/clientenumversiontolerant/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ClientEnumVersionTolerant/clientenumversiontolerant/_operations/_operations.py index 6aabecbb014..b8cf497566f 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ClientEnumVersionTolerant/clientenumversiontolerant/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ClientEnumVersionTolerant/clientenumversiontolerant/_operations/_operations.py @@ -58,7 +58,7 @@ def head(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ClientEnumVersionTolerant/clientenumversiontolerant/aio/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ClientEnumVersionTolerant/clientenumversiontolerant/aio/_operations/_operations.py index f0bee746bfb..49372757cae 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ClientEnumVersionTolerant/clientenumversiontolerant/aio/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ClientEnumVersionTolerant/clientenumversiontolerant/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -41,7 +41,7 @@ async def head(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ConstantsVersionTolerant/constantsversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ConstantsVersionTolerant/constantsversiontolerant/aio/operations/_operations.py index d9beb77e64a..e10ef7d620d 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ConstantsVersionTolerant/constantsversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ConstantsVersionTolerant/constantsversiontolerant/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -81,7 +81,7 @@ async def put_no_model_as_string_no_required_two_value_no_default( # pylint: di :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -131,7 +131,7 @@ async def put_no_model_as_string_no_required_two_value_default( # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -181,7 +181,7 @@ async def put_no_model_as_string_no_required_one_value_no_default( # pylint: di :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -231,7 +231,7 @@ async def put_no_model_as_string_no_required_one_value_default( # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -281,7 +281,7 @@ async def put_no_model_as_string_required_two_value_no_default( # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +331,7 @@ async def put_no_model_as_string_required_two_value_default( # pylint: disable= :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -379,7 +379,7 @@ async def put_no_model_as_string_required_one_value_no_default( # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -428,7 +428,7 @@ async def put_no_model_as_string_required_one_value_default( # pylint: disable= :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -479,7 +479,7 @@ async def put_model_as_string_no_required_two_value_no_default( # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -529,7 +529,7 @@ async def put_model_as_string_no_required_two_value_default( # pylint: disable= :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -579,7 +579,7 @@ async def put_model_as_string_no_required_one_value_no_default( # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -629,7 +629,7 @@ async def put_model_as_string_no_required_one_value_default( # pylint: disable= :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -679,7 +679,7 @@ async def put_model_as_string_required_two_value_no_default( # pylint: disable= :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -729,7 +729,7 @@ async def put_model_as_string_required_two_value_default( # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -779,7 +779,7 @@ async def put_model_as_string_required_one_value_no_default( # pylint: disable= :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -829,7 +829,7 @@ async def put_model_as_string_required_one_value_default( # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -874,7 +874,7 @@ async def put_client_constants(self, **kwargs: Any) -> None: # pylint: disable= :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ConstantsVersionTolerant/constantsversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ConstantsVersionTolerant/constantsversiontolerant/operations/_operations.py index 2ec961779d2..369be9ac4e3 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ConstantsVersionTolerant/constantsversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ConstantsVersionTolerant/constantsversiontolerant/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -324,7 +324,7 @@ def put_no_model_as_string_no_required_two_value_no_default( # pylint: disable= :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -374,7 +374,7 @@ def put_no_model_as_string_no_required_two_value_default( # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -424,7 +424,7 @@ def put_no_model_as_string_no_required_one_value_no_default( # pylint: disable= :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -474,7 +474,7 @@ def put_no_model_as_string_no_required_one_value_default( # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -524,7 +524,7 @@ def put_no_model_as_string_required_two_value_no_default( # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -574,7 +574,7 @@ def put_no_model_as_string_required_two_value_default( # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -622,7 +622,7 @@ def put_no_model_as_string_required_one_value_no_default( # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -671,7 +671,7 @@ def put_no_model_as_string_required_one_value_default( # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -722,7 +722,7 @@ def put_model_as_string_no_required_two_value_no_default( # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -772,7 +772,7 @@ def put_model_as_string_no_required_two_value_default( # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -822,7 +822,7 @@ def put_model_as_string_no_required_one_value_no_default( # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -872,7 +872,7 @@ def put_model_as_string_no_required_one_value_default( # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -922,7 +922,7 @@ def put_model_as_string_required_two_value_no_default( # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -972,7 +972,7 @@ def put_model_as_string_required_two_value_default( # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1022,7 +1022,7 @@ def put_model_as_string_required_one_value_no_default( # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1072,7 +1072,7 @@ def put_model_as_string_required_one_value_default( # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1117,7 +1117,7 @@ def put_client_constants(self, **kwargs: Any) -> None: # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/CustomBaseUriMoreOptionsVersionTolerant/custombaseurlmoreoptionsversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/CustomBaseUriMoreOptionsVersionTolerant/custombaseurlmoreoptionsversiontolerant/aio/operations/_operations.py index e57268f72e4..a0f32782371 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/CustomBaseUriMoreOptionsVersionTolerant/custombaseurlmoreoptionsversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/CustomBaseUriMoreOptionsVersionTolerant/custombaseurlmoreoptionsversiontolerant/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -66,7 +66,7 @@ async def get_empty( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/CustomBaseUriMoreOptionsVersionTolerant/custombaseurlmoreoptionsversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/CustomBaseUriMoreOptionsVersionTolerant/custombaseurlmoreoptionsversiontolerant/operations/_operations.py index 9b8c6df6311..5edf618c5d5 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/CustomBaseUriMoreOptionsVersionTolerant/custombaseurlmoreoptionsversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/CustomBaseUriMoreOptionsVersionTolerant/custombaseurlmoreoptionsversiontolerant/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -97,7 +97,7 @@ def get_empty( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/CustomBaseUriVersionTolerant/custombaseurlversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/CustomBaseUriVersionTolerant/custombaseurlversiontolerant/aio/operations/_operations.py index 37d9c210da9..8b0d932290e 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/CustomBaseUriVersionTolerant/custombaseurlversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/CustomBaseUriVersionTolerant/custombaseurlversiontolerant/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -60,7 +60,7 @@ async def get_empty( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/CustomBaseUriVersionTolerant/custombaseurlversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/CustomBaseUriVersionTolerant/custombaseurlversiontolerant/operations/_operations.py index c70f52c14d4..c76a4254912 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/CustomBaseUriVersionTolerant/custombaseurlversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/CustomBaseUriVersionTolerant/custombaseurlversiontolerant/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -76,7 +76,7 @@ def get_empty(self, account_name: str, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ErrorWithSecretsVersionTolerant/errorwithsecretsversiontolerant/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ErrorWithSecretsVersionTolerant/errorwithsecretsversiontolerant/_operations/_operations.py index 102832359db..682c89e2ec1 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ErrorWithSecretsVersionTolerant/errorwithsecretsversiontolerant/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ErrorWithSecretsVersionTolerant/errorwithsecretsversiontolerant/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -85,7 +85,7 @@ def create_secret(self, **kwargs: Any) -> JSON: "value": "str" # The secret value. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -135,7 +135,7 @@ def get_error_with_secrets(self, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ErrorWithSecretsVersionTolerant/errorwithsecretsversiontolerant/aio/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ErrorWithSecretsVersionTolerant/errorwithsecretsversiontolerant/aio/_operations/_operations.py index 697cfb7ae38..9aa037b3133 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ErrorWithSecretsVersionTolerant/errorwithsecretsversiontolerant/aio/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ErrorWithSecretsVersionTolerant/errorwithsecretsversiontolerant/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -54,7 +54,7 @@ async def create_secret(self, **kwargs: Any) -> JSON: "value": "str" # The secret value. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -104,7 +104,7 @@ async def get_error_with_secrets(self, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ExtensibleEnumsVersionTolerant/extensibleenumsswaggerversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ExtensibleEnumsVersionTolerant/extensibleenumsswaggerversiontolerant/aio/operations/_operations.py index 4f732908e08..9a9739e10b6 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ExtensibleEnumsVersionTolerant/extensibleenumsswaggerversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ExtensibleEnumsVersionTolerant/extensibleenumsswaggerversiontolerant/aio/operations/_operations.py @@ -74,7 +74,7 @@ async def get_by_pet_id(self, pet_id: str, **kwargs: Any) -> JSON: "name": "str" # Optional. name. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -216,7 +216,7 @@ async def add_pet(self, pet_param: Optional[Union[JSON, IO[bytes]]] = None, **kw "name": "str" # Optional. name. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ExtensibleEnumsVersionTolerant/extensibleenumsswaggerversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ExtensibleEnumsVersionTolerant/extensibleenumsswaggerversiontolerant/operations/_operations.py index 736a6228a72..f0eabde8b47 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ExtensibleEnumsVersionTolerant/extensibleenumsswaggerversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ExtensibleEnumsVersionTolerant/extensibleenumsswaggerversiontolerant/operations/_operations.py @@ -113,7 +113,7 @@ def get_by_pet_id(self, pet_id: str, **kwargs: Any) -> JSON: "name": "str" # Optional. name. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -255,7 +255,7 @@ def add_pet(self, pet_param: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: "name": "str" # Optional. name. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/HeaderVersionTolerant/headerversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/HeaderVersionTolerant/headerversiontolerant/aio/operations/_operations.py index ec195449b3c..b6aa46ffe9b 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/HeaderVersionTolerant/headerversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/HeaderVersionTolerant/headerversiontolerant/aio/operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -92,7 +92,7 @@ async def param_existing_key( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -136,7 +136,7 @@ async def response_existing_key(self, **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -182,7 +182,7 @@ async def param_protected_key(self, **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -227,7 +227,7 @@ async def response_protected_key(self, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -281,7 +281,7 @@ async def param_integer( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +331,7 @@ async def response_integer( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +386,7 @@ async def param_long( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -436,7 +436,7 @@ async def response_long( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -491,7 +491,7 @@ async def param_float( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -541,7 +541,7 @@ async def response_float( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +596,7 @@ async def param_double( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -646,7 +646,7 @@ async def response_double( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -701,7 +701,7 @@ async def param_bool( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -751,7 +751,7 @@ async def response_bool( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -807,7 +807,7 @@ async def param_string( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -857,7 +857,7 @@ async def response_string( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -912,7 +912,7 @@ async def param_date( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -962,7 +962,7 @@ async def response_date( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1018,7 +1018,7 @@ async def param_datetime( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1068,7 +1068,7 @@ async def response_datetime( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1124,7 +1124,7 @@ async def param_datetime_rfc1123( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1175,7 +1175,7 @@ async def response_datetime_rfc1123( # pylint: disable=inconsistent-return-stat :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1228,7 +1228,7 @@ async def param_duration( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1277,7 +1277,7 @@ async def response_duration( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1330,7 +1330,7 @@ async def param_byte( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1379,7 +1379,7 @@ async def response_byte( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1435,7 +1435,7 @@ async def param_enum( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1485,7 +1485,7 @@ async def response_enum( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1533,7 +1533,7 @@ async def custom_request_id(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/HeaderVersionTolerant/headerversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/HeaderVersionTolerant/headerversiontolerant/operations/_operations.py index 597cf0f415b..937647c3adb 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/HeaderVersionTolerant/headerversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/HeaderVersionTolerant/headerversiontolerant/operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -518,7 +518,7 @@ def param_existing_key( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -562,7 +562,7 @@ def response_existing_key(self, **kwargs: Any) -> None: # pylint: disable=incon :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -608,7 +608,7 @@ def param_protected_key(self, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -653,7 +653,7 @@ def response_protected_key(self, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -707,7 +707,7 @@ def param_integer( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -757,7 +757,7 @@ def response_integer( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -812,7 +812,7 @@ def param_long( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -860,7 +860,7 @@ def response_long(self, *, scenario: str, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -915,7 +915,7 @@ def param_float( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -963,7 +963,7 @@ def response_float(self, *, scenario: str, **kwargs: Any) -> None: # pylint: di :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1018,7 +1018,7 @@ def param_double( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1068,7 +1068,7 @@ def response_double( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1123,7 +1123,7 @@ def param_bool( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1171,7 +1171,7 @@ def response_bool(self, *, scenario: str, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1227,7 +1227,7 @@ def param_string( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1277,7 +1277,7 @@ def response_string( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1332,7 +1332,7 @@ def param_date( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1380,7 +1380,7 @@ def response_date(self, *, scenario: str, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1436,7 +1436,7 @@ def param_datetime( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1486,7 +1486,7 @@ def response_datetime( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1542,7 +1542,7 @@ def param_datetime_rfc1123( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1593,7 +1593,7 @@ def response_datetime_rfc1123( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1646,7 +1646,7 @@ def param_duration( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1695,7 +1695,7 @@ def response_duration( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1748,7 +1748,7 @@ def param_byte( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1795,7 +1795,7 @@ def response_byte(self, *, scenario: str, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1851,7 +1851,7 @@ def param_enum( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1899,7 +1899,7 @@ def response_enum(self, *, scenario: str, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1947,7 +1947,7 @@ def custom_request_id(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/HttpVersionTolerant/httpinfrastructureversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/HttpVersionTolerant/httpinfrastructureversiontolerant/aio/operations/_operations.py index 2a9eef3a3e8..9616f363dd7 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/HttpVersionTolerant/httpinfrastructureversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/HttpVersionTolerant/httpinfrastructureversiontolerant/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, List, Literal, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, List, Literal, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -170,7 +170,7 @@ async def get_empty_error(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +220,7 @@ async def get_no_model_error(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -270,7 +270,7 @@ async def get_no_model_empty(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -338,7 +338,7 @@ async def head200(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -381,7 +381,7 @@ async def get200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -431,7 +431,7 @@ async def options200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -486,7 +486,7 @@ async def put200( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -542,7 +542,7 @@ async def patch200( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -598,7 +598,7 @@ async def post200( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -654,7 +654,7 @@ async def delete200( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -710,7 +710,7 @@ async def put201( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -766,7 +766,7 @@ async def post201( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -822,7 +822,7 @@ async def put202( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -878,7 +878,7 @@ async def patch202( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -934,7 +934,7 @@ async def post202( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -990,7 +990,7 @@ async def delete202( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1041,7 +1041,7 @@ async def head204(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1089,7 +1089,7 @@ async def put204( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1145,7 +1145,7 @@ async def patch204( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1201,7 +1201,7 @@ async def post204( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1257,7 +1257,7 @@ async def delete204( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1308,7 +1308,7 @@ async def head404(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1369,7 +1369,7 @@ async def head300(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1424,7 +1424,7 @@ async def get300(self, **kwargs: Any) -> Optional[List[str]]: "str" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1479,7 +1479,7 @@ async def head301(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1526,7 +1526,7 @@ async def get301(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1579,7 +1579,7 @@ async def put301( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1633,7 +1633,7 @@ async def head302(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1680,7 +1680,7 @@ async def get302(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1733,7 +1733,7 @@ async def patch302( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1793,7 +1793,7 @@ async def post303( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1848,7 +1848,7 @@ async def head307(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1895,7 +1895,7 @@ async def get307(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1942,7 +1942,7 @@ async def options307(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1994,7 +1994,7 @@ async def put307( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2054,7 +2054,7 @@ async def patch307( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2114,7 +2114,7 @@ async def post307( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2174,7 +2174,7 @@ async def delete307( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2247,7 +2247,7 @@ async def head400(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2290,7 +2290,7 @@ async def get400(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2333,7 +2333,7 @@ async def options400(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2381,7 +2381,7 @@ async def put400( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2437,7 +2437,7 @@ async def patch400( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2493,7 +2493,7 @@ async def post400( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2549,7 +2549,7 @@ async def delete400( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2600,7 +2600,7 @@ async def head401(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2643,7 +2643,7 @@ async def get402(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2686,7 +2686,7 @@ async def options403(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2729,7 +2729,7 @@ async def get403(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2777,7 +2777,7 @@ async def put404( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2833,7 +2833,7 @@ async def patch405( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2889,7 +2889,7 @@ async def post406( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2945,7 +2945,7 @@ async def delete407( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3001,7 +3001,7 @@ async def put409( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3052,7 +3052,7 @@ async def head410(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3095,7 +3095,7 @@ async def get411(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3138,7 +3138,7 @@ async def options412(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3181,7 +3181,7 @@ async def get412(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3229,7 +3229,7 @@ async def put413( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3285,7 +3285,7 @@ async def patch414( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3341,7 +3341,7 @@ async def post415( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3392,7 +3392,7 @@ async def get416(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3440,7 +3440,7 @@ async def delete417( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3491,7 +3491,7 @@ async def head429(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3552,7 +3552,7 @@ async def head501(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3595,7 +3595,7 @@ async def get501(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3643,7 +3643,7 @@ async def post505( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3699,7 +3699,7 @@ async def delete505( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3768,7 +3768,7 @@ async def head408(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3816,7 +3816,7 @@ async def put500( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3872,7 +3872,7 @@ async def patch500( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3923,7 +3923,7 @@ async def get502(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3966,7 +3966,7 @@ async def options502(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4021,7 +4021,7 @@ async def post503( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4077,7 +4077,7 @@ async def delete503( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4133,7 +4133,7 @@ async def put504( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4189,7 +4189,7 @@ async def patch504( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4268,7 +4268,7 @@ async def get200_model204_no_model_default_error200_valid( # pylint: disable=na "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4330,7 +4330,7 @@ async def get200_model204_no_model_default_error204_valid( # pylint: disable=na "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4392,7 +4392,7 @@ async def get200_model204_no_model_default_error201_invalid( # pylint: disable= "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4454,7 +4454,7 @@ async def get200_model204_no_model_default_error202_none( # pylint: disable=nam "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4516,7 +4516,7 @@ async def get200_model204_no_model_default_error400_valid( # pylint: disable=na "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4583,7 +4583,7 @@ async def get200_model201_model_default_error200_valid( # pylint: disable=name- "textStatusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4655,7 +4655,7 @@ async def get200_model201_model_default_error201_valid( # pylint: disable=name- "textStatusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4727,7 +4727,7 @@ async def get200_model201_model_default_error400_valid( # pylint: disable=name- "textStatusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4802,7 +4802,7 @@ async def get200_model_a201_model_c404_model_d_default_error200_valid( # pylint "httpStatusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4883,7 +4883,7 @@ async def get200_model_a201_model_c404_model_d_default_error201_valid( # pylint "httpStatusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4964,7 +4964,7 @@ async def get200_model_a201_model_c404_model_d_default_error404_valid( # pylint "httpStatusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5045,7 +5045,7 @@ async def get200_model_a201_model_c404_model_d_default_error400_valid( # pylint "httpStatusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5110,7 +5110,7 @@ async def get202_none204_none_default_error202_none( # pylint: disable=inconsis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5155,7 +5155,7 @@ async def get202_none204_none_default_error204_none( # pylint: disable=inconsis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5200,7 +5200,7 @@ async def get202_none204_none_default_error400_valid( # pylint: disable=inconsi :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5245,7 +5245,7 @@ async def get202_none204_none_default_none202_invalid( # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5290,7 +5290,7 @@ async def get202_none204_none_default_none204_none( # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5335,7 +5335,7 @@ async def get202_none204_none_default_none400_none( # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5380,7 +5380,7 @@ async def get202_none204_none_default_none400_invalid( # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5431,7 +5431,7 @@ async def get_default_model_a200_valid(self, **kwargs: Any) -> JSON: "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5489,7 +5489,7 @@ async def get_default_model_a200_none(self, **kwargs: Any) -> JSON: "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5541,7 +5541,7 @@ async def get_default_model_a400_valid( # pylint: disable=inconsistent-return-s :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5586,7 +5586,7 @@ async def get_default_model_a400_none( # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5631,7 +5631,7 @@ async def get_default_none200_invalid( # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5674,7 +5674,7 @@ async def get_default_none200_none(self, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5719,7 +5719,7 @@ async def get_default_none400_invalid( # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5762,7 +5762,7 @@ async def get_default_none400_none(self, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5814,7 +5814,7 @@ async def get200_model_a200_none(self, **kwargs: Any) -> JSON: "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5872,7 +5872,7 @@ async def get200_model_a200_valid(self, **kwargs: Any) -> JSON: "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5930,7 +5930,7 @@ async def get200_model_a200_invalid(self, **kwargs: Any) -> JSON: "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5988,7 +5988,7 @@ async def get200_model_a400_none(self, **kwargs: Any) -> JSON: "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6046,7 +6046,7 @@ async def get200_model_a400_valid(self, **kwargs: Any) -> JSON: "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6104,7 +6104,7 @@ async def get200_model_a400_invalid(self, **kwargs: Any) -> JSON: "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6162,7 +6162,7 @@ async def get200_model_a202_valid(self, **kwargs: Any) -> JSON: "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/HttpVersionTolerant/httpinfrastructureversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/HttpVersionTolerant/httpinfrastructureversiontolerant/operations/_operations.py index 4aeb50897c2..b8b6092cdfc 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/HttpVersionTolerant/httpinfrastructureversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/HttpVersionTolerant/httpinfrastructureversiontolerant/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, List, Literal, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, List, Literal, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -1775,7 +1775,7 @@ def get_empty_error(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1825,7 +1825,7 @@ def get_no_model_error(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1875,7 +1875,7 @@ def get_no_model_empty(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1943,7 +1943,7 @@ def head200(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1986,7 +1986,7 @@ def get200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2036,7 +2036,7 @@ def options200(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2091,7 +2091,7 @@ def put200( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2147,7 +2147,7 @@ def patch200( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2203,7 +2203,7 @@ def post200( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2259,7 +2259,7 @@ def delete200( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2315,7 +2315,7 @@ def put201( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2371,7 +2371,7 @@ def post201( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2427,7 +2427,7 @@ def put202( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2483,7 +2483,7 @@ def patch202( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2539,7 +2539,7 @@ def post202( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2595,7 +2595,7 @@ def delete202( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2646,7 +2646,7 @@ def head204(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2694,7 +2694,7 @@ def put204( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2750,7 +2750,7 @@ def patch204( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2806,7 +2806,7 @@ def post204( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2862,7 +2862,7 @@ def delete204( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2913,7 +2913,7 @@ def head404(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2974,7 +2974,7 @@ def head300(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3029,7 +3029,7 @@ def get300(self, **kwargs: Any) -> Optional[List[str]]: "str" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3084,7 +3084,7 @@ def head301(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3131,7 +3131,7 @@ def get301(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3184,7 +3184,7 @@ def put301( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3238,7 +3238,7 @@ def head302(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3285,7 +3285,7 @@ def get302(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3338,7 +3338,7 @@ def patch302( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3398,7 +3398,7 @@ def post303( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3453,7 +3453,7 @@ def head307(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3500,7 +3500,7 @@ def get307(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3547,7 +3547,7 @@ def options307(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3599,7 +3599,7 @@ def put307( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3659,7 +3659,7 @@ def patch307( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3719,7 +3719,7 @@ def post307( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3779,7 +3779,7 @@ def delete307( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3852,7 +3852,7 @@ def head400(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3895,7 +3895,7 @@ def get400(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3938,7 +3938,7 @@ def options400(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3986,7 +3986,7 @@ def put400( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4042,7 +4042,7 @@ def patch400( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4098,7 +4098,7 @@ def post400( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4154,7 +4154,7 @@ def delete400( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4205,7 +4205,7 @@ def head401(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4248,7 +4248,7 @@ def get402(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4291,7 +4291,7 @@ def options403(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4334,7 +4334,7 @@ def get403(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4382,7 +4382,7 @@ def put404( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4438,7 +4438,7 @@ def patch405( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4494,7 +4494,7 @@ def post406( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4550,7 +4550,7 @@ def delete407( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4606,7 +4606,7 @@ def put409( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4657,7 +4657,7 @@ def head410(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4700,7 +4700,7 @@ def get411(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4743,7 +4743,7 @@ def options412(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4786,7 +4786,7 @@ def get412(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4834,7 +4834,7 @@ def put413( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4890,7 +4890,7 @@ def patch414( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4946,7 +4946,7 @@ def post415( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4997,7 +4997,7 @@ def get416(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5045,7 +5045,7 @@ def delete417( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5096,7 +5096,7 @@ def head429(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5157,7 +5157,7 @@ def head501(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5200,7 +5200,7 @@ def get501(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5248,7 +5248,7 @@ def post505( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5304,7 +5304,7 @@ def delete505( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5373,7 +5373,7 @@ def head408(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5421,7 +5421,7 @@ def put500( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5477,7 +5477,7 @@ def patch500( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5528,7 +5528,7 @@ def get502(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5571,7 +5571,7 @@ def options502(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5626,7 +5626,7 @@ def post503( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5682,7 +5682,7 @@ def delete503( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5738,7 +5738,7 @@ def put504( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5794,7 +5794,7 @@ def patch504( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5873,7 +5873,7 @@ def get200_model204_no_model_default_error200_valid( # pylint: disable=name-too "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5935,7 +5935,7 @@ def get200_model204_no_model_default_error204_valid( # pylint: disable=name-too "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5997,7 +5997,7 @@ def get200_model204_no_model_default_error201_invalid( # pylint: disable=name-t "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6059,7 +6059,7 @@ def get200_model204_no_model_default_error202_none( # pylint: disable=name-too- "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6121,7 +6121,7 @@ def get200_model204_no_model_default_error400_valid( # pylint: disable=name-too "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6186,7 +6186,7 @@ def get200_model201_model_default_error200_valid(self, **kwargs: Any) -> JSON: "textStatusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6256,7 +6256,7 @@ def get200_model201_model_default_error201_valid(self, **kwargs: Any) -> JSON: "textStatusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6326,7 +6326,7 @@ def get200_model201_model_default_error400_valid(self, **kwargs: Any) -> JSON: "textStatusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6401,7 +6401,7 @@ def get200_model_a201_model_c404_model_d_default_error200_valid( # pylint: disa "httpStatusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6482,7 +6482,7 @@ def get200_model_a201_model_c404_model_d_default_error201_valid( # pylint: disa "httpStatusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6563,7 +6563,7 @@ def get200_model_a201_model_c404_model_d_default_error404_valid( # pylint: disa "httpStatusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6644,7 +6644,7 @@ def get200_model_a201_model_c404_model_d_default_error400_valid( # pylint: disa "httpStatusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6709,7 +6709,7 @@ def get202_none204_none_default_error202_none( # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6754,7 +6754,7 @@ def get202_none204_none_default_error204_none( # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6799,7 +6799,7 @@ def get202_none204_none_default_error400_valid( # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6844,7 +6844,7 @@ def get202_none204_none_default_none202_invalid( # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6889,7 +6889,7 @@ def get202_none204_none_default_none204_none( # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6934,7 +6934,7 @@ def get202_none204_none_default_none400_none( # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6979,7 +6979,7 @@ def get202_none204_none_default_none400_invalid( # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7030,7 +7030,7 @@ def get_default_model_a200_valid(self, **kwargs: Any) -> JSON: "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7088,7 +7088,7 @@ def get_default_model_a200_none(self, **kwargs: Any) -> JSON: "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7138,7 +7138,7 @@ def get_default_model_a400_valid(self, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7181,7 +7181,7 @@ def get_default_model_a400_none(self, **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7224,7 +7224,7 @@ def get_default_none200_invalid(self, **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7267,7 +7267,7 @@ def get_default_none200_none(self, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7310,7 +7310,7 @@ def get_default_none400_invalid(self, **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7353,7 +7353,7 @@ def get_default_none400_none(self, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7405,7 +7405,7 @@ def get200_model_a200_none(self, **kwargs: Any) -> JSON: "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7463,7 +7463,7 @@ def get200_model_a200_valid(self, **kwargs: Any) -> JSON: "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7521,7 +7521,7 @@ def get200_model_a200_invalid(self, **kwargs: Any) -> JSON: "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7579,7 +7579,7 @@ def get200_model_a400_none(self, **kwargs: Any) -> JSON: "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7637,7 +7637,7 @@ def get200_model_a400_valid(self, **kwargs: Any) -> JSON: "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7695,7 +7695,7 @@ def get200_model_a400_invalid(self, **kwargs: Any) -> JSON: "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7753,7 +7753,7 @@ def get200_model_a202_valid(self, **kwargs: Any) -> JSON: "statusCode": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/IncorrectErrorResponseVersionTolerant/incorrecterrorresponseversiontolerant/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/IncorrectErrorResponseVersionTolerant/incorrecterrorresponseversiontolerant/_operations/_operations.py index f04a7bed709..bdd4d52522c 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/IncorrectErrorResponseVersionTolerant/incorrecterrorresponseversiontolerant/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/IncorrectErrorResponseVersionTolerant/incorrecterrorresponseversiontolerant/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -54,7 +54,7 @@ def get_incorrect_error_from_server(self, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/IncorrectErrorResponseVersionTolerant/incorrecterrorresponseversiontolerant/aio/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/IncorrectErrorResponseVersionTolerant/incorrecterrorresponseversiontolerant/aio/_operations/_operations.py index 44aa4d13527..bc30d489312 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/IncorrectErrorResponseVersionTolerant/incorrecterrorresponseversiontolerant/aio/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/IncorrectErrorResponseVersionTolerant/incorrecterrorresponseversiontolerant/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -44,7 +44,7 @@ async def get_incorrect_error_from_server( # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MediaTypesVersionTolerant/mediatypesversiontolerant/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MediaTypesVersionTolerant/mediatypesversiontolerant/_operations/_operations.py index f1f0c74c265..b64b973deed 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MediaTypesVersionTolerant/mediatypesversiontolerant/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MediaTypesVersionTolerant/mediatypesversiontolerant/_operations/_operations.py @@ -214,7 +214,7 @@ def analyze_body(self, input: Optional[Union[JSON, IO[bytes]]] = None, **kwargs: "source": "str" # Optional. File source path. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -341,7 +341,7 @@ def analyze_body_no_accept_header( # pylint: disable=inconsistent-return-statem "source": "str" # Optional. File source path. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -406,7 +406,7 @@ def content_type_with_encoding(self, input: Optional[str] = None, **kwargs: Any) :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -467,7 +467,7 @@ def binary_body_with_two_content_types(self, message: IO[bytes], **kwargs: Any) :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -526,7 +526,7 @@ def binary_body_with_three_content_types(self, message: IO[bytes], **kwargs: Any :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +583,7 @@ def put_text_and_json_body(self, message: str, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MediaTypesVersionTolerant/mediatypesversiontolerant/aio/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MediaTypesVersionTolerant/mediatypesversiontolerant/aio/_operations/_operations.py index 19b3fc5f8fe..ef116a0e8bc 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MediaTypesVersionTolerant/mediatypesversiontolerant/aio/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MediaTypesVersionTolerant/mediatypesversiontolerant/aio/_operations/_operations.py @@ -109,7 +109,7 @@ async def analyze_body(self, input: Optional[Union[JSON, IO[bytes]]] = None, **k "source": "str" # Optional. File source path. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -236,7 +236,7 @@ async def analyze_body_no_accept_header( # pylint: disable=inconsistent-return- "source": "str" # Optional. File source path. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -301,7 +301,7 @@ async def content_type_with_encoding(self, input: Optional[str] = None, **kwargs :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -362,7 +362,7 @@ async def binary_body_with_two_content_types(self, message: IO[bytes], **kwargs: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -421,7 +421,7 @@ async def binary_body_with_three_content_types(self, message: IO[bytes], **kwarg :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -478,7 +478,7 @@ async def put_text_and_json_body(self, message: str, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MergePatchJsonVersionTolerant/mergepatchjsonversiontolerant/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MergePatchJsonVersionTolerant/mergepatchjsonversiontolerant/_operations/_operations.py index a1581815ba7..69c6afe732d 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MergePatchJsonVersionTolerant/mergepatchjsonversiontolerant/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MergePatchJsonVersionTolerant/mergepatchjsonversiontolerant/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -67,7 +67,7 @@ def patch_single(self, body: JSON, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MergePatchJsonVersionTolerant/mergepatchjsonversiontolerant/aio/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MergePatchJsonVersionTolerant/mergepatchjsonversiontolerant/aio/_operations/_operations.py index c6a2493d71d..bfde7a68e11 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MergePatchJsonVersionTolerant/mergepatchjsonversiontolerant/aio/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MergePatchJsonVersionTolerant/mergepatchjsonversiontolerant/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -45,7 +45,7 @@ async def patch_single(self, body: JSON, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ModelFlatteningVersionTolerant/modelflatteningversiontolerant/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ModelFlatteningVersionTolerant/modelflatteningversiontolerant/_operations/_operations.py index 76644636bda..98212a49bbe 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ModelFlatteningVersionTolerant/modelflatteningversiontolerant/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ModelFlatteningVersionTolerant/modelflatteningversiontolerant/_operations/_operations.py @@ -313,7 +313,7 @@ def put_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -399,7 +399,7 @@ def get_array(self, **kwargs: Any) -> List[JSON]: } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -508,7 +508,7 @@ def put_wrapped_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -582,7 +582,7 @@ def get_wrapped_array(self, **kwargs: Any) -> List[JSON]: } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -707,7 +707,7 @@ def put_dictionary( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -793,7 +793,7 @@ def get_dictionary(self, **kwargs: Any) -> Dict[str, JSON]: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1035,7 +1035,7 @@ def put_resource_collection( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1166,7 +1166,7 @@ def get_resource_collection(self, **kwargs: Any) -> JSON: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1362,7 +1362,7 @@ def put_simple_product(self, simple_body_product: Optional[Union[JSON, IO[bytes] } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1575,7 +1575,7 @@ def post_flattened_simple_product( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1804,7 +1804,7 @@ def put_simple_product_with_grouping( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ModelFlatteningVersionTolerant/modelflatteningversiontolerant/aio/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ModelFlatteningVersionTolerant/modelflatteningversiontolerant/aio/_operations/_operations.py index e84eb42ffa4..fb679be21da 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ModelFlatteningVersionTolerant/modelflatteningversiontolerant/aio/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ModelFlatteningVersionTolerant/modelflatteningversiontolerant/aio/_operations/_operations.py @@ -120,7 +120,7 @@ async def put_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -206,7 +206,7 @@ async def get_array(self, **kwargs: Any) -> List[JSON]: } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -315,7 +315,7 @@ async def put_wrapped_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -389,7 +389,7 @@ async def get_wrapped_array(self, **kwargs: Any) -> List[JSON]: } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -514,7 +514,7 @@ async def put_dictionary( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -600,7 +600,7 @@ async def get_dictionary(self, **kwargs: Any) -> Dict[str, JSON]: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -842,7 +842,7 @@ async def put_resource_collection( # pylint: disable=inconsistent-return-statem } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -973,7 +973,7 @@ async def get_resource_collection(self, **kwargs: Any) -> JSON: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1171,7 +1171,7 @@ async def put_simple_product( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1384,7 +1384,7 @@ async def post_flattened_simple_product( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1613,7 +1613,7 @@ async def put_simple_product_with_grouping( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MultipleInheritanceVersionTolerant/multipleinheritanceversiontolerant/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MultipleInheritanceVersionTolerant/multipleinheritanceversiontolerant/_operations/_operations.py index 416ba8b0de4..bbd1cb04746 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MultipleInheritanceVersionTolerant/multipleinheritanceversiontolerant/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MultipleInheritanceVersionTolerant/multipleinheritanceversiontolerant/_operations/_operations.py @@ -221,7 +221,7 @@ def get_horse(self, **kwargs: Any) -> JSON: "isAShowHorse": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -320,7 +320,7 @@ def put_horse(self, horse: Union[JSON, IO[bytes]], **kwargs: Any) -> str: "isAShowHorse": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -390,7 +390,7 @@ def get_pet(self, **kwargs: Any) -> JSON: "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -486,7 +486,7 @@ def put_pet(self, pet: Union[JSON, IO[bytes]], **kwargs: Any) -> str: "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -557,7 +557,7 @@ def get_feline(self, **kwargs: Any) -> JSON: "meows": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -656,7 +656,7 @@ def put_feline(self, feline: Union[JSON, IO[bytes]], **kwargs: Any) -> str: "meows": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -729,7 +729,7 @@ def get_cat(self, **kwargs: Any) -> JSON: "meows": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -834,7 +834,7 @@ def put_cat(self, cat: Union[JSON, IO[bytes]], **kwargs: Any) -> str: "meows": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -909,7 +909,7 @@ def get_kitten(self, **kwargs: Any) -> JSON: "meows": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1019,7 +1019,7 @@ def put_kitten(self, kitten: Union[JSON, IO[bytes]], **kwargs: Any) -> str: "meows": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MultipleInheritanceVersionTolerant/multipleinheritanceversiontolerant/aio/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MultipleInheritanceVersionTolerant/multipleinheritanceversiontolerant/aio/_operations/_operations.py index f1ebe04cc0f..b6f6a9ded6b 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MultipleInheritanceVersionTolerant/multipleinheritanceversiontolerant/aio/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/MultipleInheritanceVersionTolerant/multipleinheritanceversiontolerant/aio/_operations/_operations.py @@ -66,7 +66,7 @@ async def get_horse(self, **kwargs: Any) -> JSON: "isAShowHorse": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +165,7 @@ async def put_horse(self, horse: Union[JSON, IO[bytes]], **kwargs: Any) -> str: "isAShowHorse": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -235,7 +235,7 @@ async def get_pet(self, **kwargs: Any) -> JSON: "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +331,7 @@ async def put_pet(self, pet: Union[JSON, IO[bytes]], **kwargs: Any) -> str: "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -402,7 +402,7 @@ async def get_feline(self, **kwargs: Any) -> JSON: "meows": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -501,7 +501,7 @@ async def put_feline(self, feline: Union[JSON, IO[bytes]], **kwargs: Any) -> str "meows": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -574,7 +574,7 @@ async def get_cat(self, **kwargs: Any) -> JSON: "meows": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -679,7 +679,7 @@ async def put_cat(self, cat: Union[JSON, IO[bytes]], **kwargs: Any) -> str: "meows": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -754,7 +754,7 @@ async def get_kitten(self, **kwargs: Any) -> JSON: "meows": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -864,7 +864,7 @@ async def put_kitten(self, kitten: Union[JSON, IO[bytes]], **kwargs: Any) -> str "meows": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NoNamespaceFlagVersionTolerant/anything_client/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NoNamespaceFlagVersionTolerant/anything_client/_operations/_operations.py index 500a58d58f9..ea2d2802804 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NoNamespaceFlagVersionTolerant/anything_client/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NoNamespaceFlagVersionTolerant/anything_client/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -130,7 +130,7 @@ def get_object(self, **kwargs: Any) -> Any: :rtype: any :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -183,7 +183,7 @@ def put_object(self, input: Any, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -231,7 +231,7 @@ def get_string(self, **kwargs: Any) -> Any: :rtype: any :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -284,7 +284,7 @@ def put_string(self, input: Any, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -332,7 +332,7 @@ def get_array(self, **kwargs: Any) -> Any: :rtype: any :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -385,7 +385,7 @@ def put_array(self, input: Any, **kwargs: Any) -> None: # pylint: disable=incon :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NoNamespaceFlagVersionTolerant/anything_client/aio/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NoNamespaceFlagVersionTolerant/anything_client/aio/_operations/_operations.py index 04b83dc94f7..bfd81349d5d 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NoNamespaceFlagVersionTolerant/anything_client/aio/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NoNamespaceFlagVersionTolerant/anything_client/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -50,7 +50,7 @@ async def get_object(self, **kwargs: Any) -> Any: :rtype: any :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -103,7 +103,7 @@ async def put_object(self, input: Any, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -151,7 +151,7 @@ async def get_string(self, **kwargs: Any) -> Any: :rtype: any :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -204,7 +204,7 @@ async def put_string(self, input: Any, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -252,7 +252,7 @@ async def get_array(self, **kwargs: Any) -> Any: :rtype: any :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -305,7 +305,7 @@ async def put_array(self, input: Any, **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NonStringEnumsVersionTolerant/nonstringenumsversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NonStringEnumsVersionTolerant/nonstringenumsversiontolerant/aio/operations/_operations.py index 00d9bccf7eb..aa2ef4fd60c 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NonStringEnumsVersionTolerant/nonstringenumsversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NonStringEnumsVersionTolerant/nonstringenumsversiontolerant/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -65,7 +65,7 @@ async def put(self, input: Optional[int] = None, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -123,7 +123,7 @@ async def get(self, **kwargs: Any) -> int: :rtype: int :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -194,7 +194,7 @@ async def put(self, input: Optional[float] = None, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -252,7 +252,7 @@ async def get(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NonStringEnumsVersionTolerant/nonstringenumsversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NonStringEnumsVersionTolerant/nonstringenumsversiontolerant/operations/_operations.py index 7d8fb816ab7..58cbed65be4 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NonStringEnumsVersionTolerant/nonstringenumsversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/NonStringEnumsVersionTolerant/nonstringenumsversiontolerant/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -125,7 +125,7 @@ def put(self, input: Optional[int] = None, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -183,7 +183,7 @@ def get(self, **kwargs: Any) -> int: :rtype: int :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -254,7 +254,7 @@ def put(self, input: Optional[float] = None, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -312,7 +312,7 @@ def get(self, **kwargs: Any) -> float: :rtype: float :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ObjectTypeVersionTolerant/objecttypeversiontolerant/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ObjectTypeVersionTolerant/objecttypeversiontolerant/_operations/_operations.py index d243bbfe593..36f338465fb 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ObjectTypeVersionTolerant/objecttypeversiontolerant/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ObjectTypeVersionTolerant/objecttypeversiontolerant/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -78,7 +78,7 @@ def get(self, **kwargs: Any) -> JSON: :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -132,7 +132,7 @@ def put(self, put_object: JSON, **kwargs: Any) -> None: # pylint: disable=incon :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ObjectTypeVersionTolerant/objecttypeversiontolerant/aio/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ObjectTypeVersionTolerant/objecttypeversiontolerant/aio/_operations/_operations.py index 805d0b37ea2..7399125f99c 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ObjectTypeVersionTolerant/objecttypeversiontolerant/aio/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ObjectTypeVersionTolerant/objecttypeversiontolerant/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -44,7 +44,7 @@ async def get(self, **kwargs: Any) -> JSON: :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -98,7 +98,7 @@ async def put(self, put_object: JSON, **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ParameterFlatteningVersionTolerant/parameterflatteningversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ParameterFlatteningVersionTolerant/parameterflatteningversiontolerant/aio/operations/_operations.py index 8f6c08a407b..f2275f58b6b 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ParameterFlatteningVersionTolerant/parameterflatteningversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ParameterFlatteningVersionTolerant/parameterflatteningversiontolerant/aio/operations/_operations.py @@ -133,7 +133,7 @@ async def update( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ParameterFlatteningVersionTolerant/parameterflatteningversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ParameterFlatteningVersionTolerant/parameterflatteningversiontolerant/operations/_operations.py index c0840593c8f..b8c5a7ac640 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ParameterFlatteningVersionTolerant/parameterflatteningversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ParameterFlatteningVersionTolerant/parameterflatteningversiontolerant/operations/_operations.py @@ -156,7 +156,7 @@ def update( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ParameterizedEndpointVersionTolerant/parameterizedendpointversiontolerant/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ParameterizedEndpointVersionTolerant/parameterizedendpointversiontolerant/_operations/_operations.py index c3dacbab52c..a705c7decaf 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ParameterizedEndpointVersionTolerant/parameterizedendpointversiontolerant/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ParameterizedEndpointVersionTolerant/parameterizedendpointversiontolerant/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -51,7 +51,7 @@ def get(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ParameterizedEndpointVersionTolerant/parameterizedendpointversiontolerant/aio/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ParameterizedEndpointVersionTolerant/parameterizedendpointversiontolerant/aio/_operations/_operations.py index 12d4aaa7376..6dbf448a1c2 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ParameterizedEndpointVersionTolerant/parameterizedendpointversiontolerant/aio/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ParameterizedEndpointVersionTolerant/parameterizedendpointversiontolerant/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -41,7 +41,7 @@ async def get(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ReportVersionTolerant/reportversiontolerant/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ReportVersionTolerant/reportversiontolerant/_operations/_operations.py index af4555a2bf1..dc4178c9286 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ReportVersionTolerant/reportversiontolerant/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ReportVersionTolerant/reportversiontolerant/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -99,7 +99,7 @@ def get_report(self, *, qualifier: Optional[str] = None, **kwargs: Any) -> Dict[ "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -162,7 +162,7 @@ def get_optional_report(self, *, qualifier: Optional[str] = None, **kwargs: Any) "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ReportVersionTolerant/reportversiontolerant/aio/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ReportVersionTolerant/reportversiontolerant/aio/_operations/_operations.py index 8d89ccf2922..b873ccf8ae4 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ReportVersionTolerant/reportversiontolerant/aio/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ReportVersionTolerant/reportversiontolerant/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -56,7 +56,7 @@ async def get_report(self, *, qualifier: Optional[str] = None, **kwargs: Any) -> "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -119,7 +119,7 @@ async def get_optional_report(self, *, qualifier: Optional[str] = None, **kwargs "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/RequiredOptionalVersionTolerant/requiredoptionalversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/RequiredOptionalVersionTolerant/requiredoptionalversiontolerant/aio/operations/_operations.py index d9f02906b38..f8e0a87b2b8 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/RequiredOptionalVersionTolerant/requiredoptionalversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/RequiredOptionalVersionTolerant/requiredoptionalversiontolerant/aio/operations/_operations.py @@ -96,7 +96,7 @@ async def get_required_path( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -144,7 +144,7 @@ async def put_optional_query( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -192,7 +192,7 @@ async def put_optional_header( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -240,7 +240,7 @@ async def put_optional_body( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -295,7 +295,7 @@ async def put_optional_binary_body( # pylint: disable=inconsistent-return-state :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -343,7 +343,7 @@ async def get_required_global_path(self, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -387,7 +387,7 @@ async def get_required_global_query(self, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -431,7 +431,7 @@ async def get_optional_global_query(self, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -497,7 +497,7 @@ async def put_optional_binary_body( # pylint: disable=inconsistent-return-state :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -549,7 +549,7 @@ async def put_required_binary_body( # pylint: disable=inconsistent-return-state :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -602,7 +602,7 @@ async def post_required_integer_parameter( # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -654,7 +654,7 @@ async def post_optional_integer_parameter( # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -760,7 +760,7 @@ async def post_required_integer_property( # pylint: disable=inconsistent-return "value": 0 # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -867,7 +867,7 @@ async def post_optional_integer_property( # pylint: disable=inconsistent-return "value": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -930,7 +930,7 @@ async def post_required_integer_header( # pylint: disable=inconsistent-return-s :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -978,7 +978,7 @@ async def post_optional_integer_header( # pylint: disable=inconsistent-return-s :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1027,7 +1027,7 @@ async def post_required_string_parameter( # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1079,7 +1079,7 @@ async def post_optional_string_parameter( # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1185,7 +1185,7 @@ async def post_required_string_property( # pylint: disable=inconsistent-return- "value": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1292,7 +1292,7 @@ async def post_optional_string_property( # pylint: disable=inconsistent-return- "value": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1355,7 +1355,7 @@ async def post_required_string_header( # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1403,7 +1403,7 @@ async def post_optional_string_header( # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1504,7 +1504,7 @@ async def post_required_class_parameter( # pylint: disable=inconsistent-return- "name": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1613,7 +1613,7 @@ async def post_optional_class_parameter( # pylint: disable=inconsistent-return- "name": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1732,7 +1732,7 @@ async def post_required_class_property( # pylint: disable=inconsistent-return-s } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1845,7 +1845,7 @@ async def post_optional_class_property( # pylint: disable=inconsistent-return-s } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1950,7 +1950,7 @@ async def post_required_array_parameter( # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2049,7 +2049,7 @@ async def post_optional_array_parameter( # pylint: disable=inconsistent-return- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2166,7 +2166,7 @@ async def post_required_array_property( # pylint: disable=inconsistent-return-s ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2277,7 +2277,7 @@ async def post_optional_array_property( # pylint: disable=inconsistent-return-s ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2340,7 +2340,7 @@ async def post_required_array_header( # pylint: disable=inconsistent-return-sta :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2388,7 +2388,7 @@ async def post_optional_array_header( # pylint: disable=inconsistent-return-sta :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/RequiredOptionalVersionTolerant/requiredoptionalversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/RequiredOptionalVersionTolerant/requiredoptionalversiontolerant/operations/_operations.py index d2852be403d..9bfb73e4f59 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/RequiredOptionalVersionTolerant/requiredoptionalversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/RequiredOptionalVersionTolerant/requiredoptionalversiontolerant/operations/_operations.py @@ -649,7 +649,7 @@ def get_required_path( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -697,7 +697,7 @@ def put_optional_query( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -745,7 +745,7 @@ def put_optional_header( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -793,7 +793,7 @@ def put_optional_body( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -848,7 +848,7 @@ def put_optional_binary_body( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -896,7 +896,7 @@ def get_required_global_path(self, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -940,7 +940,7 @@ def get_required_global_query(self, **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -984,7 +984,7 @@ def get_optional_global_query(self, **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1050,7 +1050,7 @@ def put_optional_binary_body( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1102,7 +1102,7 @@ def put_required_binary_body( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1155,7 +1155,7 @@ def post_required_integer_parameter( # pylint: disable=inconsistent-return-stat :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1207,7 +1207,7 @@ def post_optional_integer_parameter( # pylint: disable=inconsistent-return-stat :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1313,7 +1313,7 @@ def post_required_integer_property( # pylint: disable=inconsistent-return-state "value": 0 # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1420,7 +1420,7 @@ def post_optional_integer_property( # pylint: disable=inconsistent-return-state "value": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1483,7 +1483,7 @@ def post_required_integer_header( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1531,7 +1531,7 @@ def post_optional_integer_header( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1580,7 +1580,7 @@ def post_required_string_parameter( # pylint: disable=inconsistent-return-state :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1632,7 +1632,7 @@ def post_optional_string_parameter( # pylint: disable=inconsistent-return-state :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1738,7 +1738,7 @@ def post_required_string_property( # pylint: disable=inconsistent-return-statem "value": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1845,7 +1845,7 @@ def post_optional_string_property( # pylint: disable=inconsistent-return-statem "value": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1908,7 +1908,7 @@ def post_required_string_header( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1956,7 +1956,7 @@ def post_optional_string_header( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2057,7 +2057,7 @@ def post_required_class_parameter( # pylint: disable=inconsistent-return-statem "name": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2166,7 +2166,7 @@ def post_optional_class_parameter( # pylint: disable=inconsistent-return-statem "name": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2285,7 +2285,7 @@ def post_required_class_property( # pylint: disable=inconsistent-return-stateme } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2398,7 +2398,7 @@ def post_optional_class_property( # pylint: disable=inconsistent-return-stateme } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2503,7 +2503,7 @@ def post_required_array_parameter( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2602,7 +2602,7 @@ def post_optional_array_parameter( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2719,7 +2719,7 @@ def post_required_array_property( # pylint: disable=inconsistent-return-stateme ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2830,7 +2830,7 @@ def post_optional_array_property( # pylint: disable=inconsistent-return-stateme ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2893,7 +2893,7 @@ def post_required_array_header( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2941,7 +2941,7 @@ def post_optional_array_header( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ReservedWordsVersionTolerant/reservedwordsversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ReservedWordsVersionTolerant/reservedwordsversiontolerant/aio/operations/_operations.py index d3a51979634..fd0b97806e2 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ReservedWordsVersionTolerant/reservedwordsversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ReservedWordsVersionTolerant/reservedwordsversiontolerant/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, IO, List, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -67,7 +67,7 @@ async def operation_one(self, *, parameter1: str, **kwargs: Any) -> JSON: :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -131,7 +131,7 @@ async def operation_with_content_param(self, content: IO[bytes], **kwargs: Any) :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -188,7 +188,7 @@ async def operation_with_json_param(self, json: Any, **kwargs: Any) -> JSON: :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -254,7 +254,7 @@ async def operation_with_url( :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -310,7 +310,7 @@ async def reserved_enum(self, *, enum_parameter: str, **kwargs: Any) -> JSON: :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ReservedWordsVersionTolerant/reservedwordsversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ReservedWordsVersionTolerant/reservedwordsversiontolerant/operations/_operations.py index e69f1d0e25a..008bb4f6d1b 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ReservedWordsVersionTolerant/reservedwordsversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ReservedWordsVersionTolerant/reservedwordsversiontolerant/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, IO, List, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -168,7 +168,7 @@ def operation_one(self, *, parameter1: str, **kwargs: Any) -> JSON: :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -232,7 +232,7 @@ def operation_with_content_param(self, content: IO[bytes], **kwargs: Any) -> JSO :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -289,7 +289,7 @@ def operation_with_json_param(self, json: Any, **kwargs: Any) -> JSON: :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -355,7 +355,7 @@ def operation_with_url( :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -411,7 +411,7 @@ def reserved_enum(self, *, enum_parameter: str, **kwargs: Any) -> JSON: :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/SecurityAadSwaggerVersionTolerant/securityaadswaggerversiontolerant/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/SecurityAadSwaggerVersionTolerant/securityaadswaggerversiontolerant/_operations/_operations.py index 3ee60e15dd8..388bffa86e3 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/SecurityAadSwaggerVersionTolerant/securityaadswaggerversiontolerant/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/SecurityAadSwaggerVersionTolerant/securityaadswaggerversiontolerant/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -51,7 +51,7 @@ def head(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/SecurityAadSwaggerVersionTolerant/securityaadswaggerversiontolerant/aio/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/SecurityAadSwaggerVersionTolerant/securityaadswaggerversiontolerant/aio/_operations/_operations.py index 71ea32b39a6..40b817efb5b 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/SecurityAadSwaggerVersionTolerant/securityaadswaggerversiontolerant/aio/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/SecurityAadSwaggerVersionTolerant/securityaadswaggerversiontolerant/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -41,7 +41,7 @@ async def head(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/SecurityKeySwaggerVersionTolerant/securitykeyswaggerversiontolerant/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/SecurityKeySwaggerVersionTolerant/securitykeyswaggerversiontolerant/_operations/_operations.py index 7ffbaf3a913..1e83be5b461 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/SecurityKeySwaggerVersionTolerant/securitykeyswaggerversiontolerant/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/SecurityKeySwaggerVersionTolerant/securitykeyswaggerversiontolerant/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -51,7 +51,7 @@ def head(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/SecurityKeySwaggerVersionTolerant/securitykeyswaggerversiontolerant/aio/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/SecurityKeySwaggerVersionTolerant/securitykeyswaggerversiontolerant/aio/_operations/_operations.py index 0a56ebc0a6d..e11c0f9a7f2 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/SecurityKeySwaggerVersionTolerant/securitykeyswaggerversiontolerant/aio/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/SecurityKeySwaggerVersionTolerant/securitykeyswaggerversiontolerant/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -41,7 +41,7 @@ async def head(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlMultiCollectionFormatVersionTolerant/urlmulticollectionformatversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlMultiCollectionFormatVersionTolerant/urlmulticollectionformatversiontolerant/aio/operations/_operations.py index 63db587f63f..bcfa113da21 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlMultiCollectionFormatVersionTolerant/urlmulticollectionformatversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlMultiCollectionFormatVersionTolerant/urlmulticollectionformatversiontolerant/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, List, Optional, Type, TypeVar +from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -65,7 +65,7 @@ async def array_string_multi_null( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -114,7 +114,7 @@ async def array_string_multi_empty( # pylint: disable=inconsistent-return-state :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -164,7 +164,7 @@ async def array_string_multi_valid( # pylint: disable=inconsistent-return-state :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlMultiCollectionFormatVersionTolerant/urlmulticollectionformatversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlMultiCollectionFormatVersionTolerant/urlmulticollectionformatversiontolerant/operations/_operations.py index cffc288b9c6..fec8963b5d7 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlMultiCollectionFormatVersionTolerant/urlmulticollectionformatversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlMultiCollectionFormatVersionTolerant/urlmulticollectionformatversiontolerant/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, List, Optional, Type, TypeVar +from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -134,7 +134,7 @@ def array_string_multi_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -183,7 +183,7 @@ def array_string_multi_empty( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -233,7 +233,7 @@ def array_string_multi_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlVersionTolerant/urlversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlVersionTolerant/urlversiontolerant/aio/operations/_operations.py index af0e15ee2b5..725862434d8 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlVersionTolerant/urlversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlVersionTolerant/urlversiontolerant/aio/operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, List, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, List, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -125,7 +125,7 @@ async def get_boolean_true(self, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +170,7 @@ async def get_boolean_false(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -215,7 +215,7 @@ async def get_int_one_million(self, **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -262,7 +262,7 @@ async def get_int_negative_one_million( # pylint: disable=inconsistent-return-s :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -307,7 +307,7 @@ async def get_ten_billion(self, **kwargs: Any) -> None: # pylint: disable=incon :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -352,7 +352,7 @@ async def get_negative_ten_billion(self, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -397,7 +397,7 @@ async def float_scientific_positive(self, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -442,7 +442,7 @@ async def float_scientific_negative(self, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -487,7 +487,7 @@ async def double_decimal_positive(self, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -532,7 +532,7 @@ async def double_decimal_negative(self, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -577,7 +577,7 @@ async def string_unicode(self, **kwargs: Any) -> None: # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -622,7 +622,7 @@ async def string_url_encoded(self, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -669,7 +669,7 @@ async def string_url_non_encoded(self, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -714,7 +714,7 @@ async def string_empty(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -763,7 +763,7 @@ async def string_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -810,7 +810,7 @@ async def enum_valid(self, enum_path: str, **kwargs: Any) -> None: # pylint: di :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -857,7 +857,7 @@ async def enum_null(self, enum_path: str, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -905,7 +905,7 @@ async def byte_multi_byte( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -949,7 +949,7 @@ async def byte_empty(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -998,7 +998,7 @@ async def byte_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1042,7 +1042,7 @@ async def date_valid(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1092,7 +1092,7 @@ async def date_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1136,7 +1136,7 @@ async def date_time_valid(self, **kwargs: Any) -> None: # pylint: disable=incon :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1185,7 +1185,7 @@ async def date_time_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1233,7 +1233,7 @@ async def base64_url( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1283,7 +1283,7 @@ async def array_csv_in_path( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1331,7 +1331,7 @@ async def unix_time_url( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1393,7 +1393,7 @@ async def get_boolean_true(self, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1438,7 +1438,7 @@ async def get_boolean_false(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1487,7 +1487,7 @@ async def get_boolean_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1531,7 +1531,7 @@ async def get_int_one_million(self, **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1578,7 +1578,7 @@ async def get_int_negative_one_million( # pylint: disable=inconsistent-return-s :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1627,7 +1627,7 @@ async def get_int_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1671,7 +1671,7 @@ async def get_ten_billion(self, **kwargs: Any) -> None: # pylint: disable=incon :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1716,7 +1716,7 @@ async def get_negative_ten_billion(self, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1765,7 +1765,7 @@ async def get_long_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1809,7 +1809,7 @@ async def float_scientific_positive(self, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1854,7 +1854,7 @@ async def float_scientific_negative(self, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1903,7 +1903,7 @@ async def float_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1947,7 +1947,7 @@ async def double_decimal_positive(self, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1992,7 +1992,7 @@ async def double_decimal_negative(self, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2041,7 +2041,7 @@ async def double_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2085,7 +2085,7 @@ async def string_unicode(self, **kwargs: Any) -> None: # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2130,7 +2130,7 @@ async def string_url_encoded(self, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2177,7 +2177,7 @@ async def string_empty(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2226,7 +2226,7 @@ async def string_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2275,7 +2275,7 @@ async def enum_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2324,7 +2324,7 @@ async def enum_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2373,7 +2373,7 @@ async def byte_multi_byte( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2417,7 +2417,7 @@ async def byte_empty(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2466,7 +2466,7 @@ async def byte_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2510,7 +2510,7 @@ async def date_valid(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2559,7 +2559,7 @@ async def date_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2603,7 +2603,7 @@ async def date_time_valid(self, **kwargs: Any) -> None: # pylint: disable=incon :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2654,7 +2654,7 @@ async def date_time_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2704,7 +2704,7 @@ async def array_string_csv_valid( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2752,7 +2752,7 @@ async def array_string_csv_null( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2801,7 +2801,7 @@ async def array_string_csv_empty( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2851,7 +2851,7 @@ async def array_string_no_collection_format_empty( # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2901,7 +2901,7 @@ async def array_string_ssv_valid( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2951,7 +2951,7 @@ async def array_string_tsv_valid( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3001,7 +3001,7 @@ async def array_string_pipes_valid( # pylint: disable=inconsistent-return-state :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3083,7 +3083,7 @@ async def get_all_with_values( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3152,7 +3152,7 @@ async def get_global_query_null( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3221,7 +3221,7 @@ async def get_global_and_local_query_null( # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3289,7 +3289,7 @@ async def get_local_path_item_query_null( # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlVersionTolerant/urlversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlVersionTolerant/urlversiontolerant/operations/_operations.py index 43aa564382e..14a7f67ee3f 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlVersionTolerant/urlversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlVersionTolerant/urlversiontolerant/operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, List, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, List, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -1434,7 +1434,7 @@ def get_boolean_true(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1479,7 +1479,7 @@ def get_boolean_false(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1524,7 +1524,7 @@ def get_int_one_million(self, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1569,7 +1569,7 @@ def get_int_negative_one_million(self, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1614,7 +1614,7 @@ def get_ten_billion(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1659,7 +1659,7 @@ def get_negative_ten_billion(self, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1704,7 +1704,7 @@ def float_scientific_positive(self, **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1749,7 +1749,7 @@ def float_scientific_negative(self, **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1794,7 +1794,7 @@ def double_decimal_positive(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1839,7 +1839,7 @@ def double_decimal_negative(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1884,7 +1884,7 @@ def string_unicode(self, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1929,7 +1929,7 @@ def string_url_encoded(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1976,7 +1976,7 @@ def string_url_non_encoded(self, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2021,7 +2021,7 @@ def string_empty(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2068,7 +2068,7 @@ def string_null(self, string_path: str, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2115,7 +2115,7 @@ def enum_valid(self, enum_path: str, **kwargs: Any) -> None: # pylint: disable= :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2162,7 +2162,7 @@ def enum_null(self, enum_path: str, **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2210,7 +2210,7 @@ def byte_multi_byte( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2254,7 +2254,7 @@ def byte_empty(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2301,7 +2301,7 @@ def byte_null(self, byte_path: bytes, **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2345,7 +2345,7 @@ def date_valid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2395,7 +2395,7 @@ def date_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2439,7 +2439,7 @@ def date_time_valid(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2488,7 +2488,7 @@ def date_time_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2536,7 +2536,7 @@ def base64_url( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2586,7 +2586,7 @@ def array_csv_in_path( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2634,7 +2634,7 @@ def unix_time_url( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2696,7 +2696,7 @@ def get_boolean_true(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2741,7 +2741,7 @@ def get_boolean_false(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2790,7 +2790,7 @@ def get_boolean_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2834,7 +2834,7 @@ def get_int_one_million(self, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2879,7 +2879,7 @@ def get_int_negative_one_million(self, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2928,7 +2928,7 @@ def get_int_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2972,7 +2972,7 @@ def get_ten_billion(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3017,7 +3017,7 @@ def get_negative_ten_billion(self, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3066,7 +3066,7 @@ def get_long_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3110,7 +3110,7 @@ def float_scientific_positive(self, **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3155,7 +3155,7 @@ def float_scientific_negative(self, **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3204,7 +3204,7 @@ def float_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3248,7 +3248,7 @@ def double_decimal_positive(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3293,7 +3293,7 @@ def double_decimal_negative(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3342,7 +3342,7 @@ def double_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3386,7 +3386,7 @@ def string_unicode(self, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3431,7 +3431,7 @@ def string_url_encoded(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3478,7 +3478,7 @@ def string_empty(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3527,7 +3527,7 @@ def string_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3576,7 +3576,7 @@ def enum_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3625,7 +3625,7 @@ def enum_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3674,7 +3674,7 @@ def byte_multi_byte( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3718,7 +3718,7 @@ def byte_empty(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3767,7 +3767,7 @@ def byte_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3811,7 +3811,7 @@ def date_valid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3860,7 +3860,7 @@ def date_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3904,7 +3904,7 @@ def date_time_valid(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3955,7 +3955,7 @@ def date_time_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4005,7 +4005,7 @@ def array_string_csv_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4053,7 +4053,7 @@ def array_string_csv_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4102,7 +4102,7 @@ def array_string_csv_empty( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4152,7 +4152,7 @@ def array_string_no_collection_format_empty( # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4202,7 +4202,7 @@ def array_string_ssv_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4252,7 +4252,7 @@ def array_string_tsv_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4302,7 +4302,7 @@ def array_string_pipes_valid( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4384,7 +4384,7 @@ def get_all_with_values( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4453,7 +4453,7 @@ def get_global_query_null( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4522,7 +4522,7 @@ def get_global_and_local_query_null( # pylint: disable=inconsistent-return-stat :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4590,7 +4590,7 @@ def get_local_path_item_query_null( # pylint: disable=inconsistent-return-state :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ValidationVersionTolerant/validationversiontolerant/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ValidationVersionTolerant/validationversiontolerant/_operations/_operations.py index 94383716b5d..57c616f8d7f 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ValidationVersionTolerant/validationversiontolerant/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ValidationVersionTolerant/validationversiontolerant/_operations/_operations.py @@ -185,7 +185,7 @@ def validation_of_method_parameters(self, resource_group_name: str, id: int, **k "image": "str" # Optional. Image URL representing the product. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -444,7 +444,7 @@ def validation_of_body( "image": "str" # Optional. Image URL representing the product. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -513,7 +513,7 @@ def get_with_constant_in_path(self, **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -734,7 +734,7 @@ def post_with_constant_in_body(self, body: Optional[Union[JSON, IO[bytes]]] = No "image": "str" # Optional. Image URL representing the product. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ValidationVersionTolerant/validationversiontolerant/aio/_operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ValidationVersionTolerant/validationversiontolerant/aio/_operations/_operations.py index 9a745ea9495..9b3501fd12f 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ValidationVersionTolerant/validationversiontolerant/aio/_operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/ValidationVersionTolerant/validationversiontolerant/aio/_operations/_operations.py @@ -84,7 +84,7 @@ async def validation_of_method_parameters(self, resource_group_name: str, id: in "image": "str" # Optional. Image URL representing the product. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -343,7 +343,7 @@ async def validation_of_body( "image": "str" # Optional. Image URL representing the product. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -412,7 +412,7 @@ async def get_with_constant_in_path(self, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -633,7 +633,7 @@ async def post_with_constant_in_body(self, body: Optional[Union[JSON, IO[bytes]] "image": "str" # Optional. Image URL representing the product. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/XmlVersionTolerant/xmlserviceversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/XmlVersionTolerant/xmlserviceversiontolerant/aio/operations/_operations.py index 4aced3cb394..1c3d8286c90 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/XmlVersionTolerant/xmlserviceversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/XmlVersionTolerant/xmlserviceversiontolerant/aio/operations/_operations.py @@ -96,7 +96,7 @@ async def get_complex_type_ref_no_meta(self, **kwargs: Any) -> _models.RootWithR :rtype: ~xmlserviceversiontolerant.models.RootWithRefAndNoMeta :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -147,7 +147,7 @@ async def put_complex_type_ref_no_meta( # pylint: disable=inconsistent-return-s :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -195,7 +195,7 @@ async def get_complex_type_ref_with_meta(self, **kwargs: Any) -> _models.RootWit :rtype: ~xmlserviceversiontolerant.models.RootWithRefAndMeta :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -246,7 +246,7 @@ async def put_complex_type_ref_with_meta( # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -294,7 +294,7 @@ async def get_simple(self, **kwargs: Any) -> _models.Slideshow: :rtype: ~xmlserviceversiontolerant.models.Slideshow :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -346,7 +346,7 @@ async def put_simple( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -395,7 +395,7 @@ async def get_wrapped_lists(self, **kwargs: Any) -> _models.AppleBarrel: :rtype: ~xmlserviceversiontolerant.models.AppleBarrel :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -446,7 +446,7 @@ async def put_wrapped_lists( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -495,7 +495,7 @@ async def get_headers(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -541,7 +541,7 @@ async def get_empty_list(self, **kwargs: Any) -> _models.Slideshow: :rtype: ~xmlserviceversiontolerant.models.Slideshow :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -592,7 +592,7 @@ async def put_empty_list( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -640,7 +640,7 @@ async def get_empty_wrapped_lists(self, **kwargs: Any) -> _models.AppleBarrel: :rtype: ~xmlserviceversiontolerant.models.AppleBarrel :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -691,7 +691,7 @@ async def put_empty_wrapped_lists( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -739,7 +739,7 @@ async def get_root_list(self, **kwargs: Any) -> List[_models.Banana]: :rtype: ~xmlserviceversiontolerant.models.Banana :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -790,7 +790,7 @@ async def put_root_list( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -839,7 +839,7 @@ async def get_root_list_single_item(self, **kwargs: Any) -> List[_models.Banana] :rtype: ~xmlserviceversiontolerant.models.Banana :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -890,7 +890,7 @@ async def put_root_list_single_item( # pylint: disable=inconsistent-return-stat :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -939,7 +939,7 @@ async def get_empty_root_list(self, **kwargs: Any) -> List[_models.Banana]: :rtype: ~xmlserviceversiontolerant.models.Banana :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -990,7 +990,7 @@ async def put_empty_root_list( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1039,7 +1039,7 @@ async def get_empty_child_element(self, **kwargs: Any) -> _models.Banana: :rtype: ~xmlserviceversiontolerant.models.Banana :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1090,7 +1090,7 @@ async def put_empty_child_element( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1138,7 +1138,7 @@ async def list_containers(self, **kwargs: Any) -> _models.ListContainersResponse :rtype: ~xmlserviceversiontolerant.models.ListContainersResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1187,7 +1187,7 @@ async def get_service_properties(self, **kwargs: Any) -> _models.StorageServiceP :rtype: ~xmlserviceversiontolerant.models.StorageServiceProperties :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1242,7 +1242,7 @@ async def put_service_properties( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1294,7 +1294,7 @@ async def get_acls(self, **kwargs: Any) -> List[_models.SignedIdentifier]: :rtype: ~xmlserviceversiontolerant.models.SignedIdentifier :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1349,7 +1349,7 @@ async def put_acls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1404,7 +1404,7 @@ async def list_blobs(self, **kwargs: Any) -> _models.ListBlobsResponse: :rtype: ~xmlserviceversiontolerant.models.ListBlobsResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1494,7 +1494,7 @@ async def json_input( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1549,7 +1549,7 @@ async def json_output(self, **kwargs: Any) -> _models.JSONOutput: :rtype: ~xmlserviceversiontolerant.models.JSONOutput :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1597,7 +1597,7 @@ async def get_xms_text(self, **kwargs: Any) -> _models.ObjectWithXMsTextProperty :rtype: ~xmlserviceversiontolerant.models.ObjectWithXMsTextProperty :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1644,7 +1644,7 @@ async def get_bytes(self, **kwargs: Any) -> _models.ModelWithByteProperty: :rtype: ~xmlserviceversiontolerant.models.ModelWithByteProperty :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1696,7 +1696,7 @@ async def put_binary( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1745,7 +1745,7 @@ async def get_uri(self, **kwargs: Any) -> _models.ModelWithUrlProperty: :rtype: ~xmlserviceversiontolerant.models.ModelWithUrlProperty :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1797,7 +1797,7 @@ async def put_uri( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/XmlVersionTolerant/xmlserviceversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/XmlVersionTolerant/xmlserviceversiontolerant/operations/_operations.py index 96ad69aecff..c566534a121 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/XmlVersionTolerant/xmlserviceversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/XmlVersionTolerant/xmlserviceversiontolerant/operations/_operations.py @@ -595,7 +595,7 @@ def get_complex_type_ref_no_meta(self, **kwargs: Any) -> _models.RootWithRefAndN :rtype: ~xmlserviceversiontolerant.models.RootWithRefAndNoMeta :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -646,7 +646,7 @@ def put_complex_type_ref_no_meta( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -694,7 +694,7 @@ def get_complex_type_ref_with_meta(self, **kwargs: Any) -> _models.RootWithRefAn :rtype: ~xmlserviceversiontolerant.models.RootWithRefAndMeta :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -745,7 +745,7 @@ def put_complex_type_ref_with_meta( # pylint: disable=inconsistent-return-state :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -793,7 +793,7 @@ def get_simple(self, **kwargs: Any) -> _models.Slideshow: :rtype: ~xmlserviceversiontolerant.models.Slideshow :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -845,7 +845,7 @@ def put_simple( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -894,7 +894,7 @@ def get_wrapped_lists(self, **kwargs: Any) -> _models.AppleBarrel: :rtype: ~xmlserviceversiontolerant.models.AppleBarrel :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -945,7 +945,7 @@ def put_wrapped_lists( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -994,7 +994,7 @@ def get_headers(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1040,7 +1040,7 @@ def get_empty_list(self, **kwargs: Any) -> _models.Slideshow: :rtype: ~xmlserviceversiontolerant.models.Slideshow :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1091,7 +1091,7 @@ def put_empty_list( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1139,7 +1139,7 @@ def get_empty_wrapped_lists(self, **kwargs: Any) -> _models.AppleBarrel: :rtype: ~xmlserviceversiontolerant.models.AppleBarrel :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1190,7 +1190,7 @@ def put_empty_wrapped_lists( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1238,7 +1238,7 @@ def get_root_list(self, **kwargs: Any) -> List[_models.Banana]: :rtype: ~xmlserviceversiontolerant.models.Banana :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1289,7 +1289,7 @@ def put_root_list( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1338,7 +1338,7 @@ def get_root_list_single_item(self, **kwargs: Any) -> List[_models.Banana]: :rtype: ~xmlserviceversiontolerant.models.Banana :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1389,7 +1389,7 @@ def put_root_list_single_item( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1438,7 +1438,7 @@ def get_empty_root_list(self, **kwargs: Any) -> List[_models.Banana]: :rtype: ~xmlserviceversiontolerant.models.Banana :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1489,7 +1489,7 @@ def put_empty_root_list( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1538,7 +1538,7 @@ def get_empty_child_element(self, **kwargs: Any) -> _models.Banana: :rtype: ~xmlserviceversiontolerant.models.Banana :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1589,7 +1589,7 @@ def put_empty_child_element( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1637,7 +1637,7 @@ def list_containers(self, **kwargs: Any) -> _models.ListContainersResponse: :rtype: ~xmlserviceversiontolerant.models.ListContainersResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1686,7 +1686,7 @@ def get_service_properties(self, **kwargs: Any) -> _models.StorageServicePropert :rtype: ~xmlserviceversiontolerant.models.StorageServiceProperties :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1741,7 +1741,7 @@ def put_service_properties( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1793,7 +1793,7 @@ def get_acls(self, **kwargs: Any) -> List[_models.SignedIdentifier]: :rtype: ~xmlserviceversiontolerant.models.SignedIdentifier :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1848,7 +1848,7 @@ def put_acls( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1903,7 +1903,7 @@ def list_blobs(self, **kwargs: Any) -> _models.ListBlobsResponse: :rtype: ~xmlserviceversiontolerant.models.ListBlobsResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1993,7 +1993,7 @@ def json_input( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2048,7 +2048,7 @@ def json_output(self, **kwargs: Any) -> _models.JSONOutput: :rtype: ~xmlserviceversiontolerant.models.JSONOutput :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2096,7 +2096,7 @@ def get_xms_text(self, **kwargs: Any) -> _models.ObjectWithXMsTextProperty: :rtype: ~xmlserviceversiontolerant.models.ObjectWithXMsTextProperty :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2143,7 +2143,7 @@ def get_bytes(self, **kwargs: Any) -> _models.ModelWithByteProperty: :rtype: ~xmlserviceversiontolerant.models.ModelWithByteProperty :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2195,7 +2195,7 @@ def put_binary( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2244,7 +2244,7 @@ def get_uri(self, **kwargs: Any) -> _models.ModelWithUrlProperty: :rtype: ~xmlserviceversiontolerant.models.ModelWithUrlProperty :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2296,7 +2296,7 @@ def put_uri( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/XmsErrorResponseVersionTolerant/xmserrorresponseversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/XmsErrorResponseVersionTolerant/xmserrorresponseversiontolerant/aio/operations/_operations.py index fe7e0ed1daf..bb339ef9892 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/XmsErrorResponseVersionTolerant/xmserrorresponseversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/XmsErrorResponseVersionTolerant/xmserrorresponseversiontolerant/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -72,7 +72,7 @@ async def get_pet_by_id(self, pet_id: str, **kwargs: Any) -> Optional[JSON]: "name": "str" # Optional. Gets the Pet by id. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 409: ResourceExistsError, 304: ResourceNotModifiedError, @@ -137,7 +137,7 @@ async def do_something(self, what_action: str, **kwargs: Any) -> JSON: "actionResponse": "str" # Optional. action feedback. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -195,7 +195,7 @@ async def has_models_param( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/XmsErrorResponseVersionTolerant/xmserrorresponseversiontolerant/operations/_operations.py b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/XmsErrorResponseVersionTolerant/xmserrorresponseversiontolerant/operations/_operations.py index cf02be29bf7..d21084c5850 100644 --- a/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/XmsErrorResponseVersionTolerant/xmserrorresponseversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/vanilla/version-tolerant/Expected/AcceptanceTests/XmsErrorResponseVersionTolerant/xmserrorresponseversiontolerant/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -129,7 +129,7 @@ def get_pet_by_id(self, pet_id: str, **kwargs: Any) -> Optional[JSON]: "name": "str" # Optional. Gets the Pet by id. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 409: ResourceExistsError, 304: ResourceNotModifiedError, @@ -194,7 +194,7 @@ def do_something(self, what_action: str, **kwargs: Any) -> JSON: "actionResponse": "str" # Optional. action feedback. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -252,7 +252,7 @@ def has_models_param( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/authentication-api-key/authentication/apikey/_operations/_operations.py b/packages/typespec-python/test/azure/generated/authentication-api-key/authentication/apikey/_operations/_operations.py index 450007b7555..b38a3a4fbe3 100644 --- a/packages/typespec-python/test/azure/generated/authentication-api-key/authentication/apikey/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/authentication-api-key/authentication/apikey/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -68,7 +68,7 @@ def valid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-s :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -111,7 +111,7 @@ def invalid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/authentication-api-key/authentication/apikey/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/authentication-api-key/authentication/apikey/aio/_operations/_operations.py index b8bfd6ed760..8d29fc0062b 100644 --- a/packages/typespec-python/test/azure/generated/authentication-api-key/authentication/apikey/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/authentication-api-key/authentication/apikey/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -43,7 +43,7 @@ async def valid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -86,7 +86,7 @@ async def invalid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/authentication-http-custom/authentication/http/custom/_operations/_operations.py b/packages/typespec-python/test/azure/generated/authentication-http-custom/authentication/http/custom/_operations/_operations.py index fc20bd4ebde..2977fbf6324 100644 --- a/packages/typespec-python/test/azure/generated/authentication-http-custom/authentication/http/custom/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/authentication-http-custom/authentication/http/custom/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -68,7 +68,7 @@ def valid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-s :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -111,7 +111,7 @@ def invalid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/authentication-http-custom/authentication/http/custom/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/authentication-http-custom/authentication/http/custom/aio/_operations/_operations.py index 57a8d92fc27..c46ccf2c06b 100644 --- a/packages/typespec-python/test/azure/generated/authentication-http-custom/authentication/http/custom/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/authentication-http-custom/authentication/http/custom/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -43,7 +43,7 @@ async def valid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -86,7 +86,7 @@ async def invalid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/authentication-oauth2/authentication/oauth2/_operations/_operations.py b/packages/typespec-python/test/azure/generated/authentication-oauth2/authentication/oauth2/_operations/_operations.py index 618bea72b25..05d4e68cf79 100644 --- a/packages/typespec-python/test/azure/generated/authentication-oauth2/authentication/oauth2/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/authentication-oauth2/authentication/oauth2/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -68,7 +68,7 @@ def valid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-s :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -111,7 +111,7 @@ def invalid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/authentication-oauth2/authentication/oauth2/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/authentication-oauth2/authentication/oauth2/aio/_operations/_operations.py index 2f547042883..26f176873d3 100644 --- a/packages/typespec-python/test/azure/generated/authentication-oauth2/authentication/oauth2/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/authentication-oauth2/authentication/oauth2/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, @@ -43,7 +43,7 @@ async def valid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -86,7 +86,7 @@ async def invalid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/authentication-union/authentication/union/_operations/_operations.py b/packages/typespec-python/test/azure/generated/authentication-union/authentication/union/_operations/_operations.py index 809de303275..d6afb103bbb 100644 --- a/packages/typespec-python/test/azure/generated/authentication-union/authentication/union/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/authentication-union/authentication/union/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -58,7 +58,7 @@ def valid_key(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -101,7 +101,7 @@ def valid_token(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/authentication-union/authentication/union/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/authentication-union/authentication/union/aio/_operations/_operations.py index c77b68a4bf9..2446a85ebb7 100644 --- a/packages/typespec-python/test/azure/generated/authentication-union/authentication/union/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/authentication-union/authentication/union/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -41,7 +41,7 @@ async def valid_key(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -84,7 +84,7 @@ async def valid_token(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/operations/_operations.py index c3c33031467..acbe3ce3dad 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -79,7 +79,7 @@ async def no_decorator_in_public(self, *, name: str, **kwargs: Any) -> _models.N "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -141,7 +141,7 @@ async def public_decorator_in_public(self, *, name: str, **kwargs: Any) -> _mode "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -223,7 +223,7 @@ async def _no_decorator_in_internal( # pylint: disable=protected-access "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -291,7 +291,7 @@ async def _internal_decorator_in_internal( # pylint: disable=protected-access "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -359,7 +359,7 @@ async def _public_decorator_in_internal( "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -438,7 +438,7 @@ async def public(self, *, name: str, **kwargs: Any) -> _models.SharedModel: "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -499,7 +499,7 @@ async def _internal(self, *, name: str, **kwargs: Any) -> _models.SharedModel: "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -594,7 +594,7 @@ async def _operation( # pylint: disable=protected-access "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -672,7 +672,7 @@ async def _discriminator( # pylint: disable=protected-access # response body for status code(s): 200 response == abstract_model """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/operations/_operations.py index 21b97d101d7..ab056b1b3e6 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/specs/azure/clientgenerator/core/access/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -253,7 +253,7 @@ def no_decorator_in_public(self, *, name: str, **kwargs: Any) -> _models.NoDecor "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -315,7 +315,7 @@ def public_decorator_in_public(self, *, name: str, **kwargs: Any) -> _models.Pub "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -397,7 +397,7 @@ def _no_decorator_in_internal( # pylint: disable=protected-access "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -465,7 +465,7 @@ def _internal_decorator_in_internal( # pylint: disable=protected-access "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -531,7 +531,7 @@ def _public_decorator_in_internal(self, *, name: str, **kwargs: Any) -> _models. "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -610,7 +610,7 @@ def public(self, *, name: str, **kwargs: Any) -> _models.SharedModel: "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -671,7 +671,7 @@ def _internal(self, *, name: str, **kwargs: Any) -> _models.SharedModel: "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -764,7 +764,7 @@ def _operation(self, *, name: str, **kwargs: Any) -> _models._models.OuterModel: "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -842,7 +842,7 @@ def _discriminator( # pylint: disable=protected-access # response body for status code(s): 200 response == abstract_model """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten/type/model/flatten/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten/type/model/flatten/_operations/_operations.py index 596916b5c7f..b825ccccf99 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten/type/model/flatten/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten/type/model/flatten/_operations/_operations.py @@ -202,7 +202,7 @@ def put_flatten_model( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -398,7 +398,7 @@ def put_nested_flatten_model( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten/type/model/flatten/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten/type/model/flatten/aio/_operations/_operations.py index 2c444290e93..1c4c5038b45 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten/type/model/flatten/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten/type/model/flatten/aio/_operations/_operations.py @@ -168,7 +168,7 @@ async def put_flatten_model( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -364,7 +364,7 @@ async def put_nested_flatten_model( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/aio/operations/_operations.py index 9e8c17f0903..53107eba8af 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/aio/operations/_operations.py @@ -157,7 +157,7 @@ async def input_to_input_output( # pylint: disable=inconsistent-return-statemen "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -224,7 +224,7 @@ async def output_to_input_output(self, **kwargs: Any) -> _models.OutputModel: "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/operations/_operations.py index 99b96a26c39..5ec91963618 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/specs/azure/clientgenerator/core/usage/operations/_operations.py @@ -189,7 +189,7 @@ def input_to_input_output( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -256,7 +256,7 @@ def output_to_input_output(self, **kwargs: Any) -> _models.OutputModel: "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/aio/operations/_operations.py index bf8f715393f..33a478a9691 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/aio/operations/_operations.py @@ -92,7 +92,7 @@ def list_first_item(self, **kwargs: Any) -> AsyncIterable["_models.FirstItem"]: cls: ClsType[List[_models.FirstItem]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -175,7 +175,7 @@ def list_second_item(self, **kwargs: Any) -> AsyncIterable["_models.SecondItem"] cls: ClsType[List[_models.SecondItem]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -411,7 +411,7 @@ async def create_or_update( ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -645,7 +645,7 @@ async def create_or_replace( ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -735,7 +735,7 @@ async def get(self, id: int, **kwargs: Any) -> _models.User: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -836,7 +836,7 @@ def list( maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[List[_models.User]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -934,7 +934,7 @@ def list_with_page(self, **kwargs: Any) -> AsyncIterable["_models.User"]: cls: ClsType[List[_models.User]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1171,7 +1171,7 @@ def list_with_parameters( content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[List[_models.User]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1271,7 +1271,7 @@ def list_with_custom_page_model(self, **kwargs: Any) -> AsyncIterable["_models.U cls: ClsType[List[_models.User]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1344,7 +1344,7 @@ async def delete(self, id: int, **kwargs: Any) -> None: # pylint: disable=incon :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1412,7 +1412,7 @@ async def export(self, id: int, *, format: str, **kwargs: Any) -> _models.User: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/operations/_operations.py index c66982a758a..f4903470d70 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/operations/_operations.py @@ -358,7 +358,7 @@ def list_first_item(self, **kwargs: Any) -> Iterable["_models.FirstItem"]: cls: ClsType[List[_models.FirstItem]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -441,7 +441,7 @@ def list_second_item(self, **kwargs: Any) -> Iterable["_models.SecondItem"]: cls: ClsType[List[_models.SecondItem]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -675,7 +675,7 @@ def create_or_update(self, id: int, resource: Union[_models.User, JSON, IO[bytes ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -907,7 +907,7 @@ def create_or_replace(self, id: int, resource: Union[_models.User, JSON, IO[byte ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -997,7 +997,7 @@ def get(self, id: int, **kwargs: Any) -> _models.User: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1098,7 +1098,7 @@ def list( maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[List[_models.User]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1196,7 +1196,7 @@ def list_with_page(self, **kwargs: Any) -> Iterable["_models.User"]: cls: ClsType[List[_models.User]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1433,7 +1433,7 @@ def list_with_parameters( content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[List[_models.User]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1533,7 +1533,7 @@ def list_with_custom_page_model(self, **kwargs: Any) -> Iterable["_models.User"] cls: ClsType[List[_models.User]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1606,7 +1606,7 @@ def delete(self, id: int, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1674,7 +1674,7 @@ def export(self, id: int, *, format: str, **kwargs: Any) -> _models.User: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/azure-core-lro-standard/specs/azure/core/lro/standard/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-core-lro-standard/specs/azure/core/lro/standard/_operations/_operations.py index 4d39879cece..1f96a0707ee 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-lro-standard/specs/azure/core/lro/standard/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-core-lro-standard/specs/azure/core/lro/standard/_operations/_operations.py @@ -123,7 +123,7 @@ class StandardClientOperationsMixin(StandardClientMixinABC): def _create_or_replace_initial( self, name: str, resource: Union[_models.User, JSON, IO[bytes]], **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -362,7 +362,7 @@ def get_long_running_output(pipeline_response): ) def _delete_initial(self, name: str, **kwargs: Any) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -451,7 +451,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _export_initial(self, name: str, *, format: str, **kwargs: Any) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/azure-core-lro-standard/specs/azure/core/lro/standard/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-core-lro-standard/specs/azure/core/lro/standard/aio/_operations/_operations.py index 9aea59b38bd..32b597fc439 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-lro-standard/specs/azure/core/lro/standard/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-core-lro-standard/specs/azure/core/lro/standard/aio/_operations/_operations.py @@ -48,7 +48,7 @@ class StandardClientOperationsMixin(StandardClientMixinABC): async def _create_or_replace_initial( self, name: str, resource: Union[_models.User, JSON, IO[bytes]], **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -291,7 +291,7 @@ def get_long_running_output(pipeline_response): ) async def _delete_initial(self, name: str, **kwargs: Any) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -380,7 +380,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _export_initial(self, name: str, *, format: str, **kwargs: Any) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/azure-core-scalar/specs/azure/core/scalar/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-core-scalar/specs/azure/core/scalar/aio/operations/_operations.py index 17d0c946b52..8555c75468f 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-scalar/specs/azure/core/scalar/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-core-scalar/specs/azure/core/scalar/aio/operations/_operations.py @@ -68,7 +68,7 @@ async def get(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -120,7 +120,7 @@ async def put(self, body: str, **kwargs: Any) -> None: # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -262,7 +262,7 @@ async def post( "location": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -324,7 +324,7 @@ async def header(self, *, region: str, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +370,7 @@ async def query(self, *, region: str, **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/azure-core-scalar/specs/azure/core/scalar/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-core-scalar/specs/azure/core/scalar/operations/_operations.py index a1adf3dd59a..fc80e420ca6 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-scalar/specs/azure/core/scalar/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-core-scalar/specs/azure/core/scalar/operations/_operations.py @@ -137,7 +137,7 @@ def get(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -189,7 +189,7 @@ def put(self, body: str, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -329,7 +329,7 @@ def post( "location": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -391,7 +391,7 @@ def header(self, *, region: str, **kwargs: Any) -> None: # pylint: disable=inco :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -437,7 +437,7 @@ def query(self, *, region: str, **kwargs: Any) -> None: # pylint: disable=incon :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/azure-core-traits/specs/azure/core/traits/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-core-traits/specs/azure/core/traits/_operations/_operations.py index 587f65639da..20b95a45f6c 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-traits/specs/azure/core/traits/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-core-traits/specs/azure/core/traits/_operations/_operations.py @@ -165,7 +165,7 @@ def smoke_test( "name": "str" # Optional. The user's name. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -337,7 +337,7 @@ def repeatable_action( "userActionResult": "str" # User action result. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/azure-core-traits/specs/azure/core/traits/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-core-traits/specs/azure/core/traits/aio/_operations/_operations.py index 4a519385174..cf58138f41a 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-traits/specs/azure/core/traits/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-core-traits/specs/azure/core/traits/aio/_operations/_operations.py @@ -84,7 +84,7 @@ async def smoke_test( "name": "str" # Optional. The user's name. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -256,7 +256,7 @@ async def repeatable_action( "userActionResult": "str" # User action result. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/azure-mgmt-spheredpg/azure/mgmt/spheredpg/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-mgmt-spheredpg/azure/mgmt/spheredpg/aio/operations/_operations.py index e3204e3ad08..be38c1c3a80 100644 --- a/packages/typespec-python/test/azure/generated/azure-mgmt-spheredpg/azure/mgmt/spheredpg/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-mgmt-spheredpg/azure/mgmt/spheredpg/aio/operations/_operations.py @@ -150,7 +150,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -300,7 +300,7 @@ async def get(self, resource_group_name: str, catalog_name: str, **kwargs: Any) } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -354,7 +354,7 @@ async def _create_or_update_initial( resource: Union[_models.Catalog, JSON, IO[bytes]], **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1066,7 +1066,7 @@ async def update( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1126,7 +1126,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, catalog_name: str, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1314,7 +1314,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy cls: ClsType[List[_models.Catalog]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1430,7 +1430,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Catalog" cls: ClsType[List[_models.Catalog]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1516,7 +1516,7 @@ async def count_devices( "value": 0 # Number of children resources in parent resource. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1613,7 +1613,7 @@ def list_device_insights( maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[List[_models.DeviceInsight]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1761,7 +1761,7 @@ def list_devices( maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[List[_models.Device]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1957,7 +1957,7 @@ def list_deployments( maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[List[_models.Deployment]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2371,7 +2371,7 @@ def list_device_groups( maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[List[_models.DeviceGroup]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2532,7 +2532,7 @@ async def get(self, resource_group_name: str, catalog_name: str, image_name: str } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2665,7 +2665,7 @@ def list_by_catalog( maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[List[_models.Image]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2742,7 +2742,7 @@ async def _create_or_update_initial( resource: Union[_models.Image, JSON, IO[bytes]], **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3270,7 +3270,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, catalog_name: str, image_name: str, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3510,7 +3510,7 @@ def list_by_product( maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[List[_models.DeviceGroup]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3647,7 +3647,7 @@ async def get( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3705,7 +3705,7 @@ async def _create_or_update_initial( resource: Union[_models.DeviceGroup, JSON, IO[bytes]], **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4227,7 +4227,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, catalog_name: str, product_name: str, device_group_name: str, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4378,7 +4378,7 @@ async def _update_initial( properties: Union[_models.DeviceGroupUpdate, JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4871,7 +4871,7 @@ async def count_devices( "value": 0 # Number of children resources in parent resource. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5072,7 +5072,7 @@ async def claim_devices( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5208,7 +5208,7 @@ async def get( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5335,7 +5335,7 @@ def list_by_catalog( maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[List[_models.Certificate]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5431,7 +5431,7 @@ async def retrieve_cert_chain( "certificateChain": "str" # Optional. The certificate chain. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5693,7 +5693,7 @@ async def retrieve_proof_of_possession_nonce( "thumbprint": "str" # Optional. The certificate thumbprint. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5891,7 +5891,7 @@ async def get( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6075,7 +6075,7 @@ def list_by_device_group( maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[List[_models.Deployment]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6156,7 +6156,7 @@ async def _create_or_update_initial( resource: Union[_models.Deployment, JSON, IO[bytes]], **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6978,7 +6978,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements deployment_name: str, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7222,7 +7222,7 @@ async def get( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7282,7 +7282,7 @@ async def _create_or_update_initial( resource: Union[_models.Device, JSON, IO[bytes]], **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7873,7 +7873,7 @@ def list_by_device_group( cls: ClsType[List[_models.Device]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7949,7 +7949,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements device_name: str, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8437,7 +8437,7 @@ async def update( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8709,7 +8709,7 @@ async def generate_capability_image( encoded base 64 string. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8853,7 +8853,7 @@ def list_by_catalog( cls: ClsType[List[_models.Product]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8972,7 +8972,7 @@ async def get( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -9028,7 +9028,7 @@ async def _create_or_update_initial( resource: Union[_models.Product, JSON, IO[bytes]], **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -9470,7 +9470,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, catalog_name: str, product_name: str, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -9616,7 +9616,7 @@ async def _update_initial( properties: Union[_models.ProductUpdate, JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -10075,7 +10075,7 @@ def generate_default_device_groups( cls: ClsType[List[_models.DeviceGroup]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -10167,7 +10167,7 @@ async def count_devices( "value": 0 # Number of children resources in parent resource. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/azure-mgmt-spheredpg/azure/mgmt/spheredpg/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-mgmt-spheredpg/azure/mgmt/spheredpg/operations/_operations.py index 836deeff67e..c3c293bb186 100644 --- a/packages/typespec-python/test/azure/generated/azure-mgmt-spheredpg/azure/mgmt/spheredpg/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-mgmt-spheredpg/azure/mgmt/spheredpg/operations/_operations.py @@ -1636,7 +1636,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1786,7 +1786,7 @@ def get(self, resource_group_name: str, catalog_name: str, **kwargs: Any) -> _mo } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1840,7 +1840,7 @@ def _create_or_update_initial( resource: Union[_models.Catalog, JSON, IO[bytes]], **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2552,7 +2552,7 @@ def update( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2612,7 +2612,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, catalog_name: str, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2799,7 +2799,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite cls: ClsType[List[_models.Catalog]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2915,7 +2915,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.Catalog"]: cls: ClsType[List[_models.Catalog]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2999,7 +2999,7 @@ def count_devices(self, resource_group_name: str, catalog_name: str, **kwargs: A "value": 0 # Number of children resources in parent resource. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3096,7 +3096,7 @@ def list_device_insights( maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[List[_models.DeviceInsight]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3244,7 +3244,7 @@ def list_devices( maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[List[_models.Device]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3440,7 +3440,7 @@ def list_deployments( maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[List[_models.Deployment]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3854,7 +3854,7 @@ def list_device_groups( maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[List[_models.DeviceGroup]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4015,7 +4015,7 @@ def get(self, resource_group_name: str, catalog_name: str, image_name: str, **kw } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4148,7 +4148,7 @@ def list_by_catalog( maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[List[_models.Image]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4225,7 +4225,7 @@ def _create_or_update_initial( resource: Union[_models.Image, JSON, IO[bytes]], **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4753,7 +4753,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, catalog_name: str, image_name: str, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4992,7 +4992,7 @@ def list_by_product( maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[List[_models.DeviceGroup]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5129,7 +5129,7 @@ def get( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5187,7 +5187,7 @@ def _create_or_update_initial( resource: Union[_models.DeviceGroup, JSON, IO[bytes]], **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5709,7 +5709,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, catalog_name: str, product_name: str, device_group_name: str, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5859,7 +5859,7 @@ def _update_initial( properties: Union[_models.DeviceGroupUpdate, JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6352,7 +6352,7 @@ def count_devices( "value": 0 # Number of children resources in parent resource. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6553,7 +6553,7 @@ def claim_devices( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6689,7 +6689,7 @@ def get( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6816,7 +6816,7 @@ def list_by_catalog( maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[List[_models.Certificate]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6912,7 +6912,7 @@ def retrieve_cert_chain( "certificateChain": "str" # Optional. The certificate chain. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7174,7 +7174,7 @@ def retrieve_proof_of_possession_nonce( "thumbprint": "str" # Optional. The certificate thumbprint. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7372,7 +7372,7 @@ def get( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7556,7 +7556,7 @@ def list_by_device_group( maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[List[_models.Deployment]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7637,7 +7637,7 @@ def _create_or_update_initial( resource: Union[_models.Deployment, JSON, IO[bytes]], **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8459,7 +8459,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements deployment_name: str, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8702,7 +8702,7 @@ def get( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8762,7 +8762,7 @@ def _create_or_update_initial( resource: Union[_models.Device, JSON, IO[bytes]], **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -9353,7 +9353,7 @@ def list_by_device_group( cls: ClsType[List[_models.Device]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -9429,7 +9429,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements device_name: str, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -9916,7 +9916,7 @@ def update( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -10188,7 +10188,7 @@ def generate_capability_image( encoded base 64 string. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -10332,7 +10332,7 @@ def list_by_catalog( cls: ClsType[List[_models.Product]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -10449,7 +10449,7 @@ def get(self, resource_group_name: str, catalog_name: str, product_name: str, ** } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -10505,7 +10505,7 @@ def _create_or_update_initial( resource: Union[_models.Product, JSON, IO[bytes]], **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -10947,7 +10947,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, catalog_name: str, product_name: str, **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -11092,7 +11092,7 @@ def _update_initial( properties: Union[_models.ProductUpdate, JSON, IO[bytes]], **kwargs: Any ) -> Optional[JSON]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -11551,7 +11551,7 @@ def generate_default_device_groups( cls: ClsType[List[_models.DeviceGroup]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -11643,7 +11643,7 @@ def count_devices( "value": 0 # Number of children resources in parent resource. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_operations/_operations.py index 06ec31edb47..16a3ced965b 100644 --- a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_operations/_operations.py @@ -67,7 +67,7 @@ def build_rpc_long_running_rpc_request(**kwargs: Any) -> HttpRequest: class RpcClientOperationsMixin(RpcClientMixinABC): def _long_running_rpc_initial(self, body: Union[_models.GenerationOptions, JSON, IO[bytes]], **kwargs: Any) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/aio/_operations/_operations.py index 50aa64c1625..1df4470d8a0 100644 --- a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/aio/_operations/_operations.py @@ -44,7 +44,7 @@ class RpcClientOperationsMixin(RpcClientMixinABC): async def _long_running_rpc_initial( self, body: Union[_models.GenerationOptions, JSON, IO[bytes]], **kwargs: Any ) -> JSON: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpclegacy/azurecore/lro/rpclegacy/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azurecore-lro-rpclegacy/azurecore/lro/rpclegacy/aio/operations/_operations.py index c1d64b5ae58..b2f859fc06c 100644 --- a/packages/typespec-python/test/azure/generated/azurecore-lro-rpclegacy/azurecore/lro/rpclegacy/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azurecore-lro-rpclegacy/azurecore/lro/rpclegacy/aio/operations/_operations.py @@ -104,7 +104,7 @@ async def get_job(self, job_id: str, **kwargs: Any) -> _models.JobResult: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -151,7 +151,7 @@ async def get_job(self, job_id: str, **kwargs: Any) -> _models.JobResult: async def _create_job_initial( # pylint: disable=inconsistent-return-statements self, body: Union[_models.JobData, JSON, IO[bytes]], **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpclegacy/azurecore/lro/rpclegacy/operations/_operations.py b/packages/typespec-python/test/azure/generated/azurecore-lro-rpclegacy/azurecore/lro/rpclegacy/operations/_operations.py index 19c62e26deb..a305f61039d 100644 --- a/packages/typespec-python/test/azure/generated/azurecore-lro-rpclegacy/azurecore/lro/rpclegacy/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azurecore-lro-rpclegacy/azurecore/lro/rpclegacy/operations/_operations.py @@ -154,7 +154,7 @@ def get_job(self, job_id: str, **kwargs: Any) -> _models.JobResult: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -201,7 +201,7 @@ def get_job(self, job_id: str, **kwargs: Any) -> _models.JobResult: def _create_job_initial( # pylint: disable=inconsistent-return-statements self, body: Union[_models.JobData, JSON, IO[bytes]], **kwargs: Any ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/operations/_operations.py index 0f58d896cba..bc86f3880f6 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/aio/operations/_operations.py @@ -143,7 +143,7 @@ async def client( # pylint: disable=inconsistent-return-statements "defaultName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -264,7 +264,7 @@ async def language( # pylint: disable=inconsistent-return-statements "defaultName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -339,7 +339,7 @@ async def union_enum_name( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -391,7 +391,7 @@ async def union_enum_member_name( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -441,7 +441,7 @@ async def client_name(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -488,7 +488,7 @@ async def parameter( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -600,7 +600,7 @@ async def client( # pylint: disable=inconsistent-return-statements "defaultName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -721,7 +721,7 @@ async def language( # pylint: disable=inconsistent-return-statements "defaultName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -843,7 +843,7 @@ async def compatible_with_encoded_name( # pylint: disable=inconsistent-return-s "wireName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -900,7 +900,7 @@ async def request( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -944,7 +944,7 @@ async def response(self, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/client-naming/client/naming/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-naming/client/naming/operations/_operations.py index 0f108089cec..0ead9ff948b 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/client/naming/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-naming/client/naming/operations/_operations.py @@ -268,7 +268,7 @@ def client( # pylint: disable=inconsistent-return-statements "defaultName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -389,7 +389,7 @@ def language( # pylint: disable=inconsistent-return-statements "defaultName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +464,7 @@ def union_enum_name( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -516,7 +516,7 @@ def union_enum_member_name( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -566,7 +566,7 @@ def client_name(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -611,7 +611,7 @@ def parameter(self, *, client_name: str, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -723,7 +723,7 @@ def client( # pylint: disable=inconsistent-return-statements "defaultName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -844,7 +844,7 @@ def language( # pylint: disable=inconsistent-return-statements "defaultName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -966,7 +966,7 @@ def compatible_with_encoded_name( # pylint: disable=inconsistent-return-stateme "wireName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1021,7 +1021,7 @@ def request(self, *, client_name: str, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1065,7 +1065,7 @@ def response(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retur :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/_operations.py index 425ed5c09f7..db46162d84f 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -89,7 +89,7 @@ async def eight(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -154,7 +154,7 @@ async def three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -201,7 +201,7 @@ async def four(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -266,7 +266,7 @@ async def five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -313,7 +313,7 @@ async def six(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -362,7 +362,7 @@ async def one(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -409,7 +409,7 @@ async def two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -474,7 +474,7 @@ async def seven(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -539,7 +539,7 @@ async def nine(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/_operations.py index f737e67dc8a..c770e5cbf41 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -145,7 +145,7 @@ def eight(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-s :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -210,7 +210,7 @@ def three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-s :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -257,7 +257,7 @@ def four(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +322,7 @@ def five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -369,7 +369,7 @@ def six(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -418,7 +418,7 @@ def one(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -465,7 +465,7 @@ def two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -530,7 +530,7 @@ def seven(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-s :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -595,7 +595,7 @@ def nine(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/_operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/_operations/_operations.py index 6dbda94810d..b4d43e48d8b 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -86,7 +86,7 @@ def renamed_one(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -133,7 +133,7 @@ def renamed_three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -180,7 +180,7 @@ def renamed_five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -229,7 +229,7 @@ def renamed_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -276,7 +276,7 @@ def renamed_four(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -323,7 +323,7 @@ def renamed_six(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/aio/_operations/_operations.py index c599c8be055..5e82810b14b 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -48,7 +48,7 @@ async def renamed_one(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -95,7 +95,7 @@ async def renamed_three(self, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -142,7 +142,7 @@ async def renamed_five(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -191,7 +191,7 @@ async def renamed_two(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -238,7 +238,7 @@ async def renamed_four(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -285,7 +285,7 @@ async def renamed_six(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/aio/operations/_operations.py index 41a35c98a24..ba0d762221c 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -64,7 +64,7 @@ async def renamed_two(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -111,7 +111,7 @@ async def renamed_four(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -158,7 +158,7 @@ async def renamed_six(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -207,7 +207,7 @@ async def renamed_one(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -254,7 +254,7 @@ async def renamed_three(self, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -301,7 +301,7 @@ async def renamed_five(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/operations/_operations.py index 6f7084e6950..5444e49c26e 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -102,7 +102,7 @@ def renamed_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -149,7 +149,7 @@ def renamed_four(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -196,7 +196,7 @@ def renamed_six(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -245,7 +245,7 @@ def renamed_one(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -292,7 +292,7 @@ def renamed_three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -339,7 +339,7 @@ def renamed_five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/aio/operations/_operations.py index a345091102a..e851660e670 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -63,7 +63,7 @@ async def one(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -110,7 +110,7 @@ async def three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -157,7 +157,7 @@ async def four(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -222,7 +222,7 @@ async def two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -269,7 +269,7 @@ async def five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -316,7 +316,7 @@ async def six(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/operations/_operations.py index 697e3b5e58f..1dec360d065 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -101,7 +101,7 @@ def one(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -148,7 +148,7 @@ def three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-s :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -195,7 +195,7 @@ def four(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -260,7 +260,7 @@ def two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -307,7 +307,7 @@ def five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -354,7 +354,7 @@ def six(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/aio/operations/_operations.py index afabbefbc4c..ca9f97331d4 100644 --- a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/aio/operations/_operations.py @@ -87,7 +87,7 @@ async def default(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -133,7 +133,7 @@ async def base64(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -179,7 +179,7 @@ async def base64url(self, *, value: bytes, **kwargs: Any) -> None: # pylint: di :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -227,7 +227,7 @@ async def base64url_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -383,7 +383,7 @@ async def default( "value": bytes("bytes", encoding="utf-8") # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -537,7 +537,7 @@ async def base64( "value": bytes("bytes", encoding="utf-8") # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -691,7 +691,7 @@ async def base64url( "value": bytes("bytes", encoding="utf-8") # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -862,7 +862,7 @@ async def base64url_array( ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -942,7 +942,7 @@ async def default(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -988,7 +988,7 @@ async def base64(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1034,7 +1034,7 @@ async def base64url(self, *, value: bytes, **kwargs: Any) -> None: # pylint: di :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1082,7 +1082,7 @@ async def base64url_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1146,7 +1146,7 @@ async def default(self, value: bytes, **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1196,7 +1196,7 @@ async def octet_stream(self, value: bytes, **kwargs: Any) -> None: # pylint: di :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1248,7 +1248,7 @@ async def custom_content_type( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1298,7 +1298,7 @@ async def base64(self, value: bytes, **kwargs: Any) -> None: # pylint: disable= :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1348,7 +1348,7 @@ async def base64url(self, value: bytes, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1414,7 +1414,7 @@ async def default(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1464,7 +1464,7 @@ async def octet_stream(self, **kwargs: Any) -> AsyncIterator[bytes]: :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1511,7 +1511,7 @@ async def custom_content_type(self, **kwargs: Any) -> AsyncIterator[bytes]: :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1558,7 +1558,7 @@ async def base64(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1608,7 +1608,7 @@ async def base64url(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/operations/_operations.py index d3471cc12b5..3e14788f492 100644 --- a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/operations/_operations.py @@ -366,7 +366,7 @@ def default(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -412,7 +412,7 @@ def base64(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +458,7 @@ def base64url(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable= :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -506,7 +506,7 @@ def base64url_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -662,7 +662,7 @@ def default( "value": bytes("bytes", encoding="utf-8") # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -816,7 +816,7 @@ def base64( "value": bytes("bytes", encoding="utf-8") # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -970,7 +970,7 @@ def base64url( "value": bytes("bytes", encoding="utf-8") # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1141,7 +1141,7 @@ def base64url_array( ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1221,7 +1221,7 @@ def default(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1267,7 +1267,7 @@ def base64(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1313,7 +1313,7 @@ def base64url(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable= :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1361,7 +1361,7 @@ def base64url_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1425,7 +1425,7 @@ def default(self, value: bytes, **kwargs: Any) -> None: # pylint: disable=incon :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1475,7 +1475,7 @@ def octet_stream(self, value: bytes, **kwargs: Any) -> None: # pylint: disable= :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1527,7 +1527,7 @@ def custom_content_type( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1577,7 +1577,7 @@ def base64(self, value: bytes, **kwargs: Any) -> None: # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1627,7 +1627,7 @@ def base64url(self, value: bytes, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1693,7 +1693,7 @@ def default(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1743,7 +1743,7 @@ def octet_stream(self, **kwargs: Any) -> Iterator[bytes]: :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1790,7 +1790,7 @@ def custom_content_type(self, **kwargs: Any) -> Iterator[bytes]: :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1837,7 +1837,7 @@ def base64(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1887,7 +1887,7 @@ def base64url(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/aio/operations/_operations.py index d1a52676743..5355af89f56 100644 --- a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/aio/operations/_operations.py @@ -87,7 +87,7 @@ async def default( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -135,7 +135,7 @@ async def rfc3339( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -183,7 +183,7 @@ async def rfc7231( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -231,7 +231,7 @@ async def unix_timestamp( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -279,7 +279,7 @@ async def unix_timestamp_array( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -435,7 +435,7 @@ async def default( "value": "2020-02-20 00:00:00" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -589,7 +589,7 @@ async def rfc3339( "value": "2020-02-20 00:00:00" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -743,7 +743,7 @@ async def rfc7231( "value": "2020-02-20 00:00:00" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -902,7 +902,7 @@ async def unix_timestamp( "value": "2020-02-20 00:00:00" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1073,7 +1073,7 @@ async def unix_timestamp_array( ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1155,7 +1155,7 @@ async def default( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1203,7 +1203,7 @@ async def rfc3339( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1251,7 +1251,7 @@ async def rfc7231( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1299,7 +1299,7 @@ async def unix_timestamp( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1347,7 +1347,7 @@ async def unix_timestamp_array( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1409,7 +1409,7 @@ async def default(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1455,7 +1455,7 @@ async def rfc3339(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1501,7 +1501,7 @@ async def rfc7231(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1547,7 +1547,7 @@ async def unix_timestamp(self, **kwargs: Any) -> None: # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/operations/_operations.py index 0f8156f356d..87c3417f71c 100644 --- a/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-datetime/encode/datetime/operations/_operations.py @@ -305,7 +305,7 @@ def default( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -353,7 +353,7 @@ def rfc3339( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -401,7 +401,7 @@ def rfc7231( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -449,7 +449,7 @@ def unix_timestamp( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -497,7 +497,7 @@ def unix_timestamp_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -653,7 +653,7 @@ def default( "value": "2020-02-20 00:00:00" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -807,7 +807,7 @@ def rfc3339( "value": "2020-02-20 00:00:00" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -961,7 +961,7 @@ def rfc7231( "value": "2020-02-20 00:00:00" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1120,7 +1120,7 @@ def unix_timestamp( "value": "2020-02-20 00:00:00" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1291,7 +1291,7 @@ def unix_timestamp_array( ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1373,7 +1373,7 @@ def default( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1421,7 +1421,7 @@ def rfc3339( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1469,7 +1469,7 @@ def rfc7231( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1517,7 +1517,7 @@ def unix_timestamp( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1565,7 +1565,7 @@ def unix_timestamp_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1627,7 +1627,7 @@ def default(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1673,7 +1673,7 @@ def rfc3339(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1719,7 +1719,7 @@ def rfc7231(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1765,7 +1765,7 @@ def unix_timestamp(self, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/operations/_operations.py index cf3ca630582..9e0476214be 100644 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/aio/operations/_operations.py @@ -83,7 +83,7 @@ async def default( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -131,7 +131,7 @@ async def iso8601( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -179,7 +179,7 @@ async def int32_seconds( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -227,7 +227,7 @@ async def float_seconds( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -275,7 +275,7 @@ async def int32_seconds_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -431,7 +431,7 @@ async def default( "value": "1 day, 0:00:00" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -585,7 +585,7 @@ async def iso8601( "value": "1 day, 0:00:00" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -744,7 +744,7 @@ async def int32_seconds( "value": 0 # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -903,7 +903,7 @@ async def float_seconds( "value": 0.0 # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1074,7 +1074,7 @@ async def float_seconds_array( ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1156,7 +1156,7 @@ async def default( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1204,7 +1204,7 @@ async def iso8601( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1252,7 +1252,7 @@ async def iso8601_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1300,7 +1300,7 @@ async def int32_seconds( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1348,7 +1348,7 @@ async def float_seconds( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/operations/_operations.py index 9f7e11e0584..9c8d091fd5b 100644 --- a/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-duration/encode/duration/operations/_operations.py @@ -275,7 +275,7 @@ def default( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -323,7 +323,7 @@ def iso8601( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -369,7 +369,7 @@ def int32_seconds(self, *, input: int, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -415,7 +415,7 @@ def float_seconds(self, *, input: float, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -463,7 +463,7 @@ def int32_seconds_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -619,7 +619,7 @@ def default( "value": "1 day, 0:00:00" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -773,7 +773,7 @@ def iso8601( "value": "1 day, 0:00:00" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -932,7 +932,7 @@ def int32_seconds( "value": 0 # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1091,7 +1091,7 @@ def float_seconds( "value": 0.0 # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1262,7 +1262,7 @@ def float_seconds_array( ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1344,7 +1344,7 @@ def default( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1392,7 +1392,7 @@ def iso8601( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1440,7 +1440,7 @@ def iso8601_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1486,7 +1486,7 @@ def int32_seconds(self, *, duration: int, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1534,7 +1534,7 @@ def float_seconds( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/headasbooleanfalse/headasbooleanfalse/_operations/_operations.py b/packages/typespec-python/test/azure/generated/headasbooleanfalse/headasbooleanfalse/_operations/_operations.py index ec510ed081e..3c0f53242fa 100644 --- a/packages/typespec-python/test/azure/generated/headasbooleanfalse/headasbooleanfalse/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/headasbooleanfalse/headasbooleanfalse/_operations/_operations.py @@ -291,7 +291,7 @@ def get_model( ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -439,7 +439,7 @@ def head_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -580,7 +580,7 @@ def put_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -721,7 +721,7 @@ def patch_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -862,7 +862,7 @@ def post_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1003,7 +1003,7 @@ def delete_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/headasbooleanfalse/headasbooleanfalse/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/headasbooleanfalse/headasbooleanfalse/aio/_operations/_operations.py index 8ba38b4d692..c704c4b6f11 100644 --- a/packages/typespec-python/test/azure/generated/headasbooleanfalse/headasbooleanfalse/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/headasbooleanfalse/headasbooleanfalse/aio/_operations/_operations.py @@ -208,7 +208,7 @@ async def get_model( ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -356,7 +356,7 @@ async def head_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -497,7 +497,7 @@ async def put_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -638,7 +638,7 @@ async def patch_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -779,7 +779,7 @@ async def post_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -920,7 +920,7 @@ async def delete_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/headasbooleantrue/headasbooleantrue/_operations/_operations.py b/packages/typespec-python/test/azure/generated/headasbooleantrue/headasbooleantrue/_operations/_operations.py index 32652d75b47..c909ef896b9 100644 --- a/packages/typespec-python/test/azure/generated/headasbooleantrue/headasbooleantrue/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/headasbooleantrue/headasbooleantrue/_operations/_operations.py @@ -291,7 +291,7 @@ def get_model( ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -433,7 +433,7 @@ def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **k ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +575,7 @@ def put_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -716,7 +716,7 @@ def patch_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -857,7 +857,7 @@ def post_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -998,7 +998,7 @@ def delete_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/headasbooleantrue/headasbooleantrue/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/headasbooleantrue/headasbooleantrue/aio/_operations/_operations.py index 3b978908419..7def87f4071 100644 --- a/packages/typespec-python/test/azure/generated/headasbooleantrue/headasbooleantrue/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/headasbooleantrue/headasbooleantrue/aio/_operations/_operations.py @@ -208,7 +208,7 @@ async def get_model( ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -350,7 +350,7 @@ async def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes] ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -492,7 +492,7 @@ async def put_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -633,7 +633,7 @@ async def patch_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -774,7 +774,7 @@ async def post_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -915,7 +915,7 @@ async def delete_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/operations/_operations.py index f7dac8dc3ee..07843463cad 100644 --- a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/aio/operations/_operations.py @@ -136,7 +136,7 @@ async def set( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -260,7 +260,7 @@ async def omit( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +386,7 @@ async def required_explicit( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -507,7 +507,7 @@ async def required_implicit( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/operations/_operations.py index 23e0c7c3618..42f0c466292 100644 --- a/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/parameters/bodyoptionality/operations/_operations.py @@ -190,7 +190,7 @@ def set( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -314,7 +314,7 @@ def omit( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -440,7 +440,7 @@ def required_explicit( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -561,7 +561,7 @@ def required_implicit( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/aio/operations/_operations.py index eb3e7b28719..f6db068d731 100644 --- a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, List, Optional, Type, TypeVar +from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -67,7 +67,7 @@ async def multi( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -113,7 +113,7 @@ async def ssv(self, *, colors: List[str], **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -159,7 +159,7 @@ async def tsv(self, *, colors: List[str], **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -207,7 +207,7 @@ async def pipes( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -253,7 +253,7 @@ async def csv(self, *, colors: List[str], **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -317,7 +317,7 @@ async def csv(self, *, colors: List[str], **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/operations/_operations.py index f34a04c0e42..b4463910e84 100644 --- a/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/parameters/collectionformat/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, List, Optional, Type, TypeVar +from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -134,7 +134,7 @@ def multi(self, *, colors: List[str], **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -180,7 +180,7 @@ def ssv(self, *, colors: List[str], **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -226,7 +226,7 @@ def tsv(self, *, colors: List[str], **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -272,7 +272,7 @@ def pipes(self, *, colors: List[str], **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -318,7 +318,7 @@ def csv(self, *, colors: List[str], **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -382,7 +382,7 @@ def csv(self, *, colors: List[str], **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/operations/_operations.py index 3dfe39ff677..32a54a80ccd 100644 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/aio/operations/_operations.py @@ -136,7 +136,7 @@ async def spread_as_request_body( # pylint: disable=inconsistent-return-stateme "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -277,7 +277,7 @@ async def spread_as_request_body( # pylint: disable=inconsistent-return-stateme "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -427,7 +427,7 @@ async def spread_as_request_parameter( # pylint: disable=inconsistent-return-st "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -625,7 +625,7 @@ async def spread_with_multiple_parameters( # pylint: disable=inconsistent-retur "prop6": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/operations/_operations.py b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/operations/_operations.py index 72ff3e9fd3d..b356a403730 100644 --- a/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-spread/parameters/spread/operations/_operations.py @@ -206,7 +206,7 @@ def spread_as_request_body( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -347,7 +347,7 @@ def spread_as_request_body( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -497,7 +497,7 @@ def spread_as_request_parameter( # pylint: disable=inconsistent-return-statemen "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -695,7 +695,7 @@ def spread_with_multiple_parameters( # pylint: disable=inconsistent-return-stat "prop6": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/operations/_operations.py index a327654f4f9..7138ef5d54d 100644 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterator, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, AsyncIterator, Callable, Dict, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -64,7 +64,7 @@ async def get_avatar_as_png(self, **kwargs: Any) -> AsyncIterator[bytes]: :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -113,7 +113,7 @@ async def get_avatar_as_jpeg(self, **kwargs: Any) -> AsyncIterator[bytes]: :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -180,7 +180,7 @@ async def get_avatar_as_png(self, **kwargs: Any) -> AsyncIterator[bytes]: :rtype: AsyncIterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -237,7 +237,7 @@ async def get_avatar_as_json(self, **kwargs: Any) -> _models.PngImageAsJson: "content": bytes("bytes", encoding="utf-8") # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/operations/_operations.py index 97a89ad7cfc..753defd9884 100644 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/payload/contentnegotiation/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterator, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterator, Literal, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -114,7 +114,7 @@ def get_avatar_as_png(self, **kwargs: Any) -> Iterator[bytes]: :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -163,7 +163,7 @@ def get_avatar_as_jpeg(self, **kwargs: Any) -> Iterator[bytes]: :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -230,7 +230,7 @@ def get_avatar_as_png(self, **kwargs: Any) -> Iterator[bytes]: :rtype: Iterator[bytes] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -287,7 +287,7 @@ def get_avatar_as_json(self, **kwargs: Any) -> _models.PngImageAsJson: "content": bytes("bytes", encoding="utf-8") # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/payload-json-merge-patch/payload/jsonmergepatch/_operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-json-merge-patch/payload/jsonmergepatch/_operations/_operations.py index 497a6be58bd..ede6f167cd7 100644 --- a/packages/typespec-python/test/azure/generated/payload-json-merge-patch/payload/jsonmergepatch/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-json-merge-patch/payload/jsonmergepatch/_operations/_operations.py @@ -325,7 +325,7 @@ def create_resource(self, body: Union[_models.Resource, JSON, IO[bytes]], **kwar } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -607,7 +607,7 @@ def update_resource(self, body: Union[_models.ResourcePatch, JSON, IO[bytes]], * } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -896,7 +896,7 @@ def update_optional_resource( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/payload-json-merge-patch/payload/jsonmergepatch/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-json-merge-patch/payload/jsonmergepatch/aio/_operations/_operations.py index 3fd5ce98882..ef393d6369b 100644 --- a/packages/typespec-python/test/azure/generated/payload-json-merge-patch/payload/jsonmergepatch/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-json-merge-patch/payload/jsonmergepatch/aio/_operations/_operations.py @@ -275,7 +275,7 @@ async def create_resource(self, body: Union[_models.Resource, JSON, IO[bytes]], } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -559,7 +559,7 @@ async def update_resource( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -848,7 +848,7 @@ async def update_optional_resource( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/aio/operations/_operations.py index 755ff4644ac..f10180928f0 100644 --- a/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/aio/operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import json import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -66,7 +66,7 @@ async def send_as_text(self, text: str, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -114,7 +114,7 @@ async def get_as_text(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -166,7 +166,7 @@ async def send_as_json(self, text: str, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -214,7 +214,7 @@ async def get_as_json(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/operations/_operations.py index bd30008cc58..1857133e078 100644 --- a/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-media-type/payload/mediatype/operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import json import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -118,7 +118,7 @@ def send_as_text(self, text: str, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -166,7 +166,7 @@ def get_as_text(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -218,7 +218,7 @@ def send_as_json(self, text: str, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -266,7 +266,7 @@ def get_as_json(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/operations/_operations.py index d122be68422..4b99e1a676d 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/operations/_operations.py @@ -113,7 +113,7 @@ async def basic( # pylint: disable=inconsistent-return-statements "profileImage": filetype } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -227,7 +227,7 @@ async def complex( # pylint: disable=inconsistent-return-statements "profileImage": filetype } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -327,7 +327,7 @@ async def json_part( # pylint: disable=inconsistent-return-statements "profileImage": filetype } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -425,7 +425,7 @@ async def binary_array_parts( # pylint: disable=inconsistent-return-statements "pictures": [filetype] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -531,7 +531,7 @@ async def json_array_parts( # pylint: disable=inconsistent-return-statements "profileImage": filetype } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -629,7 +629,7 @@ async def multi_binary_parts( # pylint: disable=inconsistent-return-statements "picture": filetype } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +727,7 @@ async def check_file_name_and_content_type( # pylint: disable=inconsistent-retu "profileImage": filetype } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/operations/_operations.py index c76636a6014..6e0e5aeafbc 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/operations/_operations.py @@ -174,7 +174,7 @@ def basic( # pylint: disable=inconsistent-return-statements "profileImage": filetype } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -288,7 +288,7 @@ def complex( # pylint: disable=inconsistent-return-statements "profileImage": filetype } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -388,7 +388,7 @@ def json_part( # pylint: disable=inconsistent-return-statements "profileImage": filetype } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -484,7 +484,7 @@ def binary_array_parts( # pylint: disable=inconsistent-return-statements "pictures": [filetype] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +588,7 @@ def json_array_parts( # pylint: disable=inconsistent-return-statements "profileImage": filetype } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -684,7 +684,7 @@ def multi_binary_parts( # pylint: disable=inconsistent-return-statements "picture": filetype } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -782,7 +782,7 @@ def check_file_name_and_content_type( # pylint: disable=inconsistent-return-sta "profileImage": filetype } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/_operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/_operations/_operations.py index 12bafdd8b53..fd44cad8d6e 100644 --- a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, List, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterable, List, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -81,7 +81,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.User"]: maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[List[_models.User]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/aio/_operations/_operations.py index d6298ee75a8..abebf754220 100644 --- a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, Type, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, List, Optional, Type, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -58,7 +58,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.User"]: maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[List[_models.User]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_operations.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_operations.py index 45f28f033f1..96090a7829a 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -84,7 +84,7 @@ def from_none(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -140,7 +140,7 @@ def from_one_required( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -196,7 +196,7 @@ def from_one_optional( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_operations.py index 76a33de52ff..958e4852974 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -48,7 +48,7 @@ async def from_none(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -104,7 +104,7 @@ async def from_one_required( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -160,7 +160,7 @@ async def from_one_optional( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_operations.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_operations.py index 927f7c1db98..d4f55a4559d 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -108,7 +108,7 @@ def add_operation(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -163,7 +163,7 @@ def from_none(self, *, new_parameter: Optional[str] = None, **kwargs: Any) -> bo :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -225,7 +225,7 @@ def from_one_required( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -287,7 +287,7 @@ def from_one_optional( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_operations.py index 3178eb67c7a..a92a214804b 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -52,7 +52,7 @@ async def add_operation(self, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -107,7 +107,7 @@ async def from_none(self, *, new_parameter: Optional[str] = None, **kwargs: Any) :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +169,7 @@ async def from_one_required( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -231,7 +231,7 @@ async def from_one_optional( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/operations/_operations.py index 81c4b5b8530..cc8c2a7b0aa 100644 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/operations/_operations.py @@ -130,7 +130,7 @@ async def send( # pylint: disable=inconsistent-return-statements "wireName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -191,7 +191,7 @@ async def get(self, **kwargs: Any) -> _models.JsonEncodedNameModel: "wireName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/operations/_operations.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/operations/_operations.py index ac504c1a142..b70611b99ac 100644 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/serialization/encodedname/json/operations/_operations.py @@ -161,7 +161,7 @@ def send( # pylint: disable=inconsistent-return-statements "wireName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -222,7 +222,7 @@ def get(self, **kwargs: Any) -> _models.JsonEncodedNameModel: "wireName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/server/endpoint/notdefined/_operations/_operations.py b/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/server/endpoint/notdefined/_operations/_operations.py index 5f541fa3c35..bb6903d7656 100644 --- a/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/server/endpoint/notdefined/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/server/endpoint/notdefined/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -51,7 +51,7 @@ def valid(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/server/endpoint/notdefined/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/server/endpoint/notdefined/aio/_operations/_operations.py index 4fa13262a4c..700a1af1318 100644 --- a/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/server/endpoint/notdefined/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/server-endpoint-not-defined/server/endpoint/notdefined/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -41,7 +41,7 @@ async def valid(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/_operations/_operations.py b/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/_operations/_operations.py index 520097eb31a..f832d7c2d94 100644 --- a/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -65,7 +65,7 @@ def no_operation_params(self, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -116,7 +116,7 @@ def with_operation_path_param( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/aio/_operations/_operations.py index 902888d5b4c..c5dab7222b3 100644 --- a/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -44,7 +44,7 @@ async def no_operation_params(self, **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -95,7 +95,7 @@ async def with_operation_path_param( # pylint: disable=inconsistent-return-stat :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/_operations/_operations.py b/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/_operations/_operations.py index bd9b0502d43..fef66412eda 100644 --- a/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -51,7 +51,7 @@ def my_op(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/aio/_operations/_operations.py index d23d50ba23a..d5470bb41c6 100644 --- a/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -41,7 +41,7 @@ async def my_op(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/_operations/_operations.py b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/_operations/_operations.py index c7cbd3d5787..24acafb6ee1 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -80,7 +80,7 @@ def without_api_version(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -127,7 +127,7 @@ def with_query_api_version(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -175,7 +175,7 @@ def with_path_api_version(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/aio/_operations/_operations.py index 1a61a1f32e8..a002f56edf9 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -45,7 +45,7 @@ async def without_api_version(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -92,7 +92,7 @@ async def with_query_api_version(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -140,7 +140,7 @@ async def with_path_api_version(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/_operations/_operations.py b/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/_operations/_operations.py index 037b7989a77..9a7f25b43e5 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -78,7 +78,7 @@ def without_api_version(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -125,7 +125,7 @@ def with_query_api_version(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -173,7 +173,7 @@ def with_path_api_version(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/aio/_operations/_operations.py index 034289ace3d..faec16b9c1b 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -45,7 +45,7 @@ async def without_api_version(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -92,7 +92,7 @@ async def with_query_api_version(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -140,7 +140,7 @@ async def with_path_api_version(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/special-headers-client-request-id/specialheaders/clientrequestid/_operations/_operations.py b/packages/typespec-python/test/azure/generated/special-headers-client-request-id/specialheaders/clientrequestid/_operations/_operations.py index 396a2dab029..03f26ac4a10 100644 --- a/packages/typespec-python/test/azure/generated/special-headers-client-request-id/specialheaders/clientrequestid/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/special-headers-client-request-id/specialheaders/clientrequestid/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -56,7 +56,7 @@ def get(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/special-headers-client-request-id/specialheaders/clientrequestid/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/special-headers-client-request-id/specialheaders/clientrequestid/aio/_operations/_operations.py index 980abe66304..db86460d37d 100644 --- a/packages/typespec-python/test/azure/generated/special-headers-client-request-id/specialheaders/clientrequestid/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/special-headers-client-request-id/specialheaders/clientrequestid/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -41,7 +41,7 @@ async def get(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/special-headers-conditional-request/specialheaders/conditionalrequest/_operations/_operations.py b/packages/typespec-python/test/azure/generated/special-headers-conditional-request/specialheaders/conditionalrequest/_operations/_operations.py index 395aa8e944e..a357ea5e67f 100644 --- a/packages/typespec-python/test/azure/generated/special-headers-conditional-request/specialheaders/conditionalrequest/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/special-headers-conditional-request/specialheaders/conditionalrequest/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core import MatchConditions from azure.core.exceptions import ( @@ -92,7 +92,7 @@ def post_if_match( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -150,7 +150,7 @@ def post_if_none_match( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/special-headers-conditional-request/specialheaders/conditionalrequest/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/special-headers-conditional-request/specialheaders/conditionalrequest/aio/_operations/_operations.py index a275e2817bd..ad5513a3e1c 100644 --- a/packages/typespec-python/test/azure/generated/special-headers-conditional-request/specialheaders/conditionalrequest/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/special-headers-conditional-request/specialheaders/conditionalrequest/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core import MatchConditions from azure.core.exceptions import ( @@ -53,7 +53,7 @@ async def post_if_match( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -111,7 +111,7 @@ async def post_if_none_match( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/special-headers-repeatability/specialheaders/repeatability/_operations/_operations.py b/packages/typespec-python/test/azure/generated/special-headers-repeatability/specialheaders/repeatability/_operations/_operations.py index 7848385ed4b..bfbdb7bda9a 100644 --- a/packages/typespec-python/test/azure/generated/special-headers-repeatability/specialheaders/repeatability/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/special-headers-repeatability/specialheaders/repeatability/_operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union import uuid from azure.core.exceptions import ( @@ -64,7 +64,7 @@ def immediate_success(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/special-headers-repeatability/specialheaders/repeatability/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/special-headers-repeatability/specialheaders/repeatability/aio/_operations/_operations.py index 095fda7c910..a5d5b2aa89b 100644 --- a/packages/typespec-python/test/azure/generated/special-headers-repeatability/specialheaders/repeatability/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/special-headers-repeatability/specialheaders/repeatability/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -41,7 +41,7 @@ async def immediate_success(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/operations/_operations.py index 4c171921e6f..da9181cc1c5 100644 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/aio/operations/_operations.py @@ -232,7 +232,7 @@ async def with_and( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -353,7 +353,7 @@ async def with_as( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -474,7 +474,7 @@ async def with_assert( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -595,7 +595,7 @@ async def with_async( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -716,7 +716,7 @@ async def with_await( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -837,7 +837,7 @@ async def with_break( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -958,7 +958,7 @@ async def with_class( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1079,7 +1079,7 @@ async def with_constructor( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1200,7 +1200,7 @@ async def with_continue( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1321,7 +1321,7 @@ async def with_def( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1442,7 +1442,7 @@ async def with_del( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1563,7 +1563,7 @@ async def with_elif( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1684,7 +1684,7 @@ async def with_else( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1805,7 +1805,7 @@ async def with_except( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1926,7 +1926,7 @@ async def with_exec( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2047,7 +2047,7 @@ async def with_finally( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2168,7 +2168,7 @@ async def with_for( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2289,7 +2289,7 @@ async def with_from( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2410,7 +2410,7 @@ async def with_global( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2531,7 +2531,7 @@ async def with_if( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2652,7 +2652,7 @@ async def with_import( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2773,7 +2773,7 @@ async def with_in( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2894,7 +2894,7 @@ async def with_is( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3015,7 +3015,7 @@ async def with_lambda( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3136,7 +3136,7 @@ async def with_not( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3257,7 +3257,7 @@ async def with_or( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3378,7 +3378,7 @@ async def with_pass( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3499,7 +3499,7 @@ async def with_raise( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3620,7 +3620,7 @@ async def with_return( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3741,7 +3741,7 @@ async def with_try( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3862,7 +3862,7 @@ async def with_while( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3983,7 +3983,7 @@ async def with_with( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4104,7 +4104,7 @@ async def with_yield( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4243,7 +4243,7 @@ async def same_as_model( # pylint: disable=inconsistent-return-statements "SameAsModel": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4314,7 +4314,7 @@ async def and_method(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4357,7 +4357,7 @@ async def as_method(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4400,7 +4400,7 @@ async def assert_method(self, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4443,7 +4443,7 @@ async def async_method(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4486,7 +4486,7 @@ async def await_method(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4529,7 +4529,7 @@ async def break_method(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4572,7 +4572,7 @@ async def class_method(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4615,7 +4615,7 @@ async def constructor(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4658,7 +4658,7 @@ async def continue_method(self, **kwargs: Any) -> None: # pylint: disable=incon :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4701,7 +4701,7 @@ async def def_method(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4744,7 +4744,7 @@ async def del_method(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4787,7 +4787,7 @@ async def elif_method(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4830,7 +4830,7 @@ async def else_method(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4873,7 +4873,7 @@ async def except_method(self, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4916,7 +4916,7 @@ async def exec_method(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4959,7 +4959,7 @@ async def finally_method(self, **kwargs: Any) -> None: # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5002,7 +5002,7 @@ async def for_method(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5045,7 +5045,7 @@ async def from_method(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5088,7 +5088,7 @@ async def global_method(self, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5131,7 +5131,7 @@ async def if_method(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5174,7 +5174,7 @@ async def import_method(self, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5217,7 +5217,7 @@ async def in_method(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5260,7 +5260,7 @@ async def is_method(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5303,7 +5303,7 @@ async def lambda_method(self, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5346,7 +5346,7 @@ async def not_method(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5389,7 +5389,7 @@ async def or_method(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5432,7 +5432,7 @@ async def pass_method(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5475,7 +5475,7 @@ async def raise_method(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5518,7 +5518,7 @@ async def return_method(self, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5561,7 +5561,7 @@ async def try_method(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5604,7 +5604,7 @@ async def while_method(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5647,7 +5647,7 @@ async def with_method(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5690,7 +5690,7 @@ async def yield_method(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5755,7 +5755,7 @@ async def with_and( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5803,7 +5803,7 @@ async def with_as( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5851,7 +5851,7 @@ async def with_assert( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5899,7 +5899,7 @@ async def with_async( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5947,7 +5947,7 @@ async def with_await( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5995,7 +5995,7 @@ async def with_break( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6043,7 +6043,7 @@ async def with_class( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6091,7 +6091,7 @@ async def with_constructor( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6139,7 +6139,7 @@ async def with_continue( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6187,7 +6187,7 @@ async def with_def( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6235,7 +6235,7 @@ async def with_del( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6283,7 +6283,7 @@ async def with_elif( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6331,7 +6331,7 @@ async def with_else( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6379,7 +6379,7 @@ async def with_except( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6427,7 +6427,7 @@ async def with_exec( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6475,7 +6475,7 @@ async def with_finally( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6523,7 +6523,7 @@ async def with_for( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6571,7 +6571,7 @@ async def with_from( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6619,7 +6619,7 @@ async def with_global( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6667,7 +6667,7 @@ async def with_if( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6715,7 +6715,7 @@ async def with_import( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6763,7 +6763,7 @@ async def with_in( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6811,7 +6811,7 @@ async def with_is( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6859,7 +6859,7 @@ async def with_lambda( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6907,7 +6907,7 @@ async def with_not( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6955,7 +6955,7 @@ async def with_or( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7003,7 +7003,7 @@ async def with_pass( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7051,7 +7051,7 @@ async def with_raise( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7099,7 +7099,7 @@ async def with_return( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7147,7 +7147,7 @@ async def with_try( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7195,7 +7195,7 @@ async def with_while( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7243,7 +7243,7 @@ async def with_with( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7291,7 +7291,7 @@ async def with_yield( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7339,7 +7339,7 @@ async def with_cancellation_token( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/special-words/specialwords/operations/_operations.py b/packages/typespec-python/test/azure/generated/special-words/specialwords/operations/_operations.py index 16ddcca0ece..53a60c316a0 100644 --- a/packages/typespec-python/test/azure/generated/special-words/specialwords/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/special-words/specialwords/operations/_operations.py @@ -1252,7 +1252,7 @@ def with_and( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1373,7 +1373,7 @@ def with_as( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1494,7 +1494,7 @@ def with_assert( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1615,7 +1615,7 @@ def with_async( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1736,7 +1736,7 @@ def with_await( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1857,7 +1857,7 @@ def with_break( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1978,7 +1978,7 @@ def with_class( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2099,7 +2099,7 @@ def with_constructor( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2220,7 +2220,7 @@ def with_continue( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2341,7 +2341,7 @@ def with_def( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2462,7 +2462,7 @@ def with_del( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2583,7 +2583,7 @@ def with_elif( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2704,7 +2704,7 @@ def with_else( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2825,7 +2825,7 @@ def with_except( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2946,7 +2946,7 @@ def with_exec( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3067,7 +3067,7 @@ def with_finally( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3188,7 +3188,7 @@ def with_for( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3309,7 +3309,7 @@ def with_from( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3430,7 +3430,7 @@ def with_global( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3551,7 +3551,7 @@ def with_if( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3672,7 +3672,7 @@ def with_import( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3793,7 +3793,7 @@ def with_in( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3914,7 +3914,7 @@ def with_is( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4035,7 +4035,7 @@ def with_lambda( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4156,7 +4156,7 @@ def with_not( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4277,7 +4277,7 @@ def with_or( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4398,7 +4398,7 @@ def with_pass( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4519,7 +4519,7 @@ def with_raise( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4640,7 +4640,7 @@ def with_return( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4761,7 +4761,7 @@ def with_try( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4882,7 +4882,7 @@ def with_while( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5003,7 +5003,7 @@ def with_with( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5124,7 +5124,7 @@ def with_yield( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5263,7 +5263,7 @@ def same_as_model( # pylint: disable=inconsistent-return-statements "SameAsModel": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5334,7 +5334,7 @@ def and_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5377,7 +5377,7 @@ def as_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5420,7 +5420,7 @@ def assert_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5463,7 +5463,7 @@ def async_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5506,7 +5506,7 @@ def await_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5549,7 +5549,7 @@ def break_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5592,7 +5592,7 @@ def class_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5635,7 +5635,7 @@ def constructor(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5678,7 +5678,7 @@ def continue_method(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5721,7 +5721,7 @@ def def_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5764,7 +5764,7 @@ def del_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5807,7 +5807,7 @@ def elif_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5850,7 +5850,7 @@ def else_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5893,7 +5893,7 @@ def except_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5936,7 +5936,7 @@ def exec_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5979,7 +5979,7 @@ def finally_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6022,7 +6022,7 @@ def for_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6065,7 +6065,7 @@ def from_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6108,7 +6108,7 @@ def global_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6151,7 +6151,7 @@ def if_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6194,7 +6194,7 @@ def import_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6237,7 +6237,7 @@ def in_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6280,7 +6280,7 @@ def is_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6323,7 +6323,7 @@ def lambda_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6366,7 +6366,7 @@ def not_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6409,7 +6409,7 @@ def or_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6452,7 +6452,7 @@ def pass_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6495,7 +6495,7 @@ def raise_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6538,7 +6538,7 @@ def return_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6581,7 +6581,7 @@ def try_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6624,7 +6624,7 @@ def while_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6667,7 +6667,7 @@ def with_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6710,7 +6710,7 @@ def yield_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6773,7 +6773,7 @@ def with_and(self, *, and_parameter: str, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6819,7 +6819,7 @@ def with_as(self, *, as_parameter: str, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6867,7 +6867,7 @@ def with_assert( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6915,7 +6915,7 @@ def with_async( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6963,7 +6963,7 @@ def with_await( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7011,7 +7011,7 @@ def with_break( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7059,7 +7059,7 @@ def with_class( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7107,7 +7107,7 @@ def with_constructor( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7155,7 +7155,7 @@ def with_continue( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7201,7 +7201,7 @@ def with_def(self, *, def_parameter: str, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7247,7 +7247,7 @@ def with_del(self, *, del_parameter: str, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7295,7 +7295,7 @@ def with_elif( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7343,7 +7343,7 @@ def with_else( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7391,7 +7391,7 @@ def with_except( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7439,7 +7439,7 @@ def with_exec( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7487,7 +7487,7 @@ def with_finally( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7533,7 +7533,7 @@ def with_for(self, *, for_parameter: str, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7581,7 +7581,7 @@ def with_from( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7629,7 +7629,7 @@ def with_global( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7675,7 +7675,7 @@ def with_if(self, *, if_parameter: str, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7723,7 +7723,7 @@ def with_import( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7769,7 +7769,7 @@ def with_in(self, *, in_parameter: str, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7815,7 +7815,7 @@ def with_is(self, *, is_parameter: str, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7863,7 +7863,7 @@ def with_lambda( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7909,7 +7909,7 @@ def with_not(self, *, not_parameter: str, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7955,7 +7955,7 @@ def with_or(self, *, or_parameter: str, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8003,7 +8003,7 @@ def with_pass( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8051,7 +8051,7 @@ def with_raise( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8099,7 +8099,7 @@ def with_return( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8145,7 +8145,7 @@ def with_try(self, *, try_parameter: str, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8193,7 +8193,7 @@ def with_while( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8241,7 +8241,7 @@ def with_with( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8289,7 +8289,7 @@ def with_yield( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8337,7 +8337,7 @@ def with_cancellation_token( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-array/typetest/array/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-array/typetest/array/aio/operations/_operations.py index 53074749aec..768265c5991 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/typetest/array/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/typetest/array/aio/operations/_operations.py @@ -91,7 +91,7 @@ async def get(self, **kwargs: Any) -> List[int]: 0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -185,7 +185,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -264,7 +264,7 @@ async def get(self, **kwargs: Any) -> List[int]: 0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -358,7 +358,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -437,7 +437,7 @@ async def get(self, **kwargs: Any) -> List[bool]: bool # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -531,7 +531,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -610,7 +610,7 @@ async def get(self, **kwargs: Any) -> List[str]: "str" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -704,7 +704,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -783,7 +783,7 @@ async def get(self, **kwargs: Any) -> List[float]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -877,7 +877,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -956,7 +956,7 @@ async def get(self, **kwargs: Any) -> List[datetime.datetime]: "2020-02-20 00:00:00" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1050,7 +1050,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1129,7 +1129,7 @@ async def get(self, **kwargs: Any) -> List[datetime.timedelta]: "1 day, 0:00:00" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1223,7 +1223,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1302,7 +1302,7 @@ async def get(self, **kwargs: Any) -> List[Any]: {} # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1396,7 +1396,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1480,7 +1480,7 @@ async def get(self, **kwargs: Any) -> List[_models.InnerModel]: } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1579,7 +1579,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1658,7 +1658,7 @@ async def get(self, **kwargs: Any) -> List[float]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1752,7 +1752,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-array/typetest/array/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-array/typetest/array/operations/_operations.py index 2bfaae98bc7..c7222fc4303 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/typetest/array/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/typetest/array/operations/_operations.py @@ -353,7 +353,7 @@ def get(self, **kwargs: Any) -> List[int]: 0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -447,7 +447,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -526,7 +526,7 @@ def get(self, **kwargs: Any) -> List[int]: 0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -620,7 +620,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -699,7 +699,7 @@ def get(self, **kwargs: Any) -> List[bool]: bool # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -793,7 +793,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -872,7 +872,7 @@ def get(self, **kwargs: Any) -> List[str]: "str" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -966,7 +966,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1045,7 +1045,7 @@ def get(self, **kwargs: Any) -> List[float]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1139,7 +1139,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1218,7 +1218,7 @@ def get(self, **kwargs: Any) -> List[datetime.datetime]: "2020-02-20 00:00:00" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1312,7 +1312,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1391,7 +1391,7 @@ def get(self, **kwargs: Any) -> List[datetime.timedelta]: "1 day, 0:00:00" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1485,7 +1485,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1564,7 +1564,7 @@ def get(self, **kwargs: Any) -> List[Any]: {} # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1658,7 +1658,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1742,7 +1742,7 @@ def get(self, **kwargs: Any) -> List[_models.InnerModel]: } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1841,7 +1841,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1920,7 +1920,7 @@ def get(self, **kwargs: Any) -> List[float]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2014,7 +2014,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/typetest/dictionary/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/typetest/dictionary/aio/operations/_operations.py index fad7da00d69..cf1ca41a8c4 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/typetest/dictionary/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/typetest/dictionary/aio/operations/_operations.py @@ -93,7 +93,7 @@ async def get(self, **kwargs: Any) -> Dict[str, int]: "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -187,7 +187,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -266,7 +266,7 @@ async def get(self, **kwargs: Any) -> Dict[str, int]: "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -360,7 +360,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -439,7 +439,7 @@ async def get(self, **kwargs: Any) -> Dict[str, bool]: "str": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -533,7 +533,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -612,7 +612,7 @@ async def get(self, **kwargs: Any) -> Dict[str, str]: "str": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -706,7 +706,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -785,7 +785,7 @@ async def get(self, **kwargs: Any) -> Dict[str, float]: "str": 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -879,7 +879,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -958,7 +958,7 @@ async def get(self, **kwargs: Any) -> Dict[str, datetime.datetime]: "str": "2020-02-20 00:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1052,7 +1052,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1131,7 +1131,7 @@ async def get(self, **kwargs: Any) -> Dict[str, datetime.timedelta]: "str": "1 day, 0:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1225,7 +1225,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1304,7 +1304,7 @@ async def get(self, **kwargs: Any) -> Dict[str, Any]: "str": {} # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1398,7 +1398,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1482,7 +1482,7 @@ async def get(self, **kwargs: Any) -> Dict[str, _models.InnerModel]: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1581,7 +1581,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1665,7 +1665,7 @@ async def get(self, **kwargs: Any) -> Dict[str, _models.InnerModel]: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1764,7 +1764,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1843,7 +1843,7 @@ async def get(self, **kwargs: Any) -> Dict[str, float]: "str": 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1937,7 +1937,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/typetest/dictionary/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/typetest/dictionary/operations/_operations.py index 04de7f817a1..614057162ef 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/typetest/dictionary/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/typetest/dictionary/operations/_operations.py @@ -381,7 +381,7 @@ def get(self, **kwargs: Any) -> Dict[str, int]: "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -475,7 +475,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -554,7 +554,7 @@ def get(self, **kwargs: Any) -> Dict[str, int]: "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -648,7 +648,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +727,7 @@ def get(self, **kwargs: Any) -> Dict[str, bool]: "str": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -821,7 +821,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -900,7 +900,7 @@ def get(self, **kwargs: Any) -> Dict[str, str]: "str": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -994,7 +994,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1073,7 +1073,7 @@ def get(self, **kwargs: Any) -> Dict[str, float]: "str": 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1167,7 +1167,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1246,7 +1246,7 @@ def get(self, **kwargs: Any) -> Dict[str, datetime.datetime]: "str": "2020-02-20 00:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1340,7 +1340,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1419,7 +1419,7 @@ def get(self, **kwargs: Any) -> Dict[str, datetime.timedelta]: "str": "1 day, 0:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1513,7 +1513,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1592,7 +1592,7 @@ def get(self, **kwargs: Any) -> Dict[str, Any]: "str": {} # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1686,7 +1686,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1770,7 +1770,7 @@ def get(self, **kwargs: Any) -> Dict[str, _models.InnerModel]: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1869,7 +1869,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1953,7 +1953,7 @@ def get(self, **kwargs: Any) -> Dict[str, _models.InnerModel]: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2052,7 +2052,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2131,7 +2131,7 @@ def get(self, **kwargs: Any) -> Dict[str, float]: "str": 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2225,7 +2225,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-enum-extensible/typetest/enum/extensible/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-enum-extensible/typetest/enum/extensible/aio/operations/_operations.py index 7a240cda2ad..106f2636d13 100644 --- a/packages/typespec-python/test/azure/generated/typetest-enum-extensible/typetest/enum/extensible/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-enum-extensible/typetest/enum/extensible/aio/operations/_operations.py @@ -65,7 +65,7 @@ async def get_known_value(self, **kwargs: Any) -> Union[str, _models.DaysOfWeekE :rtype: str or ~typetest.enum.extensible.models.DaysOfWeekExtensibleEnum :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -115,7 +115,7 @@ async def get_unknown_value(self, **kwargs: Any) -> Union[str, _models.DaysOfWee :rtype: str or ~typetest.enum.extensible.models.DaysOfWeekExtensibleEnum :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +170,7 @@ async def put_known_value( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -223,7 +223,7 @@ async def put_unknown_value( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-enum-extensible/typetest/enum/extensible/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-enum-extensible/typetest/enum/extensible/operations/_operations.py index 5a318b8144f..e507789d60b 100644 --- a/packages/typespec-python/test/azure/generated/typetest-enum-extensible/typetest/enum/extensible/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-enum-extensible/typetest/enum/extensible/operations/_operations.py @@ -117,7 +117,7 @@ def get_known_value(self, **kwargs: Any) -> Union[str, _models.DaysOfWeekExtensi :rtype: str or ~typetest.enum.extensible.models.DaysOfWeekExtensibleEnum :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -167,7 +167,7 @@ def get_unknown_value(self, **kwargs: Any) -> Union[str, _models.DaysOfWeekExten :rtype: str or ~typetest.enum.extensible.models.DaysOfWeekExtensibleEnum :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -222,7 +222,7 @@ def put_known_value( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -275,7 +275,7 @@ def put_unknown_value( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-enum-fixed/typetest/enum/fixed/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-enum-fixed/typetest/enum/fixed/aio/operations/_operations.py index 0409b987dda..68f933ed6d4 100644 --- a/packages/typespec-python/test/azure/generated/typetest-enum-fixed/typetest/enum/fixed/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-enum-fixed/typetest/enum/fixed/aio/operations/_operations.py @@ -64,7 +64,7 @@ async def get_known_value(self, **kwargs: Any) -> Union[str, _models.DaysOfWeekE :rtype: str or ~typetest.enum.fixed.models.DaysOfWeekEnum :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -119,7 +119,7 @@ async def put_known_value( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +172,7 @@ async def put_unknown_value( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-enum-fixed/typetest/enum/fixed/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-enum-fixed/typetest/enum/fixed/operations/_operations.py index 48a555847d4..4204e3b1326 100644 --- a/packages/typespec-python/test/azure/generated/typetest-enum-fixed/typetest/enum/fixed/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-enum-fixed/typetest/enum/fixed/operations/_operations.py @@ -103,7 +103,7 @@ def get_known_value(self, **kwargs: Any) -> Union[str, _models.DaysOfWeekEnum]: :rtype: str or ~typetest.enum.fixed.models.DaysOfWeekEnum :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -158,7 +158,7 @@ def put_known_value( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -211,7 +211,7 @@ def put_unknown_value( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-empty/typetest/model/empty/_operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-model-empty/typetest/model/empty/_operations/_operations.py index 2e9df5904df..1e8b933748f 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-empty/typetest/model/empty/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-empty/typetest/model/empty/_operations/_operations.py @@ -159,7 +159,7 @@ def put_empty( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. input = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -212,7 +212,7 @@ def get_empty(self, **kwargs: Any) -> _models.EmptyOutput: :rtype: ~typetest.model.empty.models.EmptyOutput :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -326,7 +326,7 @@ def post_round_trip_empty( # JSON input template you can fill out and use as your body input. body = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-empty/typetest/model/empty/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-model-empty/typetest/model/empty/aio/_operations/_operations.py index 530344b1e36..41163d1e666 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-empty/typetest/model/empty/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-empty/typetest/model/empty/aio/_operations/_operations.py @@ -115,7 +115,7 @@ async def put_empty( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. input = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +168,7 @@ async def get_empty(self, **kwargs: Any) -> _models.EmptyOutput: :rtype: ~typetest.model.empty.models.EmptyOutput :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +282,7 @@ async def post_round_trip_empty( # JSON input template you can fill out and use as your body input. body = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/_operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/_operations/_operations.py index 9313aedd6ec..56978df979e 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/_operations/_operations.py @@ -189,7 +189,7 @@ def get_extensible_model(self, **kwargs: Any) -> _models.Dog: # response body for status code(s): 200 response == dog """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -321,7 +321,7 @@ def put_extensible_model( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. input = dog """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -389,7 +389,7 @@ def get_extensible_model_missing_discriminator(self, **kwargs: Any) -> _models.D # response body for status code(s): 200 response == dog """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -454,7 +454,7 @@ def get_extensible_model_wrong_discriminator(self, **kwargs: Any) -> _models.Dog # response body for status code(s): 200 response == dog """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -519,7 +519,7 @@ def get_fixed_model(self, **kwargs: Any) -> _models.Snake: # response body for status code(s): 200 response == snake """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -651,7 +651,7 @@ def put_fixed_model( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. input = snake """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -719,7 +719,7 @@ def get_fixed_model_missing_discriminator(self, **kwargs: Any) -> _models.Snake: # response body for status code(s): 200 response == snake """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -784,7 +784,7 @@ def get_fixed_model_wrong_discriminator(self, **kwargs: Any) -> _models.Snake: # response body for status code(s): 200 response == snake """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/aio/_operations/_operations.py index c34a07597d2..3f596d3fe6c 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/aio/_operations/_operations.py @@ -71,7 +71,7 @@ async def get_extensible_model(self, **kwargs: Any) -> _models.Dog: # response body for status code(s): 200 response == dog """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -203,7 +203,7 @@ async def put_extensible_model( # pylint: disable=inconsistent-return-statement # JSON input template you can fill out and use as your body input. input = dog """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -273,7 +273,7 @@ async def get_extensible_model_missing_discriminator( # pylint: disable=name-to # response body for status code(s): 200 response == dog """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -338,7 +338,7 @@ async def get_extensible_model_wrong_discriminator(self, **kwargs: Any) -> _mode # response body for status code(s): 200 response == dog """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -403,7 +403,7 @@ async def get_fixed_model(self, **kwargs: Any) -> _models.Snake: # response body for status code(s): 200 response == snake """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -535,7 +535,7 @@ async def put_fixed_model( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. input = snake """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -603,7 +603,7 @@ async def get_fixed_model_missing_discriminator(self, **kwargs: Any) -> _models. # response body for status code(s): 200 response == snake """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -668,7 +668,7 @@ async def get_fixed_model_wrong_discriminator(self, **kwargs: Any) -> _models.Sn # response body for status code(s): 200 response == snake """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/_operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/_operations/_operations.py index 4ab7037f805..3d2a662b969 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/_operations/_operations.py @@ -176,7 +176,7 @@ def get_model(self, **kwargs: Any) -> _models.Fish: # response body for status code(s): 200 response == fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -346,7 +346,7 @@ def put_model( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. input = fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -433,7 +433,7 @@ def get_recursive_model(self, **kwargs: Any) -> _models.Fish: # response body for status code(s): 200 response == fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -603,7 +603,7 @@ def put_recursive_model( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. input = fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -690,7 +690,7 @@ def get_missing_discriminator(self, **kwargs: Any) -> _models.Fish: # response body for status code(s): 200 response == fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -774,7 +774,7 @@ def get_wrong_discriminator(self, **kwargs: Any) -> _models.Fish: # response body for status code(s): 200 response == fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/aio/_operations/_operations.py index 77c93246e6c..82df7df58c0 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/aio/_operations/_operations.py @@ -88,7 +88,7 @@ async def get_model(self, **kwargs: Any) -> _models.Fish: # response body for status code(s): 200 response == fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -258,7 +258,7 @@ async def put_model( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. input = fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -345,7 +345,7 @@ async def get_recursive_model(self, **kwargs: Any) -> _models.Fish: # response body for status code(s): 200 response == fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -515,7 +515,7 @@ async def put_recursive_model( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. input = fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -602,7 +602,7 @@ async def get_missing_discriminator(self, **kwargs: Any) -> _models.Fish: # response body for status code(s): 200 response == fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -686,7 +686,7 @@ async def get_wrong_discriminator(self, **kwargs: Any) -> _models.Fish: # response body for status code(s): 200 response == fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/_operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/_operations/_operations.py index f2baf57c55c..a4840ecddec 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/_operations/_operations.py @@ -167,7 +167,7 @@ def post_valid( # pylint: disable=inconsistent-return-statements "smart": bool # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -230,7 +230,7 @@ def get_valid(self, **kwargs: Any) -> _models.Siamese: "smart": bool # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -380,7 +380,7 @@ def put_valid(self, input: Union[_models.Siamese, JSON, IO[bytes]], **kwargs: An "smart": bool # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/aio/_operations/_operations.py index a2eb43913d1..0ad25ee3a62 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/aio/_operations/_operations.py @@ -123,7 +123,7 @@ async def post_valid( # pylint: disable=inconsistent-return-statements "smart": bool # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -186,7 +186,7 @@ async def get_valid(self, **kwargs: Any) -> _models.Siamese: "smart": bool # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -338,7 +338,7 @@ async def put_valid(self, input: Union[_models.Siamese, JSON, IO[bytes]], **kwar "smart": bool # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-recursive/typetest/model/recursive/_operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-model-recursive/typetest/model/recursive/_operations/_operations.py index 16571b0ffa6..ab84c735143 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-recursive/typetest/model/recursive/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-recursive/typetest/model/recursive/_operations/_operations.py @@ -152,7 +152,7 @@ def put( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -216,7 +216,7 @@ def get(self, **kwargs: Any) -> _models.Extension: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-recursive/typetest/model/recursive/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-model-recursive/typetest/model/recursive/aio/_operations/_operations.py index 399ef599743..16329ef6e3e 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-recursive/typetest/model/recursive/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-recursive/typetest/model/recursive/aio/_operations/_operations.py @@ -121,7 +121,7 @@ async def put( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -185,7 +185,7 @@ async def get(self, **kwargs: Any) -> _models.Extension: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/_operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/_operations/_operations.py index 44029cd96a6..9df72c6dc2b 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/_operations/_operations.py @@ -196,7 +196,7 @@ def get_model(self, **kwargs: Any) -> _models.Bird: # response body for status code(s): 200 response == bird """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +378,7 @@ def put_model( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. input = bird """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -471,7 +471,7 @@ def get_recursive_model(self, **kwargs: Any) -> _models.Bird: # response body for status code(s): 200 response == bird """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -653,7 +653,7 @@ def put_recursive_model( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. input = bird """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -746,7 +746,7 @@ def get_missing_discriminator(self, **kwargs: Any) -> _models.Bird: # response body for status code(s): 200 response == bird """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -836,7 +836,7 @@ def get_wrong_discriminator(self, **kwargs: Any) -> _models.Bird: # response body for status code(s): 200 response == bird """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -901,7 +901,7 @@ def get_legacy_model(self, **kwargs: Any) -> _models.Dinosaur: # response body for status code(s): 200 response == dinosaur """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/aio/_operations/_operations.py index e2b629ba054..4f5aee7b139 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/aio/_operations/_operations.py @@ -95,7 +95,7 @@ async def get_model(self, **kwargs: Any) -> _models.Bird: # response body for status code(s): 200 response == bird """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -277,7 +277,7 @@ async def put_model( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. input = bird """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +370,7 @@ async def get_recursive_model(self, **kwargs: Any) -> _models.Bird: # response body for status code(s): 200 response == bird """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -552,7 +552,7 @@ async def put_recursive_model( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. input = bird """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -645,7 +645,7 @@ async def get_missing_discriminator(self, **kwargs: Any) -> _models.Bird: # response body for status code(s): 200 response == bird """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -735,7 +735,7 @@ async def get_wrong_discriminator(self, **kwargs: Any) -> _models.Bird: # response body for status code(s): 200 response == bird """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -800,7 +800,7 @@ async def get_legacy_model(self, **kwargs: Any) -> _models.Dinosaur: # response body for status code(s): 200 response == dinosaur """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-usage/typetest/model/usage/_operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-model-usage/typetest/model/usage/_operations/_operations.py index 707b73df239..e38e62db18f 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-usage/typetest/model/usage/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-usage/typetest/model/usage/_operations/_operations.py @@ -163,7 +163,7 @@ def input( # pylint: disable=inconsistent-return-statements "requiredProp": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -224,7 +224,7 @@ def output(self, **kwargs: Any) -> _models.OutputRecord: "requiredProp": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -368,7 +368,7 @@ def input_and_output( "requiredProp": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-usage/typetest/model/usage/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-model-usage/typetest/model/usage/aio/_operations/_operations.py index 53040bc1104..80d52e68450 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-usage/typetest/model/usage/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-usage/typetest/model/usage/aio/_operations/_operations.py @@ -119,7 +119,7 @@ async def input( # pylint: disable=inconsistent-return-statements "requiredProp": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -180,7 +180,7 @@ async def output(self, **kwargs: Any) -> _models.OutputRecord: "requiredProp": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -324,7 +324,7 @@ async def input_and_output( "requiredProp": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-visibility/typetest/model/visibility/_operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-model-visibility/typetest/model/visibility/_operations/_operations.py index a32712bcbd4..29ee39161a1 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-visibility/typetest/model/visibility/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-visibility/typetest/model/visibility/_operations/_operations.py @@ -291,7 +291,7 @@ def get_model( ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -433,7 +433,7 @@ def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **k ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +575,7 @@ def put_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -716,7 +716,7 @@ def patch_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -857,7 +857,7 @@ def post_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -998,7 +998,7 @@ def delete_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-visibility/typetest/model/visibility/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-model-visibility/typetest/model/visibility/aio/_operations/_operations.py index 66dd2f5ea2c..f5624292c8b 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-visibility/typetest/model/visibility/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-visibility/typetest/model/visibility/aio/_operations/_operations.py @@ -208,7 +208,7 @@ async def get_model( ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -350,7 +350,7 @@ async def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes] ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -492,7 +492,7 @@ async def put_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -633,7 +633,7 @@ async def patch_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -774,7 +774,7 @@ async def post_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -915,7 +915,7 @@ async def delete_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/aio/operations/_operations.py index 886d9e3ec2a..7b5f00d16b8 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/aio/operations/_operations.py @@ -100,7 +100,7 @@ async def get(self, **kwargs: Any) -> _models.ExtendsUnknownAdditionalProperties "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +220,7 @@ async def put( # pylint: disable=inconsistent-return-statements "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -303,7 +303,7 @@ async def get(self, **kwargs: Any) -> _models.ExtendsUnknownAdditionalProperties "age": 0.0 # Optional. The age property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -433,7 +433,7 @@ async def put( # pylint: disable=inconsistent-return-statements "age": 0.0 # Optional. The age property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -523,7 +523,7 @@ async def get(self, **kwargs: Any) -> _models.ExtendsUnknownAdditionalProperties # response body for status code(s): 200 response == extends_unknown_additional_properties_discriminated """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -667,7 +667,7 @@ async def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = extends_unknown_additional_properties_discriminated """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -747,7 +747,7 @@ async def get(self, **kwargs: Any) -> _models.IsUnknownAdditionalProperties: "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -867,7 +867,7 @@ async def put( # pylint: disable=inconsistent-return-statements "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -949,7 +949,7 @@ async def get(self, **kwargs: Any) -> _models.IsUnknownAdditionalPropertiesDeriv "age": 0.0 # Optional. The age property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1077,7 +1077,7 @@ async def put( # pylint: disable=inconsistent-return-statements "age": 0.0 # Optional. The age property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1167,7 +1167,7 @@ async def get(self, **kwargs: Any) -> _models.IsUnknownAdditionalPropertiesDiscr # response body for status code(s): 200 response == is_unknown_additional_properties_discriminated """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1311,7 +1311,7 @@ async def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = is_unknown_additional_properties_discriminated """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1391,7 +1391,7 @@ async def get(self, **kwargs: Any) -> _models.ExtendsStringAdditionalProperties: "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1511,7 +1511,7 @@ async def put( # pylint: disable=inconsistent-return-statements "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1591,7 +1591,7 @@ async def get(self, **kwargs: Any) -> _models.IsStringAdditionalProperties: "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1711,7 +1711,7 @@ async def put( # pylint: disable=inconsistent-return-statements "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1791,7 +1791,7 @@ async def get(self, **kwargs: Any) -> _models.ExtendsFloatAdditionalProperties: "id": 0.0 # The id property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1911,7 +1911,7 @@ async def put( # pylint: disable=inconsistent-return-statements "id": 0.0 # The id property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1991,7 +1991,7 @@ async def get(self, **kwargs: Any) -> _models.IsFloatAdditionalProperties: "id": 0.0 # The id property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2111,7 +2111,7 @@ async def put( # pylint: disable=inconsistent-return-statements "id": 0.0 # The id property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2183,7 +2183,7 @@ async def get(self, **kwargs: Any) -> _models.ExtendsModelAdditionalProperties: :rtype: ~typetest.property.additionalproperties.models.ExtendsModelAdditionalProperties :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2299,7 +2299,7 @@ async def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2371,7 +2371,7 @@ async def get(self, **kwargs: Any) -> _models.IsModelAdditionalProperties: :rtype: ~typetest.property.additionalproperties.models.IsModelAdditionalProperties :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2487,7 +2487,7 @@ async def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2559,7 +2559,7 @@ async def get(self, **kwargs: Any) -> _models.ExtendsModelArrayAdditionalPropert :rtype: ~typetest.property.additionalproperties.models.ExtendsModelArrayAdditionalProperties :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2681,7 +2681,7 @@ async def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2753,7 +2753,7 @@ async def get(self, **kwargs: Any) -> _models.IsModelArrayAdditionalProperties: :rtype: ~typetest.property.additionalproperties.models.IsModelArrayAdditionalProperties :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2869,7 +2869,7 @@ async def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/operations/_operations.py index f487fb06db4..825099ce1ff 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/operations/_operations.py @@ -466,7 +466,7 @@ def get(self, **kwargs: Any) -> _models.ExtendsUnknownAdditionalProperties: "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -586,7 +586,7 @@ def put( # pylint: disable=inconsistent-return-statements "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -669,7 +669,7 @@ def get(self, **kwargs: Any) -> _models.ExtendsUnknownAdditionalPropertiesDerive "age": 0.0 # Optional. The age property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -799,7 +799,7 @@ def put( # pylint: disable=inconsistent-return-statements "age": 0.0 # Optional. The age property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -889,7 +889,7 @@ def get(self, **kwargs: Any) -> _models.ExtendsUnknownAdditionalPropertiesDiscri # response body for status code(s): 200 response == extends_unknown_additional_properties_discriminated """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1033,7 +1033,7 @@ def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = extends_unknown_additional_properties_discriminated """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1113,7 +1113,7 @@ def get(self, **kwargs: Any) -> _models.IsUnknownAdditionalProperties: "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1233,7 +1233,7 @@ def put( # pylint: disable=inconsistent-return-statements "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1315,7 +1315,7 @@ def get(self, **kwargs: Any) -> _models.IsUnknownAdditionalPropertiesDerived: "age": 0.0 # Optional. The age property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1443,7 +1443,7 @@ def put( # pylint: disable=inconsistent-return-statements "age": 0.0 # Optional. The age property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1533,7 +1533,7 @@ def get(self, **kwargs: Any) -> _models.IsUnknownAdditionalPropertiesDiscriminat # response body for status code(s): 200 response == is_unknown_additional_properties_discriminated """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1677,7 +1677,7 @@ def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = is_unknown_additional_properties_discriminated """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1757,7 +1757,7 @@ def get(self, **kwargs: Any) -> _models.ExtendsStringAdditionalProperties: "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1877,7 +1877,7 @@ def put( # pylint: disable=inconsistent-return-statements "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1957,7 +1957,7 @@ def get(self, **kwargs: Any) -> _models.IsStringAdditionalProperties: "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2077,7 +2077,7 @@ def put( # pylint: disable=inconsistent-return-statements "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2157,7 +2157,7 @@ def get(self, **kwargs: Any) -> _models.ExtendsFloatAdditionalProperties: "id": 0.0 # The id property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2277,7 +2277,7 @@ def put( # pylint: disable=inconsistent-return-statements "id": 0.0 # The id property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2357,7 +2357,7 @@ def get(self, **kwargs: Any) -> _models.IsFloatAdditionalProperties: "id": 0.0 # The id property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2477,7 +2477,7 @@ def put( # pylint: disable=inconsistent-return-statements "id": 0.0 # The id property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2549,7 +2549,7 @@ def get(self, **kwargs: Any) -> _models.ExtendsModelAdditionalProperties: :rtype: ~typetest.property.additionalproperties.models.ExtendsModelAdditionalProperties :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2665,7 +2665,7 @@ def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2737,7 +2737,7 @@ def get(self, **kwargs: Any) -> _models.IsModelAdditionalProperties: :rtype: ~typetest.property.additionalproperties.models.IsModelAdditionalProperties :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2853,7 +2853,7 @@ def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2925,7 +2925,7 @@ def get(self, **kwargs: Any) -> _models.ExtendsModelArrayAdditionalProperties: :rtype: ~typetest.property.additionalproperties.models.ExtendsModelArrayAdditionalProperties :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3047,7 +3047,7 @@ def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3119,7 +3119,7 @@ def get(self, **kwargs: Any) -> _models.IsModelArrayAdditionalProperties: :rtype: ~typetest.property.additionalproperties.models.IsModelArrayAdditionalProperties :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3235,7 +3235,7 @@ def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-nullable/typetest/property/nullable/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-nullable/typetest/property/nullable/aio/operations/_operations.py index 324234d4541..600787dbf63 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-nullable/typetest/property/nullable/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-nullable/typetest/property/nullable/aio/operations/_operations.py @@ -96,7 +96,7 @@ async def get_non_null(self, **kwargs: Any) -> _models.StringProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -155,7 +155,7 @@ async def get_null(self, **kwargs: Any) -> _models.StringProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -275,7 +275,7 @@ async def patch_non_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -398,7 +398,7 @@ async def patch_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -478,7 +478,7 @@ async def get_non_null(self, **kwargs: Any) -> _models.BytesProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -537,7 +537,7 @@ async def get_null(self, **kwargs: Any) -> _models.BytesProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -657,7 +657,7 @@ async def patch_non_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -780,7 +780,7 @@ async def patch_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -860,7 +860,7 @@ async def get_non_null(self, **kwargs: Any) -> _models.DatetimeProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -919,7 +919,7 @@ async def get_null(self, **kwargs: Any) -> _models.DatetimeProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1039,7 +1039,7 @@ async def patch_non_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1162,7 +1162,7 @@ async def patch_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1242,7 +1242,7 @@ async def get_non_null(self, **kwargs: Any) -> _models.DurationProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1301,7 +1301,7 @@ async def get_null(self, **kwargs: Any) -> _models.DurationProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1421,7 +1421,7 @@ async def patch_non_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1544,7 +1544,7 @@ async def patch_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1626,7 +1626,7 @@ async def get_non_null(self, **kwargs: Any) -> _models.CollectionsByteProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1687,7 +1687,7 @@ async def get_null(self, **kwargs: Any) -> _models.CollectionsByteProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1815,7 +1815,7 @@ async def patch_non_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1946,7 +1946,7 @@ async def patch_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2031,7 +2031,7 @@ async def get_non_null(self, **kwargs: Any) -> _models.CollectionsModelProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2095,7 +2095,7 @@ async def get_null(self, **kwargs: Any) -> _models.CollectionsModelProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2227,7 +2227,7 @@ async def patch_non_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2362,7 +2362,7 @@ async def patch_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-nullable/typetest/property/nullable/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-nullable/typetest/property/nullable/operations/_operations.py index 9af8b4fec95..fc241189486 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-nullable/typetest/property/nullable/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-nullable/typetest/property/nullable/operations/_operations.py @@ -410,7 +410,7 @@ def get_non_null(self, **kwargs: Any) -> _models.StringProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -469,7 +469,7 @@ def get_null(self, **kwargs: Any) -> _models.StringProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -589,7 +589,7 @@ def patch_non_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -712,7 +712,7 @@ def patch_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -792,7 +792,7 @@ def get_non_null(self, **kwargs: Any) -> _models.BytesProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -851,7 +851,7 @@ def get_null(self, **kwargs: Any) -> _models.BytesProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -971,7 +971,7 @@ def patch_non_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1094,7 +1094,7 @@ def patch_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1174,7 +1174,7 @@ def get_non_null(self, **kwargs: Any) -> _models.DatetimeProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1233,7 +1233,7 @@ def get_null(self, **kwargs: Any) -> _models.DatetimeProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1353,7 +1353,7 @@ def patch_non_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1476,7 +1476,7 @@ def patch_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1556,7 +1556,7 @@ def get_non_null(self, **kwargs: Any) -> _models.DurationProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1615,7 +1615,7 @@ def get_null(self, **kwargs: Any) -> _models.DurationProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1735,7 +1735,7 @@ def patch_non_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1858,7 +1858,7 @@ def patch_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1940,7 +1940,7 @@ def get_non_null(self, **kwargs: Any) -> _models.CollectionsByteProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2001,7 +2001,7 @@ def get_null(self, **kwargs: Any) -> _models.CollectionsByteProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2129,7 +2129,7 @@ def patch_non_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2260,7 +2260,7 @@ def patch_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2345,7 +2345,7 @@ def get_non_null(self, **kwargs: Any) -> _models.CollectionsModelProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2409,7 +2409,7 @@ def get_null(self, **kwargs: Any) -> _models.CollectionsModelProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2541,7 +2541,7 @@ def patch_non_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2676,7 +2676,7 @@ def patch_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/typetest/property/optional/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/typetest/property/optional/aio/operations/_operations.py index c1b46d845a1..0175e1b81db 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/typetest/property/optional/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/typetest/property/optional/aio/operations/_operations.py @@ -127,7 +127,7 @@ async def get_all(self, **kwargs: Any) -> _models.StringProperty: "property": "str" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -185,7 +185,7 @@ async def get_default(self, **kwargs: Any) -> _models.StringProperty: "property": "str" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -303,7 +303,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements "property": "str" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -424,7 +424,7 @@ async def put_default( # pylint: disable=inconsistent-return-statements "property": "str" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -503,7 +503,7 @@ async def get_all(self, **kwargs: Any) -> _models.BytesProperty: "property": bytes("bytes", encoding="utf-8") # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -561,7 +561,7 @@ async def get_default(self, **kwargs: Any) -> _models.BytesProperty: "property": bytes("bytes", encoding="utf-8") # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -679,7 +679,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements "property": bytes("bytes", encoding="utf-8") # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -800,7 +800,7 @@ async def put_default( # pylint: disable=inconsistent-return-statements "property": bytes("bytes", encoding="utf-8") # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -879,7 +879,7 @@ async def get_all(self, **kwargs: Any) -> _models.DatetimeProperty: "property": "2020-02-20 00:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -937,7 +937,7 @@ async def get_default(self, **kwargs: Any) -> _models.DatetimeProperty: "property": "2020-02-20 00:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1055,7 +1055,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements "property": "2020-02-20 00:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1176,7 +1176,7 @@ async def put_default( # pylint: disable=inconsistent-return-statements "property": "2020-02-20 00:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1255,7 +1255,7 @@ async def get_all(self, **kwargs: Any) -> _models.DurationProperty: "property": "1 day, 0:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1313,7 +1313,7 @@ async def get_default(self, **kwargs: Any) -> _models.DurationProperty: "property": "1 day, 0:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1431,7 +1431,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements "property": "1 day, 0:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1552,7 +1552,7 @@ async def put_default( # pylint: disable=inconsistent-return-statements "property": "1 day, 0:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1633,7 +1633,7 @@ async def get_all(self, **kwargs: Any) -> _models.CollectionsByteProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1693,7 +1693,7 @@ async def get_default(self, **kwargs: Any) -> _models.CollectionsByteProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1815,7 +1815,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1940,7 +1940,7 @@ async def put_default( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2024,7 +2024,7 @@ async def get_all(self, **kwargs: Any) -> _models.CollectionsModelProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2087,7 +2087,7 @@ async def get_default(self, **kwargs: Any) -> _models.CollectionsModelProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2213,7 +2213,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2342,7 +2342,7 @@ async def put_default( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2421,7 +2421,7 @@ async def get_all(self, **kwargs: Any) -> _models.StringLiteralProperty: "property": "hello" # Optional. Default value is "hello". Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2479,7 +2479,7 @@ async def get_default(self, **kwargs: Any) -> _models.StringLiteralProperty: "property": "hello" # Optional. Default value is "hello". Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2597,7 +2597,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements "property": "hello" # Optional. Default value is "hello". Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2718,7 +2718,7 @@ async def put_default( # pylint: disable=inconsistent-return-statements "property": "hello" # Optional. Default value is "hello". Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2797,7 +2797,7 @@ async def get_all(self, **kwargs: Any) -> _models.IntLiteralProperty: "property": 1 # Optional. Default value is 1. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2855,7 +2855,7 @@ async def get_default(self, **kwargs: Any) -> _models.IntLiteralProperty: "property": 1 # Optional. Default value is 1. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2973,7 +2973,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements "property": 1 # Optional. Default value is 1. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3094,7 +3094,7 @@ async def put_default( # pylint: disable=inconsistent-return-statements "property": 1 # Optional. Default value is 1. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3173,7 +3173,7 @@ async def get_all(self, **kwargs: Any) -> _models.FloatLiteralProperty: "property": 1.25 # Optional. Default value is 1.25. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3231,7 +3231,7 @@ async def get_default(self, **kwargs: Any) -> _models.FloatLiteralProperty: "property": 1.25 # Optional. Default value is 1.25. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3349,7 +3349,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements "property": 1.25 # Optional. Default value is 1.25. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3470,7 +3470,7 @@ async def put_default( # pylint: disable=inconsistent-return-statements "property": 1.25 # Optional. Default value is 1.25. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3549,7 +3549,7 @@ async def get_all(self, **kwargs: Any) -> _models.BooleanLiteralProperty: "property": True # Optional. Default value is True. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3607,7 +3607,7 @@ async def get_default(self, **kwargs: Any) -> _models.BooleanLiteralProperty: "property": True # Optional. Default value is True. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3725,7 +3725,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements "property": True # Optional. Default value is True. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3846,7 +3846,7 @@ async def put_default( # pylint: disable=inconsistent-return-statements "property": True # Optional. Default value is True. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3928,7 +3928,7 @@ async def get_all(self, **kwargs: Any) -> _models.UnionStringLiteralProperty: either a Literal["hello"] type or a Literal["world"] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3989,7 +3989,7 @@ async def get_default(self, **kwargs: Any) -> _models.UnionStringLiteralProperty either a Literal["hello"] type or a Literal["world"] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4112,7 +4112,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements either a Literal["hello"] type or a Literal["world"] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4238,7 +4238,7 @@ async def put_default( # pylint: disable=inconsistent-return-statements either a Literal["hello"] type or a Literal["world"] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4318,7 +4318,7 @@ async def get_all(self, **kwargs: Any) -> _models.UnionIntLiteralProperty: Literal[1] type or a Literal[2] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4377,7 +4377,7 @@ async def get_default(self, **kwargs: Any) -> _models.UnionIntLiteralProperty: Literal[1] type or a Literal[2] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4497,7 +4497,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements Literal[1] type or a Literal[2] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4620,7 +4620,7 @@ async def put_default( # pylint: disable=inconsistent-return-statements Literal[1] type or a Literal[2] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4701,7 +4701,7 @@ async def get_all(self, **kwargs: Any) -> _models.UnionFloatLiteralProperty: float type or a float type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4761,7 +4761,7 @@ async def get_default(self, **kwargs: Any) -> _models.UnionFloatLiteralProperty: float type or a float type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4882,7 +4882,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements float type or a float type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5006,7 +5006,7 @@ async def put_default( # pylint: disable=inconsistent-return-statements float type or a float type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5087,7 +5087,7 @@ async def get_all(self, **kwargs: Any) -> _models.RequiredAndOptionalProperty: "optionalProperty": "str" # Optional. optional string property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5147,7 +5147,7 @@ async def get_required_only(self, **kwargs: Any) -> _models.RequiredAndOptionalP "optionalProperty": "str" # Optional. optional string property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5268,7 +5268,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements "optionalProperty": "str" # Optional. optional string property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5392,7 +5392,7 @@ async def put_required_only( # pylint: disable=inconsistent-return-statements "optionalProperty": "str" # Optional. optional string property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/typetest/property/optional/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/typetest/property/optional/operations/_operations.py index 2434b2fa2f8..90e296fd624 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/typetest/property/optional/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/typetest/property/optional/operations/_operations.py @@ -861,7 +861,7 @@ def get_all(self, **kwargs: Any) -> _models.StringProperty: "property": "str" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -919,7 +919,7 @@ def get_default(self, **kwargs: Any) -> _models.StringProperty: "property": "str" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1037,7 +1037,7 @@ def put_all( # pylint: disable=inconsistent-return-statements "property": "str" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1158,7 +1158,7 @@ def put_default( # pylint: disable=inconsistent-return-statements "property": "str" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1237,7 +1237,7 @@ def get_all(self, **kwargs: Any) -> _models.BytesProperty: "property": bytes("bytes", encoding="utf-8") # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1295,7 +1295,7 @@ def get_default(self, **kwargs: Any) -> _models.BytesProperty: "property": bytes("bytes", encoding="utf-8") # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1413,7 +1413,7 @@ def put_all( # pylint: disable=inconsistent-return-statements "property": bytes("bytes", encoding="utf-8") # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1534,7 +1534,7 @@ def put_default( # pylint: disable=inconsistent-return-statements "property": bytes("bytes", encoding="utf-8") # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1613,7 +1613,7 @@ def get_all(self, **kwargs: Any) -> _models.DatetimeProperty: "property": "2020-02-20 00:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1671,7 +1671,7 @@ def get_default(self, **kwargs: Any) -> _models.DatetimeProperty: "property": "2020-02-20 00:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1789,7 +1789,7 @@ def put_all( # pylint: disable=inconsistent-return-statements "property": "2020-02-20 00:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1910,7 +1910,7 @@ def put_default( # pylint: disable=inconsistent-return-statements "property": "2020-02-20 00:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1989,7 +1989,7 @@ def get_all(self, **kwargs: Any) -> _models.DurationProperty: "property": "1 day, 0:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2047,7 +2047,7 @@ def get_default(self, **kwargs: Any) -> _models.DurationProperty: "property": "1 day, 0:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2165,7 +2165,7 @@ def put_all( # pylint: disable=inconsistent-return-statements "property": "1 day, 0:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2286,7 +2286,7 @@ def put_default( # pylint: disable=inconsistent-return-statements "property": "1 day, 0:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2367,7 +2367,7 @@ def get_all(self, **kwargs: Any) -> _models.CollectionsByteProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2427,7 +2427,7 @@ def get_default(self, **kwargs: Any) -> _models.CollectionsByteProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2549,7 +2549,7 @@ def put_all( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2674,7 +2674,7 @@ def put_default( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2758,7 +2758,7 @@ def get_all(self, **kwargs: Any) -> _models.CollectionsModelProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2821,7 +2821,7 @@ def get_default(self, **kwargs: Any) -> _models.CollectionsModelProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2947,7 +2947,7 @@ def put_all( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3076,7 +3076,7 @@ def put_default( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3155,7 +3155,7 @@ def get_all(self, **kwargs: Any) -> _models.StringLiteralProperty: "property": "hello" # Optional. Default value is "hello". Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3213,7 +3213,7 @@ def get_default(self, **kwargs: Any) -> _models.StringLiteralProperty: "property": "hello" # Optional. Default value is "hello". Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3331,7 +3331,7 @@ def put_all( # pylint: disable=inconsistent-return-statements "property": "hello" # Optional. Default value is "hello". Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3452,7 +3452,7 @@ def put_default( # pylint: disable=inconsistent-return-statements "property": "hello" # Optional. Default value is "hello". Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3531,7 +3531,7 @@ def get_all(self, **kwargs: Any) -> _models.IntLiteralProperty: "property": 1 # Optional. Default value is 1. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3589,7 +3589,7 @@ def get_default(self, **kwargs: Any) -> _models.IntLiteralProperty: "property": 1 # Optional. Default value is 1. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3707,7 +3707,7 @@ def put_all( # pylint: disable=inconsistent-return-statements "property": 1 # Optional. Default value is 1. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3828,7 +3828,7 @@ def put_default( # pylint: disable=inconsistent-return-statements "property": 1 # Optional. Default value is 1. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3907,7 +3907,7 @@ def get_all(self, **kwargs: Any) -> _models.FloatLiteralProperty: "property": 1.25 # Optional. Default value is 1.25. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3965,7 +3965,7 @@ def get_default(self, **kwargs: Any) -> _models.FloatLiteralProperty: "property": 1.25 # Optional. Default value is 1.25. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4083,7 +4083,7 @@ def put_all( # pylint: disable=inconsistent-return-statements "property": 1.25 # Optional. Default value is 1.25. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4204,7 +4204,7 @@ def put_default( # pylint: disable=inconsistent-return-statements "property": 1.25 # Optional. Default value is 1.25. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4283,7 +4283,7 @@ def get_all(self, **kwargs: Any) -> _models.BooleanLiteralProperty: "property": True # Optional. Default value is True. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4341,7 +4341,7 @@ def get_default(self, **kwargs: Any) -> _models.BooleanLiteralProperty: "property": True # Optional. Default value is True. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4459,7 +4459,7 @@ def put_all( # pylint: disable=inconsistent-return-statements "property": True # Optional. Default value is True. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4580,7 +4580,7 @@ def put_default( # pylint: disable=inconsistent-return-statements "property": True # Optional. Default value is True. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4662,7 +4662,7 @@ def get_all(self, **kwargs: Any) -> _models.UnionStringLiteralProperty: either a Literal["hello"] type or a Literal["world"] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4723,7 +4723,7 @@ def get_default(self, **kwargs: Any) -> _models.UnionStringLiteralProperty: either a Literal["hello"] type or a Literal["world"] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4846,7 +4846,7 @@ def put_all( # pylint: disable=inconsistent-return-statements either a Literal["hello"] type or a Literal["world"] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4972,7 +4972,7 @@ def put_default( # pylint: disable=inconsistent-return-statements either a Literal["hello"] type or a Literal["world"] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5052,7 +5052,7 @@ def get_all(self, **kwargs: Any) -> _models.UnionIntLiteralProperty: Literal[1] type or a Literal[2] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5111,7 +5111,7 @@ def get_default(self, **kwargs: Any) -> _models.UnionIntLiteralProperty: Literal[1] type or a Literal[2] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5231,7 +5231,7 @@ def put_all( # pylint: disable=inconsistent-return-statements Literal[1] type or a Literal[2] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5354,7 +5354,7 @@ def put_default( # pylint: disable=inconsistent-return-statements Literal[1] type or a Literal[2] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5435,7 +5435,7 @@ def get_all(self, **kwargs: Any) -> _models.UnionFloatLiteralProperty: float type or a float type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5495,7 +5495,7 @@ def get_default(self, **kwargs: Any) -> _models.UnionFloatLiteralProperty: float type or a float type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5616,7 +5616,7 @@ def put_all( # pylint: disable=inconsistent-return-statements float type or a float type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5740,7 +5740,7 @@ def put_default( # pylint: disable=inconsistent-return-statements float type or a float type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5821,7 +5821,7 @@ def get_all(self, **kwargs: Any) -> _models.RequiredAndOptionalProperty: "optionalProperty": "str" # Optional. optional string property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5881,7 +5881,7 @@ def get_required_only(self, **kwargs: Any) -> _models.RequiredAndOptionalPropert "optionalProperty": "str" # Optional. optional string property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6002,7 +6002,7 @@ def put_all( # pylint: disable=inconsistent-return-statements "optionalProperty": "str" # Optional. optional string property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6126,7 +6126,7 @@ def put_required_only( # pylint: disable=inconsistent-return-statements "optionalProperty": "str" # Optional. optional string property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/typetest/property/valuetypes/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/typetest/property/valuetypes/aio/operations/_operations.py index 11409f2c7d5..aa5cfb2aeb4 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/typetest/property/valuetypes/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/typetest/property/valuetypes/aio/operations/_operations.py @@ -129,7 +129,7 @@ async def get(self, **kwargs: Any) -> _models.BooleanProperty: "property": bool # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +247,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": bool # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -326,7 +326,7 @@ async def get(self, **kwargs: Any) -> _models.StringProperty: "property": "str" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -444,7 +444,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": "str" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -523,7 +523,7 @@ async def get(self, **kwargs: Any) -> _models.BytesProperty: "property": bytes("bytes", encoding="utf-8") # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -641,7 +641,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": bytes("bytes", encoding="utf-8") # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -720,7 +720,7 @@ async def get(self, **kwargs: Any) -> _models.IntProperty: "property": 0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -838,7 +838,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": 0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -917,7 +917,7 @@ async def get(self, **kwargs: Any) -> _models.FloatProperty: "property": 0.0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1035,7 +1035,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": 0.0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1114,7 +1114,7 @@ async def get(self, **kwargs: Any) -> _models.DecimalProperty: "property": 0.0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1232,7 +1232,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": 0.0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1311,7 +1311,7 @@ async def get(self, **kwargs: Any) -> _models.Decimal128Property: "property": 0.0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1429,7 +1429,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": 0.0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1508,7 +1508,7 @@ async def get(self, **kwargs: Any) -> _models.DatetimeProperty: "property": "2020-02-20 00:00:00" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1626,7 +1626,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": "2020-02-20 00:00:00" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1705,7 +1705,7 @@ async def get(self, **kwargs: Any) -> _models.DurationProperty: "property": "1 day, 0:00:00" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1823,7 +1823,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": "1 day, 0:00:00" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1903,7 +1903,7 @@ async def get(self, **kwargs: Any) -> _models.EnumProperty: "ValueTwo". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2023,7 +2023,7 @@ async def put( # pylint: disable=inconsistent-return-statements "ValueTwo". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2103,7 +2103,7 @@ async def get(self, **kwargs: Any) -> _models.ExtensibleEnumProperty: "ValueTwo". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2224,7 +2224,7 @@ async def put( # pylint: disable=inconsistent-return-statements "ValueTwo". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2305,7 +2305,7 @@ async def get(self, **kwargs: Any) -> _models.ModelProperty: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2427,7 +2427,7 @@ async def put( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2509,7 +2509,7 @@ async def get(self, **kwargs: Any) -> _models.CollectionsStringProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2632,7 +2632,7 @@ async def put( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2713,7 +2713,7 @@ async def get(self, **kwargs: Any) -> _models.CollectionsIntProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2836,7 +2836,7 @@ async def put( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2920,7 +2920,7 @@ async def get(self, **kwargs: Any) -> _models.CollectionsModelProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3047,7 +3047,7 @@ async def put( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3129,7 +3129,7 @@ async def get(self, **kwargs: Any) -> _models.DictionaryStringProperty: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3252,7 +3252,7 @@ async def put( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3323,7 +3323,7 @@ async def get(self, **kwargs: Any) -> _models.NeverProperty: :rtype: ~typetest.property.valuetypes.models.NeverProperty :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3437,7 +3437,7 @@ async def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3516,7 +3516,7 @@ async def get(self, **kwargs: Any) -> _models.UnknownStringProperty: "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3635,7 +3635,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3714,7 +3714,7 @@ async def get(self, **kwargs: Any) -> _models.UnknownIntProperty: "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3832,7 +3832,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3911,7 +3911,7 @@ async def get(self, **kwargs: Any) -> _models.UnknownDictProperty: "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4030,7 +4030,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4109,7 +4109,7 @@ async def get(self, **kwargs: Any) -> _models.UnknownArrayProperty: "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4228,7 +4228,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4307,7 +4307,7 @@ async def get(self, **kwargs: Any) -> _models.StringLiteralProperty: "property": "hello" # Default value is "hello". Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4426,7 +4426,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": "hello" # Default value is "hello". Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4505,7 +4505,7 @@ async def get(self, **kwargs: Any) -> _models.IntLiteralProperty: "property": 42 # Default value is 42. Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4623,7 +4623,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": 42 # Default value is 42. Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4702,7 +4702,7 @@ async def get(self, **kwargs: Any) -> _models.FloatLiteralProperty: "property": 43.125 # Default value is 43.125. Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4821,7 +4821,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": 43.125 # Default value is 43.125. Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4900,7 +4900,7 @@ async def get(self, **kwargs: Any) -> _models.BooleanLiteralProperty: "property": True # Default value is True. Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5019,7 +5019,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": True # Default value is True. Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5101,7 +5101,7 @@ async def get(self, **kwargs: Any) -> _models.UnionStringLiteralProperty: either a Literal["hello"] type or a Literal["world"] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5225,7 +5225,7 @@ async def put( # pylint: disable=inconsistent-return-statements either a Literal["hello"] type or a Literal["world"] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5305,7 +5305,7 @@ async def get(self, **kwargs: Any) -> _models.UnionIntLiteralProperty: Literal[42] type or a Literal[43] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5426,7 +5426,7 @@ async def put( # pylint: disable=inconsistent-return-statements Literal[42] type or a Literal[43] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5507,7 +5507,7 @@ async def get(self, **kwargs: Any) -> _models.UnionFloatLiteralProperty: a float type or a float type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5628,7 +5628,7 @@ async def put( # pylint: disable=inconsistent-return-statements a float type or a float type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5707,7 +5707,7 @@ async def get(self, **kwargs: Any) -> _models.UnionEnumValueProperty: "property": "str" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5826,7 +5826,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": "str" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/typetest/property/valuetypes/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/typetest/property/valuetypes/operations/_operations.py index f221997c839..42627936fdf 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/typetest/property/valuetypes/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/typetest/property/valuetypes/operations/_operations.py @@ -885,7 +885,7 @@ def get(self, **kwargs: Any) -> _models.BooleanProperty: "property": bool # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1003,7 +1003,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": bool # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1082,7 +1082,7 @@ def get(self, **kwargs: Any) -> _models.StringProperty: "property": "str" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1200,7 +1200,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": "str" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1279,7 +1279,7 @@ def get(self, **kwargs: Any) -> _models.BytesProperty: "property": bytes("bytes", encoding="utf-8") # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1397,7 +1397,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": bytes("bytes", encoding="utf-8") # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1476,7 +1476,7 @@ def get(self, **kwargs: Any) -> _models.IntProperty: "property": 0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1594,7 +1594,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": 0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1673,7 +1673,7 @@ def get(self, **kwargs: Any) -> _models.FloatProperty: "property": 0.0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1791,7 +1791,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": 0.0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1870,7 +1870,7 @@ def get(self, **kwargs: Any) -> _models.DecimalProperty: "property": 0.0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1988,7 +1988,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": 0.0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2067,7 +2067,7 @@ def get(self, **kwargs: Any) -> _models.Decimal128Property: "property": 0.0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2185,7 +2185,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": 0.0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2264,7 +2264,7 @@ def get(self, **kwargs: Any) -> _models.DatetimeProperty: "property": "2020-02-20 00:00:00" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2382,7 +2382,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": "2020-02-20 00:00:00" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2461,7 +2461,7 @@ def get(self, **kwargs: Any) -> _models.DurationProperty: "property": "1 day, 0:00:00" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2579,7 +2579,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": "1 day, 0:00:00" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2659,7 +2659,7 @@ def get(self, **kwargs: Any) -> _models.EnumProperty: "ValueTwo". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2779,7 +2779,7 @@ def put( # pylint: disable=inconsistent-return-statements "ValueTwo". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2859,7 +2859,7 @@ def get(self, **kwargs: Any) -> _models.ExtensibleEnumProperty: "ValueTwo". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2980,7 +2980,7 @@ def put( # pylint: disable=inconsistent-return-statements "ValueTwo". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3061,7 +3061,7 @@ def get(self, **kwargs: Any) -> _models.ModelProperty: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3183,7 +3183,7 @@ def put( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3265,7 +3265,7 @@ def get(self, **kwargs: Any) -> _models.CollectionsStringProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3388,7 +3388,7 @@ def put( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3469,7 +3469,7 @@ def get(self, **kwargs: Any) -> _models.CollectionsIntProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3592,7 +3592,7 @@ def put( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3676,7 +3676,7 @@ def get(self, **kwargs: Any) -> _models.CollectionsModelProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3803,7 +3803,7 @@ def put( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3885,7 +3885,7 @@ def get(self, **kwargs: Any) -> _models.DictionaryStringProperty: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4008,7 +4008,7 @@ def put( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4079,7 +4079,7 @@ def get(self, **kwargs: Any) -> _models.NeverProperty: :rtype: ~typetest.property.valuetypes.models.NeverProperty :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4193,7 +4193,7 @@ def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4272,7 +4272,7 @@ def get(self, **kwargs: Any) -> _models.UnknownStringProperty: "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4391,7 +4391,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4470,7 +4470,7 @@ def get(self, **kwargs: Any) -> _models.UnknownIntProperty: "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4588,7 +4588,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4667,7 +4667,7 @@ def get(self, **kwargs: Any) -> _models.UnknownDictProperty: "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4786,7 +4786,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4865,7 +4865,7 @@ def get(self, **kwargs: Any) -> _models.UnknownArrayProperty: "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4984,7 +4984,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5063,7 +5063,7 @@ def get(self, **kwargs: Any) -> _models.StringLiteralProperty: "property": "hello" # Default value is "hello". Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5182,7 +5182,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": "hello" # Default value is "hello". Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5261,7 +5261,7 @@ def get(self, **kwargs: Any) -> _models.IntLiteralProperty: "property": 42 # Default value is 42. Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5379,7 +5379,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": 42 # Default value is 42. Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5458,7 +5458,7 @@ def get(self, **kwargs: Any) -> _models.FloatLiteralProperty: "property": 43.125 # Default value is 43.125. Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5577,7 +5577,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": 43.125 # Default value is 43.125. Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5656,7 +5656,7 @@ def get(self, **kwargs: Any) -> _models.BooleanLiteralProperty: "property": True # Default value is True. Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5775,7 +5775,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": True # Default value is True. Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5857,7 +5857,7 @@ def get(self, **kwargs: Any) -> _models.UnionStringLiteralProperty: either a Literal["hello"] type or a Literal["world"] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5981,7 +5981,7 @@ def put( # pylint: disable=inconsistent-return-statements either a Literal["hello"] type or a Literal["world"] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6061,7 +6061,7 @@ def get(self, **kwargs: Any) -> _models.UnionIntLiteralProperty: Literal[42] type or a Literal[43] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6182,7 +6182,7 @@ def put( # pylint: disable=inconsistent-return-statements Literal[42] type or a Literal[43] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6263,7 +6263,7 @@ def get(self, **kwargs: Any) -> _models.UnionFloatLiteralProperty: a float type or a float type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6384,7 +6384,7 @@ def put( # pylint: disable=inconsistent-return-statements a float type or a float type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6463,7 +6463,7 @@ def get(self, **kwargs: Any) -> _models.UnionEnumValueProperty: "property": "str" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6582,7 +6582,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": "str" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-scalar/typetest/scalar/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-scalar/typetest/scalar/aio/operations/_operations.py index e0c3527708a..7fd11ae2476 100644 --- a/packages/typespec-python/test/azure/generated/typetest-scalar/typetest/scalar/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-scalar/typetest/scalar/aio/operations/_operations.py @@ -9,7 +9,7 @@ import decimal import json import sys -from typing import Any, Callable, Dict, List, Optional, Type, TypeVar +from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -77,7 +77,7 @@ async def get(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -129,7 +129,7 @@ async def put(self, body: str, **kwargs: Any) -> None: # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -195,7 +195,7 @@ async def get(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +247,7 @@ async def put(self, body: bool, **kwargs: Any) -> None: # pylint: disable=incon :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -313,7 +313,7 @@ async def get(self, **kwargs: Any) -> Any: :rtype: any :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -365,7 +365,7 @@ async def put(self, body: Any, **kwargs: Any) -> None: # pylint: disable=incons :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -431,7 +431,7 @@ async def response_body(self, **kwargs: Any) -> decimal.Decimal: :rtype: ~decimal.Decimal :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -485,7 +485,7 @@ async def request_body( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -537,7 +537,7 @@ async def request_parameter( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -599,7 +599,7 @@ async def response_body(self, **kwargs: Any) -> decimal.Decimal: :rtype: ~decimal.Decimal :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -653,7 +653,7 @@ async def request_body( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -705,7 +705,7 @@ async def request_parameter( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -775,7 +775,7 @@ async def prepare_verify(self, **kwargs: Any) -> List[decimal.Decimal]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -829,7 +829,7 @@ async def verify( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -903,7 +903,7 @@ async def prepare_verify(self, **kwargs: Any) -> List[decimal.Decimal]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -957,7 +957,7 @@ async def verify( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-scalar/typetest/scalar/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-scalar/typetest/scalar/operations/_operations.py index f5caaead110..1e8ff4a9980 100644 --- a/packages/typespec-python/test/azure/generated/typetest-scalar/typetest/scalar/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-scalar/typetest/scalar/operations/_operations.py @@ -9,7 +9,7 @@ import decimal import json import sys -from typing import Any, Callable, Dict, List, Optional, Type, TypeVar +from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, Union from azure.core.exceptions import ( ClientAuthenticationError, @@ -280,7 +280,7 @@ def get(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -332,7 +332,7 @@ def put(self, body: str, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -398,7 +398,7 @@ def get(self, **kwargs: Any) -> bool: :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -450,7 +450,7 @@ def put(self, body: bool, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -516,7 +516,7 @@ def get(self, **kwargs: Any) -> Any: :rtype: any :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -568,7 +568,7 @@ def put(self, body: Any, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -634,7 +634,7 @@ def response_body(self, **kwargs: Any) -> decimal.Decimal: :rtype: ~decimal.Decimal :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -688,7 +688,7 @@ def request_body( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -740,7 +740,7 @@ def request_parameter( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -802,7 +802,7 @@ def response_body(self, **kwargs: Any) -> decimal.Decimal: :rtype: ~decimal.Decimal :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -856,7 +856,7 @@ def request_body( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -908,7 +908,7 @@ def request_parameter( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -978,7 +978,7 @@ def prepare_verify(self, **kwargs: Any) -> List[decimal.Decimal]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1030,7 +1030,7 @@ def verify(self, body: decimal.Decimal, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1104,7 +1104,7 @@ def prepare_verify(self, **kwargs: Any) -> List[decimal.Decimal]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1156,7 +1156,7 @@ def verify(self, body: decimal.Decimal, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/aio/operations/_operations.py index a0f40348138..8770e77af34 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/aio/operations/_operations.py @@ -94,7 +94,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse9: Literal["a"], Literal["b"], Literal["c"] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +220,7 @@ async def send( # pylint: disable=inconsistent-return-statements Literal["a"], Literal["b"], Literal["c"] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -305,7 +305,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse8: Literal["b"], Literal["c"], str } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -431,7 +431,7 @@ async def send( # pylint: disable=inconsistent-return-statements Literal["b"], Literal["c"], str } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -515,7 +515,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse7: "prop": "str" # Required. Known values are: "b" and "c". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -643,7 +643,7 @@ async def send( # pylint: disable=inconsistent-return-statements "prop": "str" # Required. Known values are: "b" and "c". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -728,7 +728,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse6: Literal[1], Literal[2], Literal[3] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -850,7 +850,7 @@ async def send( # pylint: disable=inconsistent-return-statements Literal[1], Literal[2], Literal[3] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -935,7 +935,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse5: float, float, float } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1057,7 +1057,7 @@ async def send( # pylint: disable=inconsistent-return-statements float, float, float } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1143,7 +1143,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse4: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1267,7 +1267,7 @@ async def send( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1359,7 +1359,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse3: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1495,7 +1495,7 @@ async def send( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1585,7 +1585,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse2: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1717,7 +1717,7 @@ async def send( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1815,7 +1815,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse1: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1963,7 +1963,7 @@ async def send( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2060,7 +2060,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2206,7 +2206,7 @@ async def send( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/operations/_operations.py index 1ae224fe371..95468633bd0 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/operations/_operations.py @@ -356,7 +356,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse9: Literal["a"], Literal["b"], Literal["c"] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -482,7 +482,7 @@ def send( # pylint: disable=inconsistent-return-statements Literal["a"], Literal["b"], Literal["c"] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -567,7 +567,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse8: Literal["b"], Literal["c"], str } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -693,7 +693,7 @@ def send( # pylint: disable=inconsistent-return-statements Literal["b"], Literal["c"], str } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -777,7 +777,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse7: "prop": "str" # Required. Known values are: "b" and "c". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -905,7 +905,7 @@ def send( # pylint: disable=inconsistent-return-statements "prop": "str" # Required. Known values are: "b" and "c". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -990,7 +990,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse6: Literal[1], Literal[2], Literal[3] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1112,7 +1112,7 @@ def send( # pylint: disable=inconsistent-return-statements Literal[1], Literal[2], Literal[3] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1197,7 +1197,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse5: float, float, float } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1319,7 +1319,7 @@ def send( # pylint: disable=inconsistent-return-statements float, float, float } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1405,7 +1405,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse4: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1529,7 +1529,7 @@ def send( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1621,7 +1621,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse3: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1757,7 +1757,7 @@ def send( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1847,7 +1847,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse2: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1979,7 +1979,7 @@ def send( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2077,7 +2077,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse1: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2225,7 +2225,7 @@ def send( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2322,7 +2322,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2468,7 +2468,7 @@ def send( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/authentication-api-key/authentication/apikey/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/authentication-api-key/authentication/apikey/_operations/_operations.py index 4f3afbe0e25..849c39d6a37 100644 --- a/packages/typespec-python/test/unbranded/generated/authentication-api-key/authentication/apikey/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/authentication-api-key/authentication/apikey/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from corehttp.exceptions import ( ClientAuthenticationError, @@ -66,7 +66,7 @@ def valid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-s :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -108,7 +108,7 @@ def invalid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/authentication-api-key/authentication/apikey/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/authentication-api-key/authentication/apikey/aio/_operations/_operations.py index e1431dad570..0d143903cc7 100644 --- a/packages/typespec-python/test/unbranded/generated/authentication-api-key/authentication/apikey/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/authentication-api-key/authentication/apikey/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from corehttp.exceptions import ( ClientAuthenticationError, @@ -41,7 +41,7 @@ async def valid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -83,7 +83,7 @@ async def invalid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/authentication-http-custom/authentication/http/custom/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/authentication-http-custom/authentication/http/custom/_operations/_operations.py index 3a59b0c5142..73fb9a7b30f 100644 --- a/packages/typespec-python/test/unbranded/generated/authentication-http-custom/authentication/http/custom/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/authentication-http-custom/authentication/http/custom/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from corehttp.exceptions import ( ClientAuthenticationError, @@ -66,7 +66,7 @@ def valid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-s :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -108,7 +108,7 @@ def invalid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/authentication-http-custom/authentication/http/custom/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/authentication-http-custom/authentication/http/custom/aio/_operations/_operations.py index 4194ba1b825..1bdefb7105b 100644 --- a/packages/typespec-python/test/unbranded/generated/authentication-http-custom/authentication/http/custom/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/authentication-http-custom/authentication/http/custom/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from corehttp.exceptions import ( ClientAuthenticationError, @@ -41,7 +41,7 @@ async def valid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -83,7 +83,7 @@ async def invalid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/authentication-oauth2/authentication/oauth2/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/authentication-oauth2/authentication/oauth2/_operations/_operations.py index 8b994f4e842..d7ae877ae50 100644 --- a/packages/typespec-python/test/unbranded/generated/authentication-oauth2/authentication/oauth2/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/authentication-oauth2/authentication/oauth2/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from corehttp.exceptions import ( ClientAuthenticationError, @@ -66,7 +66,7 @@ def valid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-s :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -108,7 +108,7 @@ def invalid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/authentication-oauth2/authentication/oauth2/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/authentication-oauth2/authentication/oauth2/aio/_operations/_operations.py index f1da5a1abfd..cc94a012a88 100644 --- a/packages/typespec-python/test/unbranded/generated/authentication-oauth2/authentication/oauth2/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/authentication-oauth2/authentication/oauth2/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union, cast from corehttp.exceptions import ( ClientAuthenticationError, @@ -41,7 +41,7 @@ async def valid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -83,7 +83,7 @@ async def invalid(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/authentication-union/authentication/union/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/authentication-union/authentication/union/_operations/_operations.py index 66e6aed63c5..7594a66cc82 100644 --- a/packages/typespec-python/test/unbranded/generated/authentication-union/authentication/union/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/authentication-union/authentication/union/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -56,7 +56,7 @@ def valid_key(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -98,7 +98,7 @@ def valid_token(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/authentication-union/authentication/union/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/authentication-union/authentication/union/aio/_operations/_operations.py index e1e517f7c41..c8cccbf3278 100644 --- a/packages/typespec-python/test/unbranded/generated/authentication-union/authentication/union/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/authentication-union/authentication/union/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -39,7 +39,7 @@ async def valid_key(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -81,7 +81,7 @@ async def valid_token(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/client-naming/client/naming/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/client-naming/client/naming/aio/operations/_operations.py index 775e65ea4b4..a76c5fd7044 100644 --- a/packages/typespec-python/test/unbranded/generated/client-naming/client/naming/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/client-naming/client/naming/aio/operations/_operations.py @@ -141,7 +141,7 @@ async def client( # pylint: disable=inconsistent-return-statements "defaultName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -261,7 +261,7 @@ async def language( # pylint: disable=inconsistent-return-statements "defaultName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -335,7 +335,7 @@ async def union_enum_name( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +386,7 @@ async def union_enum_member_name( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -435,7 +435,7 @@ async def client_name(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -481,7 +481,7 @@ async def parameter( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -592,7 +592,7 @@ async def client( # pylint: disable=inconsistent-return-statements "defaultName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -712,7 +712,7 @@ async def language( # pylint: disable=inconsistent-return-statements "defaultName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -833,7 +833,7 @@ async def compatible_with_encoded_name( # pylint: disable=inconsistent-return-s "wireName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -889,7 +889,7 @@ async def request( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -932,7 +932,7 @@ async def response(self, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/client-naming/client/naming/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/client-naming/client/naming/operations/_operations.py index cbb947afb7a..32e51ae9c0e 100644 --- a/packages/typespec-python/test/unbranded/generated/client-naming/client/naming/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/client-naming/client/naming/operations/_operations.py @@ -266,7 +266,7 @@ def client( # pylint: disable=inconsistent-return-statements "defaultName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +386,7 @@ def language( # pylint: disable=inconsistent-return-statements "defaultName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -460,7 +460,7 @@ def union_enum_name( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -511,7 +511,7 @@ def union_enum_member_name( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -560,7 +560,7 @@ def client_name(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -604,7 +604,7 @@ def parameter(self, *, client_name: str, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -715,7 +715,7 @@ def client( # pylint: disable=inconsistent-return-statements "defaultName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -835,7 +835,7 @@ def language( # pylint: disable=inconsistent-return-statements "defaultName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -956,7 +956,7 @@ def compatible_with_encoded_name( # pylint: disable=inconsistent-return-stateme "wireName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1010,7 +1010,7 @@ def request(self, *, client_name: str, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1053,7 +1053,7 @@ def response(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retur :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/client-structure-default/client/structure/service/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/client-structure-default/client/structure/service/aio/operations/_operations.py index c5a20672750..e90d6b2c8ef 100644 --- a/packages/typespec-python/test/unbranded/generated/client-structure-default/client/structure/service/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/client-structure-default/client/structure/service/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -87,7 +87,7 @@ async def eight(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -151,7 +151,7 @@ async def three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -197,7 +197,7 @@ async def four(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -261,7 +261,7 @@ async def five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -307,7 +307,7 @@ async def six(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -355,7 +355,7 @@ async def one(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -401,7 +401,7 @@ async def two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -465,7 +465,7 @@ async def seven(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -529,7 +529,7 @@ async def nine(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/client-structure-default/client/structure/service/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/client-structure-default/client/structure/service/operations/_operations.py index 23973f1494c..bc93ef6821b 100644 --- a/packages/typespec-python/test/unbranded/generated/client-structure-default/client/structure/service/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/client-structure-default/client/structure/service/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -143,7 +143,7 @@ def eight(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-s :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -207,7 +207,7 @@ def three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-s :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -253,7 +253,7 @@ def four(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -317,7 +317,7 @@ def five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -363,7 +363,7 @@ def six(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -411,7 +411,7 @@ def one(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -457,7 +457,7 @@ def two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -521,7 +521,7 @@ def seven(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-s :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -585,7 +585,7 @@ def nine(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/client-structure-multiclient/client/structure/multiclient/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/client-structure-multiclient/client/structure/multiclient/_operations/_operations.py index 8c9bb6f3541..fc8acf27688 100644 --- a/packages/typespec-python/test/unbranded/generated/client-structure-multiclient/client/structure/multiclient/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/client-structure-multiclient/client/structure/multiclient/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -84,7 +84,7 @@ def renamed_one(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -130,7 +130,7 @@ def renamed_three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -176,7 +176,7 @@ def renamed_five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -224,7 +224,7 @@ def renamed_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -270,7 +270,7 @@ def renamed_four(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -316,7 +316,7 @@ def renamed_six(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/client-structure-multiclient/client/structure/multiclient/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/client-structure-multiclient/client/structure/multiclient/aio/_operations/_operations.py index 648d8398100..8a1b33eb81e 100644 --- a/packages/typespec-python/test/unbranded/generated/client-structure-multiclient/client/structure/multiclient/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/client-structure-multiclient/client/structure/multiclient/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -46,7 +46,7 @@ async def renamed_one(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -92,7 +92,7 @@ async def renamed_three(self, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -138,7 +138,7 @@ async def renamed_five(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -186,7 +186,7 @@ async def renamed_two(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -232,7 +232,7 @@ async def renamed_four(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -278,7 +278,7 @@ async def renamed_six(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/client-structure-renamedoperation/client/structure/renamedoperation/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/client-structure-renamedoperation/client/structure/renamedoperation/aio/operations/_operations.py index 626e7f5a228..539f03604d9 100644 --- a/packages/typespec-python/test/unbranded/generated/client-structure-renamedoperation/client/structure/renamedoperation/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/client-structure-renamedoperation/client/structure/renamedoperation/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -62,7 +62,7 @@ async def renamed_two(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -108,7 +108,7 @@ async def renamed_four(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -154,7 +154,7 @@ async def renamed_six(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -202,7 +202,7 @@ async def renamed_one(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -248,7 +248,7 @@ async def renamed_three(self, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -294,7 +294,7 @@ async def renamed_five(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/client-structure-renamedoperation/client/structure/renamedoperation/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/client-structure-renamedoperation/client/structure/renamedoperation/operations/_operations.py index bf2c77805ce..370f8c43326 100644 --- a/packages/typespec-python/test/unbranded/generated/client-structure-renamedoperation/client/structure/renamedoperation/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/client-structure-renamedoperation/client/structure/renamedoperation/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -100,7 +100,7 @@ def renamed_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -146,7 +146,7 @@ def renamed_four(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -192,7 +192,7 @@ def renamed_six(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -240,7 +240,7 @@ def renamed_one(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -286,7 +286,7 @@ def renamed_three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -332,7 +332,7 @@ def renamed_five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/aio/operations/_operations.py index 34e4f1f4257..deb1ade4afb 100644 --- a/packages/typespec-python/test/unbranded/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -61,7 +61,7 @@ async def one(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -107,7 +107,7 @@ async def three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -153,7 +153,7 @@ async def four(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -217,7 +217,7 @@ async def two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -263,7 +263,7 @@ async def five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +309,7 @@ async def six(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/operations/_operations.py index c6040c1c782..b16d7ab4ba2 100644 --- a/packages/typespec-python/test/unbranded/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -99,7 +99,7 @@ def one(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -145,7 +145,7 @@ def three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-s :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -191,7 +191,7 @@ def four(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -255,7 +255,7 @@ def two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -301,7 +301,7 @@ def five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -347,7 +347,7 @@ def six(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/aio/operations/_operations.py index 7d9437f61ff..773541349e7 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/aio/operations/_operations.py @@ -85,7 +85,7 @@ async def default(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -130,7 +130,7 @@ async def base64(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -175,7 +175,7 @@ async def base64url(self, *, value: bytes, **kwargs: Any) -> None: # pylint: di :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -222,7 +222,7 @@ async def base64url_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -377,7 +377,7 @@ async def default( "value": bytes("bytes", encoding="utf-8") # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -530,7 +530,7 @@ async def base64( "value": bytes("bytes", encoding="utf-8") # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -683,7 +683,7 @@ async def base64url( "value": bytes("bytes", encoding="utf-8") # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -853,7 +853,7 @@ async def base64url_array( ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -932,7 +932,7 @@ async def default(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -977,7 +977,7 @@ async def base64(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1022,7 +1022,7 @@ async def base64url(self, *, value: bytes, **kwargs: Any) -> None: # pylint: di :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1069,7 +1069,7 @@ async def base64url_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1132,7 +1132,7 @@ async def default(self, value: bytes, **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1181,7 +1181,7 @@ async def octet_stream(self, value: bytes, **kwargs: Any) -> None: # pylint: di :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1232,7 +1232,7 @@ async def custom_content_type( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1281,7 +1281,7 @@ async def base64(self, value: bytes, **kwargs: Any) -> None: # pylint: disable= :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1330,7 +1330,7 @@ async def base64url(self, value: bytes, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1395,7 +1395,7 @@ async def default(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1444,7 +1444,7 @@ async def octet_stream(self, **kwargs: Any) -> AsyncIterator[bytes]: :rtype: AsyncIterator[bytes] :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1490,7 +1490,7 @@ async def custom_content_type(self, **kwargs: Any) -> AsyncIterator[bytes]: :rtype: AsyncIterator[bytes] :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1536,7 +1536,7 @@ async def base64(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1585,7 +1585,7 @@ async def base64url(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/operations/_operations.py index 7cd507c4f19..45168275c6c 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/operations/_operations.py @@ -364,7 +364,7 @@ def default(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -409,7 +409,7 @@ def base64(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -454,7 +454,7 @@ def base64url(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable= :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -501,7 +501,7 @@ def base64url_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -656,7 +656,7 @@ def default( "value": bytes("bytes", encoding="utf-8") # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -809,7 +809,7 @@ def base64( "value": bytes("bytes", encoding="utf-8") # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -962,7 +962,7 @@ def base64url( "value": bytes("bytes", encoding="utf-8") # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1132,7 +1132,7 @@ def base64url_array( ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1211,7 +1211,7 @@ def default(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable=in :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1256,7 +1256,7 @@ def base64(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1301,7 +1301,7 @@ def base64url(self, *, value: bytes, **kwargs: Any) -> None: # pylint: disable= :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1348,7 +1348,7 @@ def base64url_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1411,7 +1411,7 @@ def default(self, value: bytes, **kwargs: Any) -> None: # pylint: disable=incon :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1460,7 +1460,7 @@ def octet_stream(self, value: bytes, **kwargs: Any) -> None: # pylint: disable= :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1511,7 +1511,7 @@ def custom_content_type( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1560,7 +1560,7 @@ def base64(self, value: bytes, **kwargs: Any) -> None: # pylint: disable=incons :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1609,7 +1609,7 @@ def base64url(self, value: bytes, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1674,7 +1674,7 @@ def default(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1723,7 +1723,7 @@ def octet_stream(self, **kwargs: Any) -> Iterator[bytes]: :rtype: Iterator[bytes] :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1769,7 +1769,7 @@ def custom_content_type(self, **kwargs: Any) -> Iterator[bytes]: :rtype: Iterator[bytes] :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1815,7 +1815,7 @@ def base64(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1864,7 +1864,7 @@ def base64url(self, **kwargs: Any) -> bytes: :rtype: bytes :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/encode-datetime/encode/datetime/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-datetime/encode/datetime/aio/operations/_operations.py index 7469800ba2e..93aad0f88b1 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-datetime/encode/datetime/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-datetime/encode/datetime/aio/operations/_operations.py @@ -85,7 +85,7 @@ async def default( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -132,7 +132,7 @@ async def rfc3339( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -179,7 +179,7 @@ async def rfc7231( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -226,7 +226,7 @@ async def unix_timestamp( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -273,7 +273,7 @@ async def unix_timestamp_array( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -428,7 +428,7 @@ async def default( "value": "2020-02-20 00:00:00" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -581,7 +581,7 @@ async def rfc3339( "value": "2020-02-20 00:00:00" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -734,7 +734,7 @@ async def rfc7231( "value": "2020-02-20 00:00:00" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -892,7 +892,7 @@ async def unix_timestamp( "value": "2020-02-20 00:00:00" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1062,7 +1062,7 @@ async def unix_timestamp_array( ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1143,7 +1143,7 @@ async def default( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1190,7 +1190,7 @@ async def rfc3339( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1237,7 +1237,7 @@ async def rfc7231( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1284,7 +1284,7 @@ async def unix_timestamp( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1331,7 +1331,7 @@ async def unix_timestamp_array( # pylint: disable=inconsistent-return-statement :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1392,7 +1392,7 @@ async def default(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1437,7 +1437,7 @@ async def rfc3339(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1482,7 +1482,7 @@ async def rfc7231(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1527,7 +1527,7 @@ async def unix_timestamp(self, **kwargs: Any) -> None: # pylint: disable=incons :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/encode-datetime/encode/datetime/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-datetime/encode/datetime/operations/_operations.py index 74c6f38e5a7..3dee60dcda8 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-datetime/encode/datetime/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-datetime/encode/datetime/operations/_operations.py @@ -303,7 +303,7 @@ def default( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -350,7 +350,7 @@ def rfc3339( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -397,7 +397,7 @@ def rfc7231( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -444,7 +444,7 @@ def unix_timestamp( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -491,7 +491,7 @@ def unix_timestamp_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -646,7 +646,7 @@ def default( "value": "2020-02-20 00:00:00" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -799,7 +799,7 @@ def rfc3339( "value": "2020-02-20 00:00:00" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -952,7 +952,7 @@ def rfc7231( "value": "2020-02-20 00:00:00" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1110,7 +1110,7 @@ def unix_timestamp( "value": "2020-02-20 00:00:00" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1280,7 +1280,7 @@ def unix_timestamp_array( ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1361,7 +1361,7 @@ def default( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1408,7 +1408,7 @@ def rfc3339( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1455,7 +1455,7 @@ def rfc7231( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1502,7 +1502,7 @@ def unix_timestamp( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1549,7 +1549,7 @@ def unix_timestamp_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1610,7 +1610,7 @@ def default(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1655,7 +1655,7 @@ def rfc3339(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1700,7 +1700,7 @@ def rfc7231(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1745,7 +1745,7 @@ def unix_timestamp(self, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/encode-duration/encode/duration/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-duration/encode/duration/aio/operations/_operations.py index c1adc7bc3de..2e866eb908a 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-duration/encode/duration/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-duration/encode/duration/aio/operations/_operations.py @@ -81,7 +81,7 @@ async def default( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -128,7 +128,7 @@ async def iso8601( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -175,7 +175,7 @@ async def int32_seconds( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -222,7 +222,7 @@ async def float_seconds( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -269,7 +269,7 @@ async def int32_seconds_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -424,7 +424,7 @@ async def default( "value": "1 day, 0:00:00" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -577,7 +577,7 @@ async def iso8601( "value": "1 day, 0:00:00" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -735,7 +735,7 @@ async def int32_seconds( "value": 0 # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -893,7 +893,7 @@ async def float_seconds( "value": 0.0 # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1063,7 +1063,7 @@ async def float_seconds_array( ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1144,7 +1144,7 @@ async def default( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1191,7 +1191,7 @@ async def iso8601( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1238,7 +1238,7 @@ async def iso8601_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1285,7 +1285,7 @@ async def int32_seconds( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1332,7 +1332,7 @@ async def float_seconds( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/encode-duration/encode/duration/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-duration/encode/duration/operations/_operations.py index cec9ea877b6..f3278848803 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-duration/encode/duration/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-duration/encode/duration/operations/_operations.py @@ -273,7 +273,7 @@ def default( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -320,7 +320,7 @@ def iso8601( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -365,7 +365,7 @@ def int32_seconds(self, *, input: int, **kwargs: Any) -> None: # pylint: disabl :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -410,7 +410,7 @@ def float_seconds(self, *, input: float, **kwargs: Any) -> None: # pylint: disa :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -457,7 +457,7 @@ def int32_seconds_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -612,7 +612,7 @@ def default( "value": "1 day, 0:00:00" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -765,7 +765,7 @@ def iso8601( "value": "1 day, 0:00:00" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -923,7 +923,7 @@ def int32_seconds( "value": 0 # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1081,7 +1081,7 @@ def float_seconds( "value": 0.0 # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1251,7 +1251,7 @@ def float_seconds_array( ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1332,7 +1332,7 @@ def default( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1379,7 +1379,7 @@ def iso8601( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1426,7 +1426,7 @@ def iso8601_array( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1471,7 +1471,7 @@ def int32_seconds(self, *, duration: int, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1518,7 +1518,7 @@ def float_seconds( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/headasbooleanfalse/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/headasbooleanfalse/_operations/_operations.py index 5dfbe56bf73..ec6621a8ddb 100644 --- a/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/headasbooleanfalse/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/headasbooleanfalse/_operations/_operations.py @@ -289,7 +289,7 @@ def get_model( ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -436,7 +436,7 @@ def head_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -576,7 +576,7 @@ def put_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -716,7 +716,7 @@ def patch_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -856,7 +856,7 @@ def post_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -996,7 +996,7 @@ def delete_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/headasbooleanfalse/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/headasbooleanfalse/aio/_operations/_operations.py index abc38d900b6..6a9d4a10afe 100644 --- a/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/headasbooleanfalse/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/headasbooleanfalse/aio/_operations/_operations.py @@ -206,7 +206,7 @@ async def get_model( ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -353,7 +353,7 @@ async def head_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -493,7 +493,7 @@ async def put_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -633,7 +633,7 @@ async def patch_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -773,7 +773,7 @@ async def post_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -913,7 +913,7 @@ async def delete_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/headasbooleantrue/headasbooleantrue/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/headasbooleantrue/headasbooleantrue/_operations/_operations.py index 0059f6c07ca..72a1ae7b028 100644 --- a/packages/typespec-python/test/unbranded/generated/headasbooleantrue/headasbooleantrue/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/headasbooleantrue/headasbooleantrue/_operations/_operations.py @@ -289,7 +289,7 @@ def get_model( ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -430,7 +430,7 @@ def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **k ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -571,7 +571,7 @@ def put_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -711,7 +711,7 @@ def patch_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -851,7 +851,7 @@ def post_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -991,7 +991,7 @@ def delete_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/headasbooleantrue/headasbooleantrue/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/headasbooleantrue/headasbooleantrue/aio/_operations/_operations.py index 81ee2c3cb6b..32720d05ca3 100644 --- a/packages/typespec-python/test/unbranded/generated/headasbooleantrue/headasbooleantrue/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/headasbooleantrue/headasbooleantrue/aio/_operations/_operations.py @@ -206,7 +206,7 @@ async def get_model( ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -347,7 +347,7 @@ async def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes] ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -488,7 +488,7 @@ async def put_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -628,7 +628,7 @@ async def patch_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -768,7 +768,7 @@ async def post_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -908,7 +908,7 @@ async def delete_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/aio/operations/_operations.py index 9700222eb38..62aa1bcd1bf 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/aio/operations/_operations.py @@ -134,7 +134,7 @@ async def set( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -257,7 +257,7 @@ async def omit( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -382,7 +382,7 @@ async def required_explicit( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -502,7 +502,7 @@ async def required_implicit( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/operations/_operations.py index 1ba9cdc63c7..30f703b3298 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-body-optionality/parameters/bodyoptionality/operations/_operations.py @@ -188,7 +188,7 @@ def set( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -311,7 +311,7 @@ def omit( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -436,7 +436,7 @@ def required_explicit( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -556,7 +556,7 @@ def required_implicit( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/parameters-collection-format/parameters/collectionformat/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/parameters-collection-format/parameters/collectionformat/aio/operations/_operations.py index bc8864a079c..6856b084836 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-collection-format/parameters/collectionformat/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-collection-format/parameters/collectionformat/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, List, Optional, Type, TypeVar +from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -65,7 +65,7 @@ async def multi( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -110,7 +110,7 @@ async def ssv(self, *, colors: List[str], **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -155,7 +155,7 @@ async def tsv(self, *, colors: List[str], **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -202,7 +202,7 @@ async def pipes( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +247,7 @@ async def csv(self, *, colors: List[str], **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -310,7 +310,7 @@ async def csv(self, *, colors: List[str], **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/parameters-collection-format/parameters/collectionformat/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/parameters-collection-format/parameters/collectionformat/operations/_operations.py index d28c8e8524f..b32363e21c0 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-collection-format/parameters/collectionformat/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-collection-format/parameters/collectionformat/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, List, Optional, Type, TypeVar +from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -132,7 +132,7 @@ def multi(self, *, colors: List[str], **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -177,7 +177,7 @@ def ssv(self, *, colors: List[str], **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -222,7 +222,7 @@ def tsv(self, *, colors: List[str], **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -267,7 +267,7 @@ def pipes(self, *, colors: List[str], **kwargs: Any) -> None: # pylint: disable :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -312,7 +312,7 @@ def csv(self, *, colors: List[str], **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -375,7 +375,7 @@ def csv(self, *, colors: List[str], **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/parameters-spread/parameters/spread/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/parameters-spread/parameters/spread/aio/operations/_operations.py index b49905edfc4..b43bfc2641e 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-spread/parameters/spread/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-spread/parameters/spread/aio/operations/_operations.py @@ -134,7 +134,7 @@ async def spread_as_request_body( # pylint: disable=inconsistent-return-stateme "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -274,7 +274,7 @@ async def spread_as_request_body( # pylint: disable=inconsistent-return-stateme "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -423,7 +423,7 @@ async def spread_as_request_parameter( # pylint: disable=inconsistent-return-st "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -620,7 +620,7 @@ async def spread_with_multiple_parameters( # pylint: disable=inconsistent-retur "prop6": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/parameters-spread/parameters/spread/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/parameters-spread/parameters/spread/operations/_operations.py index da88fa29732..e07dde8a27c 100644 --- a/packages/typespec-python/test/unbranded/generated/parameters-spread/parameters/spread/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/parameters-spread/parameters/spread/operations/_operations.py @@ -204,7 +204,7 @@ def spread_as_request_body( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -344,7 +344,7 @@ def spread_as_request_body( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -493,7 +493,7 @@ def spread_as_request_parameter( # pylint: disable=inconsistent-return-statemen "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -690,7 +690,7 @@ def spread_with_multiple_parameters( # pylint: disable=inconsistent-return-stat "prop6": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/payload/contentnegotiation/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/payload/contentnegotiation/aio/operations/_operations.py index 32ba8693df0..46065ee3ea0 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/payload/contentnegotiation/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/payload/contentnegotiation/aio/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterator, Callable, Dict, Literal, Optional, Type, TypeVar +from typing import Any, AsyncIterator, Callable, Dict, Literal, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -62,7 +62,7 @@ async def get_avatar_as_png(self, **kwargs: Any) -> AsyncIterator[bytes]: :rtype: AsyncIterator[bytes] :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -110,7 +110,7 @@ async def get_avatar_as_jpeg(self, **kwargs: Any) -> AsyncIterator[bytes]: :rtype: AsyncIterator[bytes] :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -176,7 +176,7 @@ async def get_avatar_as_png(self, **kwargs: Any) -> AsyncIterator[bytes]: :rtype: AsyncIterator[bytes] :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -232,7 +232,7 @@ async def get_avatar_as_json(self, **kwargs: Any) -> _models.PngImageAsJson: "content": bytes("bytes", encoding="utf-8") # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/payload/contentnegotiation/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/payload/contentnegotiation/operations/_operations.py index 93183eaceab..f8dafd89bf4 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/payload/contentnegotiation/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-content-negotiation/payload/contentnegotiation/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterator, Literal, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterator, Literal, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -112,7 +112,7 @@ def get_avatar_as_png(self, **kwargs: Any) -> Iterator[bytes]: :rtype: Iterator[bytes] :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -160,7 +160,7 @@ def get_avatar_as_jpeg(self, **kwargs: Any) -> Iterator[bytes]: :rtype: Iterator[bytes] :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -226,7 +226,7 @@ def get_avatar_as_png(self, **kwargs: Any) -> Iterator[bytes]: :rtype: Iterator[bytes] :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +282,7 @@ def get_avatar_as_json(self, **kwargs: Any) -> _models.PngImageAsJson: "content": bytes("bytes", encoding="utf-8") # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/payload-json-merge-patch/payload/jsonmergepatch/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-json-merge-patch/payload/jsonmergepatch/_operations/_operations.py index 5445f295927..53ce0e29d2d 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-json-merge-patch/payload/jsonmergepatch/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-json-merge-patch/payload/jsonmergepatch/_operations/_operations.py @@ -323,7 +323,7 @@ def create_resource(self, body: Union[_models.Resource, JSON, IO[bytes]], **kwar } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -604,7 +604,7 @@ def update_resource(self, body: Union[_models.ResourcePatch, JSON, IO[bytes]], * } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -892,7 +892,7 @@ def update_optional_resource( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/payload-json-merge-patch/payload/jsonmergepatch/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-json-merge-patch/payload/jsonmergepatch/aio/_operations/_operations.py index 5a4e4a40a06..907eab7f537 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-json-merge-patch/payload/jsonmergepatch/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-json-merge-patch/payload/jsonmergepatch/aio/_operations/_operations.py @@ -273,7 +273,7 @@ async def create_resource(self, body: Union[_models.Resource, JSON, IO[bytes]], } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -556,7 +556,7 @@ async def update_resource( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -844,7 +844,7 @@ async def update_optional_resource( } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/payload-media-type/payload/mediatype/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-media-type/payload/mediatype/aio/operations/_operations.py index 5e12b43861f..132fa3f5faf 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-media-type/payload/mediatype/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-media-type/payload/mediatype/aio/operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import json import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -64,7 +64,7 @@ async def send_as_text(self, text: str, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -111,7 +111,7 @@ async def get_as_text(self, **kwargs: Any) -> str: :rtype: str :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -162,7 +162,7 @@ async def send_as_json(self, text: str, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -209,7 +209,7 @@ async def get_as_json(self, **kwargs: Any) -> str: :rtype: str :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/payload-media-type/payload/mediatype/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-media-type/payload/mediatype/operations/_operations.py index 9850c980f55..24399a8947b 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-media-type/payload/mediatype/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-media-type/payload/mediatype/operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import json import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -116,7 +116,7 @@ def send_as_text(self, text: str, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -163,7 +163,7 @@ def get_as_text(self, **kwargs: Any) -> str: :rtype: str :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -214,7 +214,7 @@ def send_as_json(self, text: str, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -261,7 +261,7 @@ def get_as_json(self, **kwargs: Any) -> str: :rtype: str :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/aio/operations/_operations.py index 9e8c4b31e2a..dd45e2618dd 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/aio/operations/_operations.py @@ -111,7 +111,7 @@ async def basic( # pylint: disable=inconsistent-return-statements "profileImage": filetype } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -224,7 +224,7 @@ async def complex( # pylint: disable=inconsistent-return-statements "profileImage": filetype } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -323,7 +323,7 @@ async def json_part( # pylint: disable=inconsistent-return-statements "profileImage": filetype } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -420,7 +420,7 @@ async def binary_array_parts( # pylint: disable=inconsistent-return-statements "pictures": [filetype] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -525,7 +525,7 @@ async def json_array_parts( # pylint: disable=inconsistent-return-statements "profileImage": filetype } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -622,7 +622,7 @@ async def multi_binary_parts( # pylint: disable=inconsistent-return-statements "picture": filetype } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -719,7 +719,7 @@ async def check_file_name_and_content_type( # pylint: disable=inconsistent-retu "profileImage": filetype } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/operations/_operations.py index 6df9e814b8b..bad18d7bd58 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/operations/_operations.py @@ -172,7 +172,7 @@ def basic( # pylint: disable=inconsistent-return-statements "profileImage": filetype } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -285,7 +285,7 @@ def complex( # pylint: disable=inconsistent-return-statements "profileImage": filetype } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -384,7 +384,7 @@ def json_part( # pylint: disable=inconsistent-return-statements "profileImage": filetype } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -479,7 +479,7 @@ def binary_array_parts( # pylint: disable=inconsistent-return-statements "pictures": [filetype] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -582,7 +582,7 @@ def json_array_parts( # pylint: disable=inconsistent-return-statements "profileImage": filetype } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -677,7 +677,7 @@ def multi_binary_parts( # pylint: disable=inconsistent-return-statements "picture": filetype } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -774,7 +774,7 @@ def check_file_name_and_content_type( # pylint: disable=inconsistent-return-sta "profileImage": filetype } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/_operations/_operations.py index adb35cca3e6..27c56c4ff66 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, List, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterable, List, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -79,7 +79,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.User"]: maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[List[_models.User]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/aio/_operations/_operations.py index 4e404e95684..b7d68b7e656 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, Type, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, List, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -56,7 +56,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.User"]: maxpagesize = kwargs.pop("maxpagesize", None) cls: ClsType[List[_models.User]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_operations.py index bcf016cf60a..9f00601e280 100644 --- a/packages/typespec-python/test/unbranded/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -82,7 +82,7 @@ def from_none(self, **kwargs: Any) -> bool: :rtype: bool :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -137,7 +137,7 @@ def from_one_required( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -192,7 +192,7 @@ def from_one_optional( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_operations.py index 299e5db0667..d674df126f4 100644 --- a/packages/typespec-python/test/unbranded/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -46,7 +46,7 @@ async def from_none(self, **kwargs: Any) -> bool: :rtype: bool :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -101,7 +101,7 @@ async def from_one_required( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -156,7 +156,7 @@ async def from_one_optional( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_operations.py index d131ddf3509..f2ccab1967a 100644 --- a/packages/typespec-python/test/unbranded/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -106,7 +106,7 @@ def add_operation(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -160,7 +160,7 @@ def from_none(self, *, new_parameter: Optional[str] = None, **kwargs: Any) -> bo :rtype: bool :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -221,7 +221,7 @@ def from_one_required( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +282,7 @@ def from_one_optional( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_operations.py index 9a3360f28ab..bdfc3347cd0 100644 --- a/packages/typespec-python/test/unbranded/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -50,7 +50,7 @@ async def add_operation(self, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -104,7 +104,7 @@ async def from_none(self, *, new_parameter: Optional[str] = None, **kwargs: Any) :rtype: bool :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +165,7 @@ async def from_one_required( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -226,7 +226,7 @@ async def from_one_optional( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/operations/_operations.py index 42e131c6aeb..fcd29042393 100644 --- a/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/serialization/encodedname/json/aio/operations/_operations.py @@ -128,7 +128,7 @@ async def send( # pylint: disable=inconsistent-return-statements "wireName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -188,7 +188,7 @@ async def get(self, **kwargs: Any) -> _models.JsonEncodedNameModel: "wireName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/serialization/encodedname/json/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/serialization/encodedname/json/operations/_operations.py index 363d1633548..0afc72a77df 100644 --- a/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/serialization/encodedname/json/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/serialization-encoded-name-json/serialization/encodedname/json/operations/_operations.py @@ -159,7 +159,7 @@ def send( # pylint: disable=inconsistent-return-statements "wireName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -219,7 +219,7 @@ def get(self, **kwargs: Any) -> _models.JsonEncodedNameModel: "wireName": bool # Pass in true. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/server-endpoint-not-defined/server/endpoint/notdefined/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/server-endpoint-not-defined/server/endpoint/notdefined/_operations/_operations.py index 5108f3c98af..03b5780f0e6 100644 --- a/packages/typespec-python/test/unbranded/generated/server-endpoint-not-defined/server/endpoint/notdefined/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/server-endpoint-not-defined/server/endpoint/notdefined/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -49,7 +49,7 @@ def valid(self, **kwargs: Any) -> bool: :rtype: bool :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/server-endpoint-not-defined/server/endpoint/notdefined/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/server-endpoint-not-defined/server/endpoint/notdefined/aio/_operations/_operations.py index 15c4dc95400..37c775310fb 100644 --- a/packages/typespec-python/test/unbranded/generated/server-endpoint-not-defined/server/endpoint/notdefined/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/server-endpoint-not-defined/server/endpoint/notdefined/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -39,7 +39,7 @@ async def valid(self, **kwargs: Any) -> bool: :rtype: bool :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/_operations/_operations.py index 3fe6cf1fa1b..98435771cdf 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -63,7 +63,7 @@ def no_operation_params(self, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -113,7 +113,7 @@ def with_operation_path_param( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/aio/_operations/_operations.py index e98ac3bcddf..17d9bf484a1 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -42,7 +42,7 @@ async def no_operation_params(self, **kwargs: Any) -> None: # pylint: disable=i :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -92,7 +92,7 @@ async def with_operation_path_param( # pylint: disable=inconsistent-return-stat :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/_operations/_operations.py index 524f15896dc..ccf28c51d24 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -49,7 +49,7 @@ def my_op(self, **kwargs: Any) -> bool: :rtype: bool :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/aio/_operations/_operations.py index 9dff84b1d71..1fc886aed5a 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -39,7 +39,7 @@ async def my_op(self, **kwargs: Any) -> bool: :rtype: bool :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/_operations/_operations.py index 705d0a5d474..754136aa846 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -78,7 +78,7 @@ def without_api_version(self, **kwargs: Any) -> bool: :rtype: bool :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -124,7 +124,7 @@ def with_query_api_version(self, **kwargs: Any) -> bool: :rtype: bool :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -171,7 +171,7 @@ def with_path_api_version(self, **kwargs: Any) -> bool: :rtype: bool :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/aio/_operations/_operations.py index aa7477a2ae1..c3b546bb7af 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -43,7 +43,7 @@ async def without_api_version(self, **kwargs: Any) -> bool: :rtype: bool :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -89,7 +89,7 @@ async def with_query_api_version(self, **kwargs: Any) -> bool: :rtype: bool :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -136,7 +136,7 @@ async def with_path_api_version(self, **kwargs: Any) -> bool: :rtype: bool :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/_operations/_operations.py index 75e71625a55..b7118bfff68 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -76,7 +76,7 @@ def without_api_version(self, **kwargs: Any) -> bool: :rtype: bool :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -122,7 +122,7 @@ def with_query_api_version(self, **kwargs: Any) -> bool: :rtype: bool :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +169,7 @@ def with_path_api_version(self, **kwargs: Any) -> bool: :rtype: bool :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/aio/_operations/_operations.py index d59bd242264..21132118c45 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -43,7 +43,7 @@ async def without_api_version(self, **kwargs: Any) -> bool: :rtype: bool :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -89,7 +89,7 @@ async def with_query_api_version(self, **kwargs: Any) -> bool: :rtype: bool :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -136,7 +136,7 @@ async def with_path_api_version(self, **kwargs: Any) -> bool: :rtype: bool :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/specialheaders/conditionalrequest/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/specialheaders/conditionalrequest/_operations/_operations.py index b66c3c843cc..995e9e1acc6 100644 --- a/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/specialheaders/conditionalrequest/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/specialheaders/conditionalrequest/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp import MatchConditions from corehttp.exceptions import ( @@ -90,7 +90,7 @@ def post_if_match( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -147,7 +147,7 @@ def post_if_none_match( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/specialheaders/conditionalrequest/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/specialheaders/conditionalrequest/aio/_operations/_operations.py index e5237935547..6ba3a942e56 100644 --- a/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/specialheaders/conditionalrequest/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/specialheaders/conditionalrequest/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp import MatchConditions from corehttp.exceptions import ( @@ -51,7 +51,7 @@ async def post_if_match( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -108,7 +108,7 @@ async def post_if_none_match( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/special-headers-repeatability/specialheaders/repeatability/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/special-headers-repeatability/specialheaders/repeatability/_operations/_operations.py index 89668ba2693..9e99d9aabc5 100644 --- a/packages/typespec-python/test/unbranded/generated/special-headers-repeatability/specialheaders/repeatability/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/special-headers-repeatability/specialheaders/repeatability/_operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union import uuid from corehttp.exceptions import ( @@ -62,7 +62,7 @@ def immediate_success(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/special-headers-repeatability/specialheaders/repeatability/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/special-headers-repeatability/specialheaders/repeatability/aio/_operations/_operations.py index dd5f8a53327..52bd7fb40fb 100644 --- a/packages/typespec-python/test/unbranded/generated/special-headers-repeatability/specialheaders/repeatability/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/special-headers-repeatability/specialheaders/repeatability/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -39,7 +39,7 @@ async def immediate_success(self, **kwargs: Any) -> None: # pylint: disable=inc :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/special-words/specialwords/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/special-words/specialwords/aio/operations/_operations.py index 237f0151bc9..2db0049f8a4 100644 --- a/packages/typespec-python/test/unbranded/generated/special-words/specialwords/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/special-words/specialwords/aio/operations/_operations.py @@ -230,7 +230,7 @@ async def with_and( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -350,7 +350,7 @@ async def with_as( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -470,7 +470,7 @@ async def with_assert( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -590,7 +590,7 @@ async def with_async( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -710,7 +710,7 @@ async def with_await( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -830,7 +830,7 @@ async def with_break( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -950,7 +950,7 @@ async def with_class( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1070,7 +1070,7 @@ async def with_constructor( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1190,7 +1190,7 @@ async def with_continue( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1310,7 +1310,7 @@ async def with_def( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1430,7 +1430,7 @@ async def with_del( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1550,7 +1550,7 @@ async def with_elif( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1670,7 +1670,7 @@ async def with_else( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1790,7 +1790,7 @@ async def with_except( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1910,7 +1910,7 @@ async def with_exec( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2030,7 +2030,7 @@ async def with_finally( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2150,7 +2150,7 @@ async def with_for( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2270,7 +2270,7 @@ async def with_from( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2390,7 +2390,7 @@ async def with_global( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2510,7 +2510,7 @@ async def with_if( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2630,7 +2630,7 @@ async def with_import( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2750,7 +2750,7 @@ async def with_in( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2870,7 +2870,7 @@ async def with_is( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2990,7 +2990,7 @@ async def with_lambda( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3110,7 +3110,7 @@ async def with_not( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3230,7 +3230,7 @@ async def with_or( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3350,7 +3350,7 @@ async def with_pass( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3470,7 +3470,7 @@ async def with_raise( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3590,7 +3590,7 @@ async def with_return( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3710,7 +3710,7 @@ async def with_try( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3830,7 +3830,7 @@ async def with_while( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3950,7 +3950,7 @@ async def with_with( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4070,7 +4070,7 @@ async def with_yield( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4208,7 +4208,7 @@ async def same_as_model( # pylint: disable=inconsistent-return-statements "SameAsModel": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4278,7 +4278,7 @@ async def and_method(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4320,7 +4320,7 @@ async def as_method(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4362,7 +4362,7 @@ async def assert_method(self, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4404,7 +4404,7 @@ async def async_method(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4446,7 +4446,7 @@ async def await_method(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4488,7 +4488,7 @@ async def break_method(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4530,7 +4530,7 @@ async def class_method(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4572,7 +4572,7 @@ async def constructor(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4614,7 +4614,7 @@ async def continue_method(self, **kwargs: Any) -> None: # pylint: disable=incon :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4656,7 +4656,7 @@ async def def_method(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4698,7 +4698,7 @@ async def del_method(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4740,7 +4740,7 @@ async def elif_method(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4782,7 +4782,7 @@ async def else_method(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4824,7 +4824,7 @@ async def except_method(self, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4866,7 +4866,7 @@ async def exec_method(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4908,7 +4908,7 @@ async def finally_method(self, **kwargs: Any) -> None: # pylint: disable=incons :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4950,7 +4950,7 @@ async def for_method(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4992,7 +4992,7 @@ async def from_method(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5034,7 +5034,7 @@ async def global_method(self, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5076,7 +5076,7 @@ async def if_method(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5118,7 +5118,7 @@ async def import_method(self, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5160,7 +5160,7 @@ async def in_method(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5202,7 +5202,7 @@ async def is_method(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5244,7 +5244,7 @@ async def lambda_method(self, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5286,7 +5286,7 @@ async def not_method(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5328,7 +5328,7 @@ async def or_method(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5370,7 +5370,7 @@ async def pass_method(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5412,7 +5412,7 @@ async def raise_method(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5454,7 +5454,7 @@ async def return_method(self, **kwargs: Any) -> None: # pylint: disable=inconsi :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5496,7 +5496,7 @@ async def try_method(self, **kwargs: Any) -> None: # pylint: disable=inconsiste :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5538,7 +5538,7 @@ async def while_method(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5580,7 +5580,7 @@ async def with_method(self, **kwargs: Any) -> None: # pylint: disable=inconsist :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5622,7 +5622,7 @@ async def yield_method(self, **kwargs: Any) -> None: # pylint: disable=inconsis :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5686,7 +5686,7 @@ async def with_and( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5733,7 +5733,7 @@ async def with_as( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5780,7 +5780,7 @@ async def with_assert( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5827,7 +5827,7 @@ async def with_async( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5874,7 +5874,7 @@ async def with_await( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5921,7 +5921,7 @@ async def with_break( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5968,7 +5968,7 @@ async def with_class( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6015,7 +6015,7 @@ async def with_constructor( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6062,7 +6062,7 @@ async def with_continue( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6109,7 +6109,7 @@ async def with_def( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6156,7 +6156,7 @@ async def with_del( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6203,7 +6203,7 @@ async def with_elif( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6250,7 +6250,7 @@ async def with_else( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6297,7 +6297,7 @@ async def with_except( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6344,7 +6344,7 @@ async def with_exec( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6391,7 +6391,7 @@ async def with_finally( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6438,7 +6438,7 @@ async def with_for( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6485,7 +6485,7 @@ async def with_from( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6532,7 +6532,7 @@ async def with_global( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6579,7 +6579,7 @@ async def with_if( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6626,7 +6626,7 @@ async def with_import( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6673,7 +6673,7 @@ async def with_in( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6720,7 +6720,7 @@ async def with_is( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6767,7 +6767,7 @@ async def with_lambda( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6814,7 +6814,7 @@ async def with_not( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6861,7 +6861,7 @@ async def with_or( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6908,7 +6908,7 @@ async def with_pass( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6955,7 +6955,7 @@ async def with_raise( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7002,7 +7002,7 @@ async def with_return( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7049,7 +7049,7 @@ async def with_try( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7096,7 +7096,7 @@ async def with_while( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7143,7 +7143,7 @@ async def with_with( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7190,7 +7190,7 @@ async def with_yield( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7237,7 +7237,7 @@ async def with_cancellation_token( # pylint: disable=inconsistent-return-statem :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/special-words/specialwords/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/special-words/specialwords/operations/_operations.py index 8ba298b0c9c..ac2b528b7b4 100644 --- a/packages/typespec-python/test/unbranded/generated/special-words/specialwords/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/special-words/specialwords/operations/_operations.py @@ -1250,7 +1250,7 @@ def with_and( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1370,7 +1370,7 @@ def with_as( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1490,7 +1490,7 @@ def with_assert( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1610,7 +1610,7 @@ def with_async( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1730,7 +1730,7 @@ def with_await( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1850,7 +1850,7 @@ def with_break( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1970,7 +1970,7 @@ def with_class( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2090,7 +2090,7 @@ def with_constructor( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2210,7 +2210,7 @@ def with_continue( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2330,7 +2330,7 @@ def with_def( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2450,7 +2450,7 @@ def with_del( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2570,7 +2570,7 @@ def with_elif( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2690,7 +2690,7 @@ def with_else( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2810,7 +2810,7 @@ def with_except( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2930,7 +2930,7 @@ def with_exec( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3050,7 +3050,7 @@ def with_finally( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3170,7 +3170,7 @@ def with_for( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3290,7 +3290,7 @@ def with_from( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3410,7 +3410,7 @@ def with_global( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3530,7 +3530,7 @@ def with_if( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3650,7 +3650,7 @@ def with_import( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3770,7 +3770,7 @@ def with_in( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3890,7 +3890,7 @@ def with_is( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4010,7 +4010,7 @@ def with_lambda( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4130,7 +4130,7 @@ def with_not( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4250,7 +4250,7 @@ def with_or( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4370,7 +4370,7 @@ def with_pass( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4490,7 +4490,7 @@ def with_raise( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4610,7 +4610,7 @@ def with_return( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4730,7 +4730,7 @@ def with_try( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4850,7 +4850,7 @@ def with_while( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4970,7 +4970,7 @@ def with_with( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5090,7 +5090,7 @@ def with_yield( # pylint: disable=inconsistent-return-statements "name": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5228,7 +5228,7 @@ def same_as_model( # pylint: disable=inconsistent-return-statements "SameAsModel": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5298,7 +5298,7 @@ def and_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5340,7 +5340,7 @@ def as_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5382,7 +5382,7 @@ def assert_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5424,7 +5424,7 @@ def async_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5466,7 +5466,7 @@ def await_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5508,7 +5508,7 @@ def break_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5550,7 +5550,7 @@ def class_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5592,7 +5592,7 @@ def constructor(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5634,7 +5634,7 @@ def continue_method(self, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5676,7 +5676,7 @@ def def_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5718,7 +5718,7 @@ def del_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5760,7 +5760,7 @@ def elif_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5802,7 +5802,7 @@ def else_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5844,7 +5844,7 @@ def except_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5886,7 +5886,7 @@ def exec_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5928,7 +5928,7 @@ def finally_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5970,7 +5970,7 @@ def for_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6012,7 +6012,7 @@ def from_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6054,7 +6054,7 @@ def global_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6096,7 +6096,7 @@ def if_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6138,7 +6138,7 @@ def import_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6180,7 +6180,7 @@ def in_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6222,7 +6222,7 @@ def is_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6264,7 +6264,7 @@ def lambda_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6306,7 +6306,7 @@ def not_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6348,7 +6348,7 @@ def or_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-retu :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6390,7 +6390,7 @@ def pass_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6432,7 +6432,7 @@ def raise_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6474,7 +6474,7 @@ def return_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6516,7 +6516,7 @@ def try_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-ret :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6558,7 +6558,7 @@ def while_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6600,7 +6600,7 @@ def with_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6642,7 +6642,7 @@ def yield_method(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6704,7 +6704,7 @@ def with_and(self, *, and_parameter: str, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6749,7 +6749,7 @@ def with_as(self, *, as_parameter: str, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6796,7 +6796,7 @@ def with_assert( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6843,7 +6843,7 @@ def with_async( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6890,7 +6890,7 @@ def with_await( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6937,7 +6937,7 @@ def with_break( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6984,7 +6984,7 @@ def with_class( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7031,7 +7031,7 @@ def with_constructor( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7078,7 +7078,7 @@ def with_continue( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7123,7 +7123,7 @@ def with_def(self, *, def_parameter: str, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7168,7 +7168,7 @@ def with_del(self, *, del_parameter: str, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7215,7 +7215,7 @@ def with_elif( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7262,7 +7262,7 @@ def with_else( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7309,7 +7309,7 @@ def with_except( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7356,7 +7356,7 @@ def with_exec( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7403,7 +7403,7 @@ def with_finally( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7448,7 +7448,7 @@ def with_for(self, *, for_parameter: str, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7495,7 +7495,7 @@ def with_from( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7542,7 +7542,7 @@ def with_global( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7587,7 +7587,7 @@ def with_if(self, *, if_parameter: str, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7634,7 +7634,7 @@ def with_import( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7679,7 +7679,7 @@ def with_in(self, *, in_parameter: str, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7724,7 +7724,7 @@ def with_is(self, *, is_parameter: str, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7771,7 +7771,7 @@ def with_lambda( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7816,7 +7816,7 @@ def with_not(self, *, not_parameter: str, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7861,7 +7861,7 @@ def with_or(self, *, or_parameter: str, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7908,7 +7908,7 @@ def with_pass( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -7955,7 +7955,7 @@ def with_raise( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8002,7 +8002,7 @@ def with_return( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8047,7 +8047,7 @@ def with_try(self, *, try_parameter: str, **kwargs: Any) -> None: # pylint: dis :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8094,7 +8094,7 @@ def with_while( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8141,7 +8141,7 @@ def with_with( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8188,7 +8188,7 @@ def with_yield( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -8235,7 +8235,7 @@ def with_cancellation_token( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-array/typetest/array/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-array/typetest/array/aio/operations/_operations.py index e18e7f5ea65..63aac363da6 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-array/typetest/array/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-array/typetest/array/aio/operations/_operations.py @@ -89,7 +89,7 @@ async def get(self, **kwargs: Any) -> List[int]: 0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -182,7 +182,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -260,7 +260,7 @@ async def get(self, **kwargs: Any) -> List[int]: 0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -353,7 +353,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -431,7 +431,7 @@ async def get(self, **kwargs: Any) -> List[bool]: bool # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -524,7 +524,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -602,7 +602,7 @@ async def get(self, **kwargs: Any) -> List[str]: "str" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -695,7 +695,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -773,7 +773,7 @@ async def get(self, **kwargs: Any) -> List[float]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -866,7 +866,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -944,7 +944,7 @@ async def get(self, **kwargs: Any) -> List[datetime.datetime]: "2020-02-20 00:00:00" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1037,7 +1037,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1115,7 +1115,7 @@ async def get(self, **kwargs: Any) -> List[datetime.timedelta]: "1 day, 0:00:00" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1208,7 +1208,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1286,7 +1286,7 @@ async def get(self, **kwargs: Any) -> List[Any]: {} # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1379,7 +1379,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1462,7 +1462,7 @@ async def get(self, **kwargs: Any) -> List[_models.InnerModel]: } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1560,7 +1560,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1638,7 +1638,7 @@ async def get(self, **kwargs: Any) -> List[float]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1731,7 +1731,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-array/typetest/array/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-array/typetest/array/operations/_operations.py index 811033b48cc..7bfd9db42fd 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-array/typetest/array/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-array/typetest/array/operations/_operations.py @@ -351,7 +351,7 @@ def get(self, **kwargs: Any) -> List[int]: 0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -444,7 +444,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +522,7 @@ def get(self, **kwargs: Any) -> List[int]: 0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -615,7 +615,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -693,7 +693,7 @@ def get(self, **kwargs: Any) -> List[bool]: bool # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -786,7 +786,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -864,7 +864,7 @@ def get(self, **kwargs: Any) -> List[str]: "str" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -957,7 +957,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1035,7 +1035,7 @@ def get(self, **kwargs: Any) -> List[float]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1128,7 +1128,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1206,7 +1206,7 @@ def get(self, **kwargs: Any) -> List[datetime.datetime]: "2020-02-20 00:00:00" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1299,7 +1299,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1377,7 +1377,7 @@ def get(self, **kwargs: Any) -> List[datetime.timedelta]: "1 day, 0:00:00" # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1470,7 +1470,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1548,7 +1548,7 @@ def get(self, **kwargs: Any) -> List[Any]: {} # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1641,7 +1641,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1724,7 +1724,7 @@ def get(self, **kwargs: Any) -> List[_models.InnerModel]: } ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1822,7 +1822,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1900,7 +1900,7 @@ def get(self, **kwargs: Any) -> List[float]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1993,7 +1993,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-dictionary/typetest/dictionary/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-dictionary/typetest/dictionary/aio/operations/_operations.py index 2cc831637ab..cfb2a82b17b 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-dictionary/typetest/dictionary/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-dictionary/typetest/dictionary/aio/operations/_operations.py @@ -91,7 +91,7 @@ async def get(self, **kwargs: Any) -> Dict[str, int]: "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -184,7 +184,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -262,7 +262,7 @@ async def get(self, **kwargs: Any) -> Dict[str, int]: "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -355,7 +355,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -433,7 +433,7 @@ async def get(self, **kwargs: Any) -> Dict[str, bool]: "str": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -526,7 +526,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -604,7 +604,7 @@ async def get(self, **kwargs: Any) -> Dict[str, str]: "str": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -697,7 +697,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -775,7 +775,7 @@ async def get(self, **kwargs: Any) -> Dict[str, float]: "str": 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -868,7 +868,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -946,7 +946,7 @@ async def get(self, **kwargs: Any) -> Dict[str, datetime.datetime]: "str": "2020-02-20 00:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1039,7 +1039,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1117,7 +1117,7 @@ async def get(self, **kwargs: Any) -> Dict[str, datetime.timedelta]: "str": "1 day, 0:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1210,7 +1210,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1288,7 +1288,7 @@ async def get(self, **kwargs: Any) -> Dict[str, Any]: "str": {} # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1381,7 +1381,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1464,7 +1464,7 @@ async def get(self, **kwargs: Any) -> Dict[str, _models.InnerModel]: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1562,7 +1562,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1645,7 +1645,7 @@ async def get(self, **kwargs: Any) -> Dict[str, _models.InnerModel]: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1743,7 +1743,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1821,7 +1821,7 @@ async def get(self, **kwargs: Any) -> Dict[str, float]: "str": 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1914,7 +1914,7 @@ async def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-dictionary/typetest/dictionary/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-dictionary/typetest/dictionary/operations/_operations.py index e29fe1f7169..d0fee52daf0 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-dictionary/typetest/dictionary/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-dictionary/typetest/dictionary/operations/_operations.py @@ -379,7 +379,7 @@ def get(self, **kwargs: Any) -> Dict[str, int]: "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +472,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -550,7 +550,7 @@ def get(self, **kwargs: Any) -> Dict[str, int]: "str": 0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -643,7 +643,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -721,7 +721,7 @@ def get(self, **kwargs: Any) -> Dict[str, bool]: "str": bool # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -814,7 +814,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -892,7 +892,7 @@ def get(self, **kwargs: Any) -> Dict[str, str]: "str": "str" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -985,7 +985,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1063,7 +1063,7 @@ def get(self, **kwargs: Any) -> Dict[str, float]: "str": 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1156,7 +1156,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1234,7 +1234,7 @@ def get(self, **kwargs: Any) -> Dict[str, datetime.datetime]: "str": "2020-02-20 00:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1327,7 +1327,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1405,7 +1405,7 @@ def get(self, **kwargs: Any) -> Dict[str, datetime.timedelta]: "str": "1 day, 0:00:00" # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1498,7 +1498,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1576,7 +1576,7 @@ def get(self, **kwargs: Any) -> Dict[str, Any]: "str": {} # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1669,7 +1669,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1752,7 +1752,7 @@ def get(self, **kwargs: Any) -> Dict[str, _models.InnerModel]: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1850,7 +1850,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1933,7 +1933,7 @@ def get(self, **kwargs: Any) -> Dict[str, _models.InnerModel]: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2031,7 +2031,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2109,7 +2109,7 @@ def get(self, **kwargs: Any) -> Dict[str, float]: "str": 0.0 # Optional. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2202,7 +2202,7 @@ def put( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-enum-extensible/typetest/enum/extensible/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-enum-extensible/typetest/enum/extensible/aio/operations/_operations.py index 73adff10311..f931b97f217 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-enum-extensible/typetest/enum/extensible/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-enum-extensible/typetest/enum/extensible/aio/operations/_operations.py @@ -63,7 +63,7 @@ async def get_known_value(self, **kwargs: Any) -> Union[str, _models.DaysOfWeekE :rtype: str or ~typetest.enum.extensible.models.DaysOfWeekExtensibleEnum :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -112,7 +112,7 @@ async def get_unknown_value(self, **kwargs: Any) -> Union[str, _models.DaysOfWee :rtype: str or ~typetest.enum.extensible.models.DaysOfWeekExtensibleEnum :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -166,7 +166,7 @@ async def put_known_value( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -218,7 +218,7 @@ async def put_unknown_value( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-enum-extensible/typetest/enum/extensible/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-enum-extensible/typetest/enum/extensible/operations/_operations.py index 53d1c8ff226..4041aff3242 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-enum-extensible/typetest/enum/extensible/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-enum-extensible/typetest/enum/extensible/operations/_operations.py @@ -115,7 +115,7 @@ def get_known_value(self, **kwargs: Any) -> Union[str, _models.DaysOfWeekExtensi :rtype: str or ~typetest.enum.extensible.models.DaysOfWeekExtensibleEnum :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -164,7 +164,7 @@ def get_unknown_value(self, **kwargs: Any) -> Union[str, _models.DaysOfWeekExten :rtype: str or ~typetest.enum.extensible.models.DaysOfWeekExtensibleEnum :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -218,7 +218,7 @@ def put_known_value( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -270,7 +270,7 @@ def put_unknown_value( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-enum-fixed/typetest/enum/fixed/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-enum-fixed/typetest/enum/fixed/aio/operations/_operations.py index a99c87df69c..d138ec5b04c 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-enum-fixed/typetest/enum/fixed/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-enum-fixed/typetest/enum/fixed/aio/operations/_operations.py @@ -62,7 +62,7 @@ async def get_known_value(self, **kwargs: Any) -> Union[str, _models.DaysOfWeekE :rtype: str or ~typetest.enum.fixed.models.DaysOfWeekEnum :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -116,7 +116,7 @@ async def put_known_value( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +168,7 @@ async def put_unknown_value( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-enum-fixed/typetest/enum/fixed/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-enum-fixed/typetest/enum/fixed/operations/_operations.py index 25c3954e5f9..9635e919fc2 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-enum-fixed/typetest/enum/fixed/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-enum-fixed/typetest/enum/fixed/operations/_operations.py @@ -101,7 +101,7 @@ def get_known_value(self, **kwargs: Any) -> Union[str, _models.DaysOfWeekEnum]: :rtype: str or ~typetest.enum.fixed.models.DaysOfWeekEnum :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -155,7 +155,7 @@ def put_known_value( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -207,7 +207,7 @@ def put_unknown_value( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-empty/typetest/model/empty/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-model-empty/typetest/model/empty/_operations/_operations.py index 293aee5ee5c..5df33225d4a 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-empty/typetest/model/empty/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-empty/typetest/model/empty/_operations/_operations.py @@ -157,7 +157,7 @@ def put_empty( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. input = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -209,7 +209,7 @@ def get_empty(self, **kwargs: Any) -> _models.EmptyOutput: :rtype: ~typetest.model.empty.models.EmptyOutput :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +322,7 @@ def post_round_trip_empty( # JSON input template you can fill out and use as your body input. body = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-empty/typetest/model/empty/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-model-empty/typetest/model/empty/aio/_operations/_operations.py index 29dc236a914..b261bca7530 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-empty/typetest/model/empty/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-empty/typetest/model/empty/aio/_operations/_operations.py @@ -113,7 +113,7 @@ async def put_empty( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. input = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +165,7 @@ async def get_empty(self, **kwargs: Any) -> _models.EmptyOutput: :rtype: ~typetest.model.empty.models.EmptyOutput :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -278,7 +278,7 @@ async def post_round_trip_empty( # JSON input template you can fill out and use as your body input. body = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/_operations/_operations.py index 311a15d8b06..daadcd43a73 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/_operations/_operations.py @@ -187,7 +187,7 @@ def get_extensible_model(self, **kwargs: Any) -> _models.Dog: # response body for status code(s): 200 response == dog """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -318,7 +318,7 @@ def put_extensible_model( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. input = dog """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -385,7 +385,7 @@ def get_extensible_model_missing_discriminator(self, **kwargs: Any) -> _models.D # response body for status code(s): 200 response == dog """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -449,7 +449,7 @@ def get_extensible_model_wrong_discriminator(self, **kwargs: Any) -> _models.Dog # response body for status code(s): 200 response == dog """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -513,7 +513,7 @@ def get_fixed_model(self, **kwargs: Any) -> _models.Snake: # response body for status code(s): 200 response == snake """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -644,7 +644,7 @@ def put_fixed_model( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. input = snake """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -711,7 +711,7 @@ def get_fixed_model_missing_discriminator(self, **kwargs: Any) -> _models.Snake: # response body for status code(s): 200 response == snake """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -775,7 +775,7 @@ def get_fixed_model_wrong_discriminator(self, **kwargs: Any) -> _models.Snake: # response body for status code(s): 200 response == snake """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/aio/_operations/_operations.py index f658bf58ea3..6c8d13bb2cf 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-enumdiscriminator/typetest/model/enumdiscriminator/aio/_operations/_operations.py @@ -69,7 +69,7 @@ async def get_extensible_model(self, **kwargs: Any) -> _models.Dog: # response body for status code(s): 200 response == dog """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -200,7 +200,7 @@ async def put_extensible_model( # pylint: disable=inconsistent-return-statement # JSON input template you can fill out and use as your body input. input = dog """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -269,7 +269,7 @@ async def get_extensible_model_missing_discriminator( # pylint: disable=name-to # response body for status code(s): 200 response == dog """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +333,7 @@ async def get_extensible_model_wrong_discriminator(self, **kwargs: Any) -> _mode # response body for status code(s): 200 response == dog """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -397,7 +397,7 @@ async def get_fixed_model(self, **kwargs: Any) -> _models.Snake: # response body for status code(s): 200 response == snake """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -528,7 +528,7 @@ async def put_fixed_model( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. input = snake """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -595,7 +595,7 @@ async def get_fixed_model_missing_discriminator(self, **kwargs: Any) -> _models. # response body for status code(s): 200 response == snake """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -659,7 +659,7 @@ async def get_fixed_model_wrong_discriminator(self, **kwargs: Any) -> _models.Sn # response body for status code(s): 200 response == snake """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/_operations/_operations.py index be4cd6ebc4b..ba1d12c28f6 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/_operations/_operations.py @@ -174,7 +174,7 @@ def get_model(self, **kwargs: Any) -> _models.Fish: # response body for status code(s): 200 response == fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -343,7 +343,7 @@ def put_model( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. input = fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -429,7 +429,7 @@ def get_recursive_model(self, **kwargs: Any) -> _models.Fish: # response body for status code(s): 200 response == fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -598,7 +598,7 @@ def put_recursive_model( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. input = fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -684,7 +684,7 @@ def get_missing_discriminator(self, **kwargs: Any) -> _models.Fish: # response body for status code(s): 200 response == fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -767,7 +767,7 @@ def get_wrong_discriminator(self, **kwargs: Any) -> _models.Fish: # response body for status code(s): 200 response == fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/aio/_operations/_operations.py index 14025d928d8..16bd2984445 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-nesteddiscriminator/typetest/model/nesteddiscriminator/aio/_operations/_operations.py @@ -86,7 +86,7 @@ async def get_model(self, **kwargs: Any) -> _models.Fish: # response body for status code(s): 200 response == fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -255,7 +255,7 @@ async def put_model( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. input = fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -341,7 +341,7 @@ async def get_recursive_model(self, **kwargs: Any) -> _models.Fish: # response body for status code(s): 200 response == fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -510,7 +510,7 @@ async def put_recursive_model( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. input = fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +596,7 @@ async def get_missing_discriminator(self, **kwargs: Any) -> _models.Fish: # response body for status code(s): 200 response == fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -679,7 +679,7 @@ async def get_wrong_discriminator(self, **kwargs: Any) -> _models.Fish: # response body for status code(s): 200 response == fish """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/_operations/_operations.py index 584eb2c7f99..664e20125b7 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/_operations/_operations.py @@ -165,7 +165,7 @@ def post_valid( # pylint: disable=inconsistent-return-statements "smart": bool # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -227,7 +227,7 @@ def get_valid(self, **kwargs: Any) -> _models.Siamese: "smart": bool # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +376,7 @@ def put_valid(self, input: Union[_models.Siamese, JSON, IO[bytes]], **kwargs: An "smart": bool # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/aio/_operations/_operations.py index 8f435edbe67..35cc08d5807 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-notdiscriminated/typetest/model/notdiscriminated/aio/_operations/_operations.py @@ -121,7 +121,7 @@ async def post_valid( # pylint: disable=inconsistent-return-statements "smart": bool # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -183,7 +183,7 @@ async def get_valid(self, **kwargs: Any) -> _models.Siamese: "smart": bool # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -334,7 +334,7 @@ async def put_valid(self, input: Union[_models.Siamese, JSON, IO[bytes]], **kwar "smart": bool # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/typetest/model/recursive/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/typetest/model/recursive/_operations/_operations.py index c4e0ab241a1..f402d17dbea 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/typetest/model/recursive/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/typetest/model/recursive/_operations/_operations.py @@ -150,7 +150,7 @@ def put( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -213,7 +213,7 @@ def get(self, **kwargs: Any) -> _models.Extension: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/typetest/model/recursive/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/typetest/model/recursive/aio/_operations/_operations.py index 16feb66a42f..0102bf40b4c 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/typetest/model/recursive/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-recursive/typetest/model/recursive/aio/_operations/_operations.py @@ -119,7 +119,7 @@ async def put( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -182,7 +182,7 @@ async def get(self, **kwargs: Any) -> _models.Extension: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/_operations/_operations.py index c10e1fe828a..908759c8f29 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/_operations/_operations.py @@ -194,7 +194,7 @@ def get_model(self, **kwargs: Any) -> _models.Bird: # response body for status code(s): 200 response == bird """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -375,7 +375,7 @@ def put_model( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. input = bird """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -467,7 +467,7 @@ def get_recursive_model(self, **kwargs: Any) -> _models.Bird: # response body for status code(s): 200 response == bird """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -648,7 +648,7 @@ def put_recursive_model( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. input = bird """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -740,7 +740,7 @@ def get_missing_discriminator(self, **kwargs: Any) -> _models.Bird: # response body for status code(s): 200 response == bird """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -829,7 +829,7 @@ def get_wrong_discriminator(self, **kwargs: Any) -> _models.Bird: # response body for status code(s): 200 response == bird """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -893,7 +893,7 @@ def get_legacy_model(self, **kwargs: Any) -> _models.Dinosaur: # response body for status code(s): 200 response == dinosaur """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/aio/_operations/_operations.py index 4a9575bead2..92f26e808c6 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-singlediscriminator/typetest/model/singlediscriminator/aio/_operations/_operations.py @@ -93,7 +93,7 @@ async def get_model(self, **kwargs: Any) -> _models.Bird: # response body for status code(s): 200 response == bird """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -274,7 +274,7 @@ async def put_model( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. input = bird """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -366,7 +366,7 @@ async def get_recursive_model(self, **kwargs: Any) -> _models.Bird: # response body for status code(s): 200 response == bird """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -547,7 +547,7 @@ async def put_recursive_model( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. input = bird """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -639,7 +639,7 @@ async def get_missing_discriminator(self, **kwargs: Any) -> _models.Bird: # response body for status code(s): 200 response == bird """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -728,7 +728,7 @@ async def get_wrong_discriminator(self, **kwargs: Any) -> _models.Bird: # response body for status code(s): 200 response == bird """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -792,7 +792,7 @@ async def get_legacy_model(self, **kwargs: Any) -> _models.Dinosaur: # response body for status code(s): 200 response == dinosaur """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-usage/typetest/model/usage/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-model-usage/typetest/model/usage/_operations/_operations.py index 734f9de04a4..74984b95d60 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-usage/typetest/model/usage/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-usage/typetest/model/usage/_operations/_operations.py @@ -161,7 +161,7 @@ def input( # pylint: disable=inconsistent-return-statements "requiredProp": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -221,7 +221,7 @@ def output(self, **kwargs: Any) -> _models.OutputRecord: "requiredProp": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -364,7 +364,7 @@ def input_and_output( "requiredProp": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-usage/typetest/model/usage/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-model-usage/typetest/model/usage/aio/_operations/_operations.py index dda03dd9cba..e3e3fdd70ec 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-usage/typetest/model/usage/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-usage/typetest/model/usage/aio/_operations/_operations.py @@ -117,7 +117,7 @@ async def input( # pylint: disable=inconsistent-return-statements "requiredProp": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -177,7 +177,7 @@ async def output(self, **kwargs: Any) -> _models.OutputRecord: "requiredProp": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -320,7 +320,7 @@ async def input_and_output( "requiredProp": "str" # Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/typetest/model/visibility/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/typetest/model/visibility/_operations/_operations.py index c698e008c51..43d9a538d80 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/typetest/model/visibility/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/typetest/model/visibility/_operations/_operations.py @@ -289,7 +289,7 @@ def get_model( ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -430,7 +430,7 @@ def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **k ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -571,7 +571,7 @@ def put_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -711,7 +711,7 @@ def patch_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -851,7 +851,7 @@ def post_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -991,7 +991,7 @@ def delete_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/typetest/model/visibility/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/typetest/model/visibility/aio/_operations/_operations.py index 839986ba466..f2aecaae908 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/typetest/model/visibility/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/typetest/model/visibility/aio/_operations/_operations.py @@ -206,7 +206,7 @@ async def get_model( ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -347,7 +347,7 @@ async def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes] ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -488,7 +488,7 @@ async def put_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -628,7 +628,7 @@ async def patch_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -768,7 +768,7 @@ async def post_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -908,7 +908,7 @@ async def delete_model( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/aio/operations/_operations.py index f58ac3e4b98..54b0dda0f13 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/aio/operations/_operations.py @@ -98,7 +98,7 @@ async def get(self, **kwargs: Any) -> _models.ExtendsUnknownAdditionalProperties "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -217,7 +217,7 @@ async def put( # pylint: disable=inconsistent-return-statements "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -299,7 +299,7 @@ async def get(self, **kwargs: Any) -> _models.ExtendsUnknownAdditionalProperties "age": 0.0 # Optional. The age property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -428,7 +428,7 @@ async def put( # pylint: disable=inconsistent-return-statements "age": 0.0 # Optional. The age property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -517,7 +517,7 @@ async def get(self, **kwargs: Any) -> _models.ExtendsUnknownAdditionalProperties # response body for status code(s): 200 response == extends_unknown_additional_properties_discriminated """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -660,7 +660,7 @@ async def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = extends_unknown_additional_properties_discriminated """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -739,7 +739,7 @@ async def get(self, **kwargs: Any) -> _models.IsUnknownAdditionalProperties: "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -858,7 +858,7 @@ async def put( # pylint: disable=inconsistent-return-statements "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -939,7 +939,7 @@ async def get(self, **kwargs: Any) -> _models.IsUnknownAdditionalPropertiesDeriv "age": 0.0 # Optional. The age property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1066,7 +1066,7 @@ async def put( # pylint: disable=inconsistent-return-statements "age": 0.0 # Optional. The age property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1155,7 +1155,7 @@ async def get(self, **kwargs: Any) -> _models.IsUnknownAdditionalPropertiesDiscr # response body for status code(s): 200 response == is_unknown_additional_properties_discriminated """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1298,7 +1298,7 @@ async def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = is_unknown_additional_properties_discriminated """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1377,7 +1377,7 @@ async def get(self, **kwargs: Any) -> _models.ExtendsStringAdditionalProperties: "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1496,7 +1496,7 @@ async def put( # pylint: disable=inconsistent-return-statements "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1575,7 +1575,7 @@ async def get(self, **kwargs: Any) -> _models.IsStringAdditionalProperties: "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1694,7 +1694,7 @@ async def put( # pylint: disable=inconsistent-return-statements "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1773,7 +1773,7 @@ async def get(self, **kwargs: Any) -> _models.ExtendsFloatAdditionalProperties: "id": 0.0 # The id property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1892,7 +1892,7 @@ async def put( # pylint: disable=inconsistent-return-statements "id": 0.0 # The id property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1971,7 +1971,7 @@ async def get(self, **kwargs: Any) -> _models.IsFloatAdditionalProperties: "id": 0.0 # The id property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2090,7 +2090,7 @@ async def put( # pylint: disable=inconsistent-return-statements "id": 0.0 # The id property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2161,7 +2161,7 @@ async def get(self, **kwargs: Any) -> _models.ExtendsModelAdditionalProperties: :rtype: ~typetest.property.additionalproperties.models.ExtendsModelAdditionalProperties :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2276,7 +2276,7 @@ async def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2347,7 +2347,7 @@ async def get(self, **kwargs: Any) -> _models.IsModelAdditionalProperties: :rtype: ~typetest.property.additionalproperties.models.IsModelAdditionalProperties :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2462,7 +2462,7 @@ async def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2533,7 +2533,7 @@ async def get(self, **kwargs: Any) -> _models.ExtendsModelArrayAdditionalPropert :rtype: ~typetest.property.additionalproperties.models.ExtendsModelArrayAdditionalProperties :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2654,7 +2654,7 @@ async def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2725,7 +2725,7 @@ async def get(self, **kwargs: Any) -> _models.IsModelArrayAdditionalProperties: :rtype: ~typetest.property.additionalproperties.models.IsModelArrayAdditionalProperties :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2840,7 +2840,7 @@ async def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/operations/_operations.py index f01ed8cd56e..293bf10515b 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-property-additionalproperties/typetest/property/additionalproperties/operations/_operations.py @@ -464,7 +464,7 @@ def get(self, **kwargs: Any) -> _models.ExtendsUnknownAdditionalProperties: "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +583,7 @@ def put( # pylint: disable=inconsistent-return-statements "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +665,7 @@ def get(self, **kwargs: Any) -> _models.ExtendsUnknownAdditionalPropertiesDerive "age": 0.0 # Optional. The age property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -794,7 +794,7 @@ def put( # pylint: disable=inconsistent-return-statements "age": 0.0 # Optional. The age property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -883,7 +883,7 @@ def get(self, **kwargs: Any) -> _models.ExtendsUnknownAdditionalPropertiesDiscri # response body for status code(s): 200 response == extends_unknown_additional_properties_discriminated """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1026,7 +1026,7 @@ def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = extends_unknown_additional_properties_discriminated """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1105,7 +1105,7 @@ def get(self, **kwargs: Any) -> _models.IsUnknownAdditionalProperties: "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1224,7 +1224,7 @@ def put( # pylint: disable=inconsistent-return-statements "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1305,7 +1305,7 @@ def get(self, **kwargs: Any) -> _models.IsUnknownAdditionalPropertiesDerived: "age": 0.0 # Optional. The age property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1432,7 +1432,7 @@ def put( # pylint: disable=inconsistent-return-statements "age": 0.0 # Optional. The age property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1521,7 +1521,7 @@ def get(self, **kwargs: Any) -> _models.IsUnknownAdditionalPropertiesDiscriminat # response body for status code(s): 200 response == is_unknown_additional_properties_discriminated """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1664,7 +1664,7 @@ def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = is_unknown_additional_properties_discriminated """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1743,7 +1743,7 @@ def get(self, **kwargs: Any) -> _models.ExtendsStringAdditionalProperties: "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1862,7 +1862,7 @@ def put( # pylint: disable=inconsistent-return-statements "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1941,7 +1941,7 @@ def get(self, **kwargs: Any) -> _models.IsStringAdditionalProperties: "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2060,7 +2060,7 @@ def put( # pylint: disable=inconsistent-return-statements "name": "str" # The name property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2139,7 +2139,7 @@ def get(self, **kwargs: Any) -> _models.ExtendsFloatAdditionalProperties: "id": 0.0 # The id property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2258,7 +2258,7 @@ def put( # pylint: disable=inconsistent-return-statements "id": 0.0 # The id property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2337,7 +2337,7 @@ def get(self, **kwargs: Any) -> _models.IsFloatAdditionalProperties: "id": 0.0 # The id property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2456,7 +2456,7 @@ def put( # pylint: disable=inconsistent-return-statements "id": 0.0 # The id property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2527,7 +2527,7 @@ def get(self, **kwargs: Any) -> _models.ExtendsModelAdditionalProperties: :rtype: ~typetest.property.additionalproperties.models.ExtendsModelAdditionalProperties :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2642,7 +2642,7 @@ def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2713,7 +2713,7 @@ def get(self, **kwargs: Any) -> _models.IsModelAdditionalProperties: :rtype: ~typetest.property.additionalproperties.models.IsModelAdditionalProperties :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2828,7 +2828,7 @@ def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2899,7 +2899,7 @@ def get(self, **kwargs: Any) -> _models.ExtendsModelArrayAdditionalProperties: :rtype: ~typetest.property.additionalproperties.models.ExtendsModelArrayAdditionalProperties :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3020,7 +3020,7 @@ def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3091,7 +3091,7 @@ def get(self, **kwargs: Any) -> _models.IsModelArrayAdditionalProperties: :rtype: ~typetest.property.additionalproperties.models.IsModelArrayAdditionalProperties :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3206,7 +3206,7 @@ def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-property-nullable/typetest/property/nullable/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-property-nullable/typetest/property/nullable/aio/operations/_operations.py index 32eae668615..dd51637f06e 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-property-nullable/typetest/property/nullable/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-property-nullable/typetest/property/nullable/aio/operations/_operations.py @@ -94,7 +94,7 @@ async def get_non_null(self, **kwargs: Any) -> _models.StringProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -152,7 +152,7 @@ async def get_null(self, **kwargs: Any) -> _models.StringProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -271,7 +271,7 @@ async def patch_non_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -393,7 +393,7 @@ async def patch_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +472,7 @@ async def get_non_null(self, **kwargs: Any) -> _models.BytesProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -530,7 +530,7 @@ async def get_null(self, **kwargs: Any) -> _models.BytesProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -649,7 +649,7 @@ async def patch_non_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -771,7 +771,7 @@ async def patch_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -850,7 +850,7 @@ async def get_non_null(self, **kwargs: Any) -> _models.DatetimeProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -908,7 +908,7 @@ async def get_null(self, **kwargs: Any) -> _models.DatetimeProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1027,7 +1027,7 @@ async def patch_non_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1149,7 +1149,7 @@ async def patch_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1228,7 +1228,7 @@ async def get_non_null(self, **kwargs: Any) -> _models.DurationProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1286,7 +1286,7 @@ async def get_null(self, **kwargs: Any) -> _models.DurationProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1405,7 +1405,7 @@ async def patch_non_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1527,7 +1527,7 @@ async def patch_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1608,7 +1608,7 @@ async def get_non_null(self, **kwargs: Any) -> _models.CollectionsByteProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1668,7 +1668,7 @@ async def get_null(self, **kwargs: Any) -> _models.CollectionsByteProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1795,7 +1795,7 @@ async def patch_non_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1925,7 +1925,7 @@ async def patch_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2009,7 +2009,7 @@ async def get_non_null(self, **kwargs: Any) -> _models.CollectionsModelProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2072,7 +2072,7 @@ async def get_null(self, **kwargs: Any) -> _models.CollectionsModelProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2203,7 +2203,7 @@ async def patch_non_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2337,7 +2337,7 @@ async def patch_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-property-nullable/typetest/property/nullable/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-property-nullable/typetest/property/nullable/operations/_operations.py index 1195fe8f083..87a31b15cc0 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-property-nullable/typetest/property/nullable/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-property-nullable/typetest/property/nullable/operations/_operations.py @@ -408,7 +408,7 @@ def get_non_null(self, **kwargs: Any) -> _models.StringProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -466,7 +466,7 @@ def get_null(self, **kwargs: Any) -> _models.StringProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -585,7 +585,7 @@ def patch_non_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -707,7 +707,7 @@ def patch_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -786,7 +786,7 @@ def get_non_null(self, **kwargs: Any) -> _models.BytesProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -844,7 +844,7 @@ def get_null(self, **kwargs: Any) -> _models.BytesProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -963,7 +963,7 @@ def patch_non_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1085,7 +1085,7 @@ def patch_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1164,7 +1164,7 @@ def get_non_null(self, **kwargs: Any) -> _models.DatetimeProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1222,7 +1222,7 @@ def get_null(self, **kwargs: Any) -> _models.DatetimeProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1341,7 +1341,7 @@ def patch_non_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1463,7 +1463,7 @@ def patch_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1542,7 +1542,7 @@ def get_non_null(self, **kwargs: Any) -> _models.DurationProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1600,7 +1600,7 @@ def get_null(self, **kwargs: Any) -> _models.DurationProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1719,7 +1719,7 @@ def patch_non_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1841,7 +1841,7 @@ def patch_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1922,7 +1922,7 @@ def get_non_null(self, **kwargs: Any) -> _models.CollectionsByteProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1982,7 +1982,7 @@ def get_null(self, **kwargs: Any) -> _models.CollectionsByteProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2109,7 +2109,7 @@ def patch_non_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2239,7 +2239,7 @@ def patch_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2323,7 +2323,7 @@ def get_non_null(self, **kwargs: Any) -> _models.CollectionsModelProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2386,7 +2386,7 @@ def get_null(self, **kwargs: Any) -> _models.CollectionsModelProperty: "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2517,7 +2517,7 @@ def patch_non_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2651,7 +2651,7 @@ def patch_null( # pylint: disable=inconsistent-return-statements "requiredProperty": "str" # Required property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-property-optional/typetest/property/optional/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-property-optional/typetest/property/optional/aio/operations/_operations.py index a242daa86aa..e933c34adb6 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-property-optional/typetest/property/optional/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-property-optional/typetest/property/optional/aio/operations/_operations.py @@ -125,7 +125,7 @@ async def get_all(self, **kwargs: Any) -> _models.StringProperty: "property": "str" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -182,7 +182,7 @@ async def get_default(self, **kwargs: Any) -> _models.StringProperty: "property": "str" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -299,7 +299,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements "property": "str" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -419,7 +419,7 @@ async def put_default( # pylint: disable=inconsistent-return-statements "property": "str" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -497,7 +497,7 @@ async def get_all(self, **kwargs: Any) -> _models.BytesProperty: "property": bytes("bytes", encoding="utf-8") # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -554,7 +554,7 @@ async def get_default(self, **kwargs: Any) -> _models.BytesProperty: "property": bytes("bytes", encoding="utf-8") # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -671,7 +671,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements "property": bytes("bytes", encoding="utf-8") # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -791,7 +791,7 @@ async def put_default( # pylint: disable=inconsistent-return-statements "property": bytes("bytes", encoding="utf-8") # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -869,7 +869,7 @@ async def get_all(self, **kwargs: Any) -> _models.DatetimeProperty: "property": "2020-02-20 00:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -926,7 +926,7 @@ async def get_default(self, **kwargs: Any) -> _models.DatetimeProperty: "property": "2020-02-20 00:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1043,7 +1043,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements "property": "2020-02-20 00:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1163,7 +1163,7 @@ async def put_default( # pylint: disable=inconsistent-return-statements "property": "2020-02-20 00:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1241,7 +1241,7 @@ async def get_all(self, **kwargs: Any) -> _models.DurationProperty: "property": "1 day, 0:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1298,7 +1298,7 @@ async def get_default(self, **kwargs: Any) -> _models.DurationProperty: "property": "1 day, 0:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1415,7 +1415,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements "property": "1 day, 0:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1535,7 +1535,7 @@ async def put_default( # pylint: disable=inconsistent-return-statements "property": "1 day, 0:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1615,7 +1615,7 @@ async def get_all(self, **kwargs: Any) -> _models.CollectionsByteProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1674,7 +1674,7 @@ async def get_default(self, **kwargs: Any) -> _models.CollectionsByteProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1795,7 +1795,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1919,7 +1919,7 @@ async def put_default( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2002,7 +2002,7 @@ async def get_all(self, **kwargs: Any) -> _models.CollectionsModelProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2064,7 +2064,7 @@ async def get_default(self, **kwargs: Any) -> _models.CollectionsModelProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2189,7 +2189,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2317,7 +2317,7 @@ async def put_default( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2395,7 +2395,7 @@ async def get_all(self, **kwargs: Any) -> _models.StringLiteralProperty: "property": "hello" # Optional. Default value is "hello". Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2452,7 +2452,7 @@ async def get_default(self, **kwargs: Any) -> _models.StringLiteralProperty: "property": "hello" # Optional. Default value is "hello". Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2569,7 +2569,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements "property": "hello" # Optional. Default value is "hello". Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2689,7 +2689,7 @@ async def put_default( # pylint: disable=inconsistent-return-statements "property": "hello" # Optional. Default value is "hello". Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2767,7 +2767,7 @@ async def get_all(self, **kwargs: Any) -> _models.IntLiteralProperty: "property": 1 # Optional. Default value is 1. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2824,7 +2824,7 @@ async def get_default(self, **kwargs: Any) -> _models.IntLiteralProperty: "property": 1 # Optional. Default value is 1. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2941,7 +2941,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements "property": 1 # Optional. Default value is 1. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3061,7 +3061,7 @@ async def put_default( # pylint: disable=inconsistent-return-statements "property": 1 # Optional. Default value is 1. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3139,7 +3139,7 @@ async def get_all(self, **kwargs: Any) -> _models.FloatLiteralProperty: "property": 1.25 # Optional. Default value is 1.25. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3196,7 +3196,7 @@ async def get_default(self, **kwargs: Any) -> _models.FloatLiteralProperty: "property": 1.25 # Optional. Default value is 1.25. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3313,7 +3313,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements "property": 1.25 # Optional. Default value is 1.25. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3433,7 +3433,7 @@ async def put_default( # pylint: disable=inconsistent-return-statements "property": 1.25 # Optional. Default value is 1.25. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3511,7 +3511,7 @@ async def get_all(self, **kwargs: Any) -> _models.BooleanLiteralProperty: "property": True # Optional. Default value is True. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3568,7 +3568,7 @@ async def get_default(self, **kwargs: Any) -> _models.BooleanLiteralProperty: "property": True # Optional. Default value is True. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3685,7 +3685,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements "property": True # Optional. Default value is True. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3805,7 +3805,7 @@ async def put_default( # pylint: disable=inconsistent-return-statements "property": True # Optional. Default value is True. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3886,7 +3886,7 @@ async def get_all(self, **kwargs: Any) -> _models.UnionStringLiteralProperty: either a Literal["hello"] type or a Literal["world"] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3946,7 +3946,7 @@ async def get_default(self, **kwargs: Any) -> _models.UnionStringLiteralProperty either a Literal["hello"] type or a Literal["world"] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4068,7 +4068,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements either a Literal["hello"] type or a Literal["world"] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4193,7 +4193,7 @@ async def put_default( # pylint: disable=inconsistent-return-statements either a Literal["hello"] type or a Literal["world"] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4272,7 +4272,7 @@ async def get_all(self, **kwargs: Any) -> _models.UnionIntLiteralProperty: Literal[1] type or a Literal[2] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4330,7 +4330,7 @@ async def get_default(self, **kwargs: Any) -> _models.UnionIntLiteralProperty: Literal[1] type or a Literal[2] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4449,7 +4449,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements Literal[1] type or a Literal[2] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4571,7 +4571,7 @@ async def put_default( # pylint: disable=inconsistent-return-statements Literal[1] type or a Literal[2] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4651,7 +4651,7 @@ async def get_all(self, **kwargs: Any) -> _models.UnionFloatLiteralProperty: float type or a float type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4710,7 +4710,7 @@ async def get_default(self, **kwargs: Any) -> _models.UnionFloatLiteralProperty: float type or a float type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4830,7 +4830,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements float type or a float type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4953,7 +4953,7 @@ async def put_default( # pylint: disable=inconsistent-return-statements float type or a float type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5033,7 +5033,7 @@ async def get_all(self, **kwargs: Any) -> _models.RequiredAndOptionalProperty: "optionalProperty": "str" # Optional. optional string property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5092,7 +5092,7 @@ async def get_required_only(self, **kwargs: Any) -> _models.RequiredAndOptionalP "optionalProperty": "str" # Optional. optional string property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5212,7 +5212,7 @@ async def put_all( # pylint: disable=inconsistent-return-statements "optionalProperty": "str" # Optional. optional string property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5335,7 +5335,7 @@ async def put_required_only( # pylint: disable=inconsistent-return-statements "optionalProperty": "str" # Optional. optional string property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-property-optional/typetest/property/optional/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-property-optional/typetest/property/optional/operations/_operations.py index 1390d8f6057..efd63ec1925 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-property-optional/typetest/property/optional/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-property-optional/typetest/property/optional/operations/_operations.py @@ -859,7 +859,7 @@ def get_all(self, **kwargs: Any) -> _models.StringProperty: "property": "str" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -916,7 +916,7 @@ def get_default(self, **kwargs: Any) -> _models.StringProperty: "property": "str" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1033,7 +1033,7 @@ def put_all( # pylint: disable=inconsistent-return-statements "property": "str" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1153,7 +1153,7 @@ def put_default( # pylint: disable=inconsistent-return-statements "property": "str" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1231,7 +1231,7 @@ def get_all(self, **kwargs: Any) -> _models.BytesProperty: "property": bytes("bytes", encoding="utf-8") # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1288,7 +1288,7 @@ def get_default(self, **kwargs: Any) -> _models.BytesProperty: "property": bytes("bytes", encoding="utf-8") # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1405,7 +1405,7 @@ def put_all( # pylint: disable=inconsistent-return-statements "property": bytes("bytes", encoding="utf-8") # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1525,7 +1525,7 @@ def put_default( # pylint: disable=inconsistent-return-statements "property": bytes("bytes", encoding="utf-8") # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1603,7 +1603,7 @@ def get_all(self, **kwargs: Any) -> _models.DatetimeProperty: "property": "2020-02-20 00:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1660,7 +1660,7 @@ def get_default(self, **kwargs: Any) -> _models.DatetimeProperty: "property": "2020-02-20 00:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1777,7 +1777,7 @@ def put_all( # pylint: disable=inconsistent-return-statements "property": "2020-02-20 00:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1897,7 +1897,7 @@ def put_default( # pylint: disable=inconsistent-return-statements "property": "2020-02-20 00:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1975,7 +1975,7 @@ def get_all(self, **kwargs: Any) -> _models.DurationProperty: "property": "1 day, 0:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2032,7 +2032,7 @@ def get_default(self, **kwargs: Any) -> _models.DurationProperty: "property": "1 day, 0:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2149,7 +2149,7 @@ def put_all( # pylint: disable=inconsistent-return-statements "property": "1 day, 0:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2269,7 +2269,7 @@ def put_default( # pylint: disable=inconsistent-return-statements "property": "1 day, 0:00:00" # Optional. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2349,7 +2349,7 @@ def get_all(self, **kwargs: Any) -> _models.CollectionsByteProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2408,7 +2408,7 @@ def get_default(self, **kwargs: Any) -> _models.CollectionsByteProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2529,7 +2529,7 @@ def put_all( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2653,7 +2653,7 @@ def put_default( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2736,7 +2736,7 @@ def get_all(self, **kwargs: Any) -> _models.CollectionsModelProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2798,7 +2798,7 @@ def get_default(self, **kwargs: Any) -> _models.CollectionsModelProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2923,7 +2923,7 @@ def put_all( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3051,7 +3051,7 @@ def put_default( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3129,7 +3129,7 @@ def get_all(self, **kwargs: Any) -> _models.StringLiteralProperty: "property": "hello" # Optional. Default value is "hello". Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3186,7 +3186,7 @@ def get_default(self, **kwargs: Any) -> _models.StringLiteralProperty: "property": "hello" # Optional. Default value is "hello". Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3303,7 +3303,7 @@ def put_all( # pylint: disable=inconsistent-return-statements "property": "hello" # Optional. Default value is "hello". Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3423,7 +3423,7 @@ def put_default( # pylint: disable=inconsistent-return-statements "property": "hello" # Optional. Default value is "hello". Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3501,7 +3501,7 @@ def get_all(self, **kwargs: Any) -> _models.IntLiteralProperty: "property": 1 # Optional. Default value is 1. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3558,7 +3558,7 @@ def get_default(self, **kwargs: Any) -> _models.IntLiteralProperty: "property": 1 # Optional. Default value is 1. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3675,7 +3675,7 @@ def put_all( # pylint: disable=inconsistent-return-statements "property": 1 # Optional. Default value is 1. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3795,7 +3795,7 @@ def put_default( # pylint: disable=inconsistent-return-statements "property": 1 # Optional. Default value is 1. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3873,7 +3873,7 @@ def get_all(self, **kwargs: Any) -> _models.FloatLiteralProperty: "property": 1.25 # Optional. Default value is 1.25. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3930,7 +3930,7 @@ def get_default(self, **kwargs: Any) -> _models.FloatLiteralProperty: "property": 1.25 # Optional. Default value is 1.25. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4047,7 +4047,7 @@ def put_all( # pylint: disable=inconsistent-return-statements "property": 1.25 # Optional. Default value is 1.25. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4167,7 +4167,7 @@ def put_default( # pylint: disable=inconsistent-return-statements "property": 1.25 # Optional. Default value is 1.25. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4245,7 +4245,7 @@ def get_all(self, **kwargs: Any) -> _models.BooleanLiteralProperty: "property": True # Optional. Default value is True. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4302,7 +4302,7 @@ def get_default(self, **kwargs: Any) -> _models.BooleanLiteralProperty: "property": True # Optional. Default value is True. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4419,7 +4419,7 @@ def put_all( # pylint: disable=inconsistent-return-statements "property": True # Optional. Default value is True. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4539,7 +4539,7 @@ def put_default( # pylint: disable=inconsistent-return-statements "property": True # Optional. Default value is True. Property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4620,7 +4620,7 @@ def get_all(self, **kwargs: Any) -> _models.UnionStringLiteralProperty: either a Literal["hello"] type or a Literal["world"] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4680,7 +4680,7 @@ def get_default(self, **kwargs: Any) -> _models.UnionStringLiteralProperty: either a Literal["hello"] type or a Literal["world"] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4802,7 +4802,7 @@ def put_all( # pylint: disable=inconsistent-return-statements either a Literal["hello"] type or a Literal["world"] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4927,7 +4927,7 @@ def put_default( # pylint: disable=inconsistent-return-statements either a Literal["hello"] type or a Literal["world"] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5006,7 +5006,7 @@ def get_all(self, **kwargs: Any) -> _models.UnionIntLiteralProperty: Literal[1] type or a Literal[2] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5064,7 +5064,7 @@ def get_default(self, **kwargs: Any) -> _models.UnionIntLiteralProperty: Literal[1] type or a Literal[2] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5183,7 +5183,7 @@ def put_all( # pylint: disable=inconsistent-return-statements Literal[1] type or a Literal[2] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5305,7 +5305,7 @@ def put_default( # pylint: disable=inconsistent-return-statements Literal[1] type or a Literal[2] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5385,7 +5385,7 @@ def get_all(self, **kwargs: Any) -> _models.UnionFloatLiteralProperty: float type or a float type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5444,7 +5444,7 @@ def get_default(self, **kwargs: Any) -> _models.UnionFloatLiteralProperty: float type or a float type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5564,7 +5564,7 @@ def put_all( # pylint: disable=inconsistent-return-statements float type or a float type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5687,7 +5687,7 @@ def put_default( # pylint: disable=inconsistent-return-statements float type or a float type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5767,7 +5767,7 @@ def get_all(self, **kwargs: Any) -> _models.RequiredAndOptionalProperty: "optionalProperty": "str" # Optional. optional string property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5826,7 +5826,7 @@ def get_required_only(self, **kwargs: Any) -> _models.RequiredAndOptionalPropert "optionalProperty": "str" # Optional. optional string property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5946,7 +5946,7 @@ def put_all( # pylint: disable=inconsistent-return-statements "optionalProperty": "str" # Optional. optional string property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6069,7 +6069,7 @@ def put_required_only( # pylint: disable=inconsistent-return-statements "optionalProperty": "str" # Optional. optional string property. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-property-valuetypes/typetest/property/valuetypes/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-property-valuetypes/typetest/property/valuetypes/aio/operations/_operations.py index 2194022f6bc..ed4344e7da0 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-property-valuetypes/typetest/property/valuetypes/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-property-valuetypes/typetest/property/valuetypes/aio/operations/_operations.py @@ -127,7 +127,7 @@ async def get(self, **kwargs: Any) -> _models.BooleanProperty: "property": bool # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -244,7 +244,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": bool # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +322,7 @@ async def get(self, **kwargs: Any) -> _models.StringProperty: "property": "str" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -439,7 +439,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": "str" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -517,7 +517,7 @@ async def get(self, **kwargs: Any) -> _models.BytesProperty: "property": bytes("bytes", encoding="utf-8") # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -634,7 +634,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": bytes("bytes", encoding="utf-8") # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -712,7 +712,7 @@ async def get(self, **kwargs: Any) -> _models.IntProperty: "property": 0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -829,7 +829,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": 0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -907,7 +907,7 @@ async def get(self, **kwargs: Any) -> _models.FloatProperty: "property": 0.0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1024,7 +1024,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": 0.0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1102,7 +1102,7 @@ async def get(self, **kwargs: Any) -> _models.DecimalProperty: "property": 0.0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1219,7 +1219,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": 0.0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1297,7 +1297,7 @@ async def get(self, **kwargs: Any) -> _models.Decimal128Property: "property": 0.0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1414,7 +1414,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": 0.0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1492,7 +1492,7 @@ async def get(self, **kwargs: Any) -> _models.DatetimeProperty: "property": "2020-02-20 00:00:00" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1609,7 +1609,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": "2020-02-20 00:00:00" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1687,7 +1687,7 @@ async def get(self, **kwargs: Any) -> _models.DurationProperty: "property": "1 day, 0:00:00" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1804,7 +1804,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": "1 day, 0:00:00" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1883,7 +1883,7 @@ async def get(self, **kwargs: Any) -> _models.EnumProperty: "ValueTwo". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2002,7 +2002,7 @@ async def put( # pylint: disable=inconsistent-return-statements "ValueTwo". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2081,7 +2081,7 @@ async def get(self, **kwargs: Any) -> _models.ExtensibleEnumProperty: "ValueTwo". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2201,7 +2201,7 @@ async def put( # pylint: disable=inconsistent-return-statements "ValueTwo". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2281,7 +2281,7 @@ async def get(self, **kwargs: Any) -> _models.ModelProperty: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2402,7 +2402,7 @@ async def put( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2483,7 +2483,7 @@ async def get(self, **kwargs: Any) -> _models.CollectionsStringProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2605,7 +2605,7 @@ async def put( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2685,7 +2685,7 @@ async def get(self, **kwargs: Any) -> _models.CollectionsIntProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2807,7 +2807,7 @@ async def put( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2890,7 +2890,7 @@ async def get(self, **kwargs: Any) -> _models.CollectionsModelProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3016,7 +3016,7 @@ async def put( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3097,7 +3097,7 @@ async def get(self, **kwargs: Any) -> _models.DictionaryStringProperty: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3219,7 +3219,7 @@ async def put( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3289,7 +3289,7 @@ async def get(self, **kwargs: Any) -> _models.NeverProperty: :rtype: ~typetest.property.valuetypes.models.NeverProperty :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3402,7 +3402,7 @@ async def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3480,7 +3480,7 @@ async def get(self, **kwargs: Any) -> _models.UnknownStringProperty: "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3598,7 +3598,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3676,7 +3676,7 @@ async def get(self, **kwargs: Any) -> _models.UnknownIntProperty: "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3793,7 +3793,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3871,7 +3871,7 @@ async def get(self, **kwargs: Any) -> _models.UnknownDictProperty: "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3989,7 +3989,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4067,7 +4067,7 @@ async def get(self, **kwargs: Any) -> _models.UnknownArrayProperty: "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4185,7 +4185,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4263,7 +4263,7 @@ async def get(self, **kwargs: Any) -> _models.StringLiteralProperty: "property": "hello" # Default value is "hello". Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4381,7 +4381,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": "hello" # Default value is "hello". Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4459,7 +4459,7 @@ async def get(self, **kwargs: Any) -> _models.IntLiteralProperty: "property": 42 # Default value is 42. Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4576,7 +4576,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": 42 # Default value is 42. Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4654,7 +4654,7 @@ async def get(self, **kwargs: Any) -> _models.FloatLiteralProperty: "property": 43.125 # Default value is 43.125. Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4772,7 +4772,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": 43.125 # Default value is 43.125. Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4850,7 +4850,7 @@ async def get(self, **kwargs: Any) -> _models.BooleanLiteralProperty: "property": True # Default value is True. Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4968,7 +4968,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": True # Default value is True. Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5049,7 +5049,7 @@ async def get(self, **kwargs: Any) -> _models.UnionStringLiteralProperty: either a Literal["hello"] type or a Literal["world"] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5172,7 +5172,7 @@ async def put( # pylint: disable=inconsistent-return-statements either a Literal["hello"] type or a Literal["world"] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5251,7 +5251,7 @@ async def get(self, **kwargs: Any) -> _models.UnionIntLiteralProperty: Literal[42] type or a Literal[43] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5371,7 +5371,7 @@ async def put( # pylint: disable=inconsistent-return-statements Literal[42] type or a Literal[43] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5451,7 +5451,7 @@ async def get(self, **kwargs: Any) -> _models.UnionFloatLiteralProperty: a float type or a float type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5571,7 +5571,7 @@ async def put( # pylint: disable=inconsistent-return-statements a float type or a float type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5649,7 +5649,7 @@ async def get(self, **kwargs: Any) -> _models.UnionEnumValueProperty: "property": "str" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5767,7 +5767,7 @@ async def put( # pylint: disable=inconsistent-return-statements "property": "str" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-property-valuetypes/typetest/property/valuetypes/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-property-valuetypes/typetest/property/valuetypes/operations/_operations.py index 7c46c28a928..918ef65c754 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-property-valuetypes/typetest/property/valuetypes/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-property-valuetypes/typetest/property/valuetypes/operations/_operations.py @@ -883,7 +883,7 @@ def get(self, **kwargs: Any) -> _models.BooleanProperty: "property": bool # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1000,7 +1000,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": bool # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1078,7 +1078,7 @@ def get(self, **kwargs: Any) -> _models.StringProperty: "property": "str" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1195,7 +1195,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": "str" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1273,7 +1273,7 @@ def get(self, **kwargs: Any) -> _models.BytesProperty: "property": bytes("bytes", encoding="utf-8") # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1390,7 +1390,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": bytes("bytes", encoding="utf-8") # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1468,7 +1468,7 @@ def get(self, **kwargs: Any) -> _models.IntProperty: "property": 0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1585,7 +1585,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": 0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1663,7 +1663,7 @@ def get(self, **kwargs: Any) -> _models.FloatProperty: "property": 0.0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1780,7 +1780,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": 0.0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1858,7 +1858,7 @@ def get(self, **kwargs: Any) -> _models.DecimalProperty: "property": 0.0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1975,7 +1975,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": 0.0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2053,7 +2053,7 @@ def get(self, **kwargs: Any) -> _models.Decimal128Property: "property": 0.0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2170,7 +2170,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": 0.0 # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2248,7 +2248,7 @@ def get(self, **kwargs: Any) -> _models.DatetimeProperty: "property": "2020-02-20 00:00:00" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2365,7 +2365,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": "2020-02-20 00:00:00" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2443,7 +2443,7 @@ def get(self, **kwargs: Any) -> _models.DurationProperty: "property": "1 day, 0:00:00" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2560,7 +2560,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": "1 day, 0:00:00" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2639,7 +2639,7 @@ def get(self, **kwargs: Any) -> _models.EnumProperty: "ValueTwo". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2758,7 +2758,7 @@ def put( # pylint: disable=inconsistent-return-statements "ValueTwo". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2837,7 +2837,7 @@ def get(self, **kwargs: Any) -> _models.ExtensibleEnumProperty: "ValueTwo". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2957,7 +2957,7 @@ def put( # pylint: disable=inconsistent-return-statements "ValueTwo". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3037,7 +3037,7 @@ def get(self, **kwargs: Any) -> _models.ModelProperty: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3158,7 +3158,7 @@ def put( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3239,7 +3239,7 @@ def get(self, **kwargs: Any) -> _models.CollectionsStringProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3361,7 +3361,7 @@ def put( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3441,7 +3441,7 @@ def get(self, **kwargs: Any) -> _models.CollectionsIntProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3563,7 +3563,7 @@ def put( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3646,7 +3646,7 @@ def get(self, **kwargs: Any) -> _models.CollectionsModelProperty: ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3772,7 +3772,7 @@ def put( # pylint: disable=inconsistent-return-statements ] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3853,7 +3853,7 @@ def get(self, **kwargs: Any) -> _models.DictionaryStringProperty: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3975,7 +3975,7 @@ def put( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4045,7 +4045,7 @@ def get(self, **kwargs: Any) -> _models.NeverProperty: :rtype: ~typetest.property.valuetypes.models.NeverProperty :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4158,7 +4158,7 @@ def put( # pylint: disable=inconsistent-return-statements # JSON input template you can fill out and use as your body input. body = {} """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4236,7 +4236,7 @@ def get(self, **kwargs: Any) -> _models.UnknownStringProperty: "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4354,7 +4354,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4432,7 +4432,7 @@ def get(self, **kwargs: Any) -> _models.UnknownIntProperty: "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4549,7 +4549,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4627,7 +4627,7 @@ def get(self, **kwargs: Any) -> _models.UnknownDictProperty: "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4745,7 +4745,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4823,7 +4823,7 @@ def get(self, **kwargs: Any) -> _models.UnknownArrayProperty: "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4941,7 +4941,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": {} # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5019,7 +5019,7 @@ def get(self, **kwargs: Any) -> _models.StringLiteralProperty: "property": "hello" # Default value is "hello". Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5137,7 +5137,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": "hello" # Default value is "hello". Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5215,7 +5215,7 @@ def get(self, **kwargs: Any) -> _models.IntLiteralProperty: "property": 42 # Default value is 42. Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5332,7 +5332,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": 42 # Default value is 42. Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5410,7 +5410,7 @@ def get(self, **kwargs: Any) -> _models.FloatLiteralProperty: "property": 43.125 # Default value is 43.125. Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5528,7 +5528,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": 43.125 # Default value is 43.125. Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5606,7 +5606,7 @@ def get(self, **kwargs: Any) -> _models.BooleanLiteralProperty: "property": True # Default value is True. Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5724,7 +5724,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": True # Default value is True. Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5805,7 +5805,7 @@ def get(self, **kwargs: Any) -> _models.UnionStringLiteralProperty: either a Literal["hello"] type or a Literal["world"] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -5928,7 +5928,7 @@ def put( # pylint: disable=inconsistent-return-statements either a Literal["hello"] type or a Literal["world"] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6007,7 +6007,7 @@ def get(self, **kwargs: Any) -> _models.UnionIntLiteralProperty: Literal[42] type or a Literal[43] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6127,7 +6127,7 @@ def put( # pylint: disable=inconsistent-return-statements Literal[42] type or a Literal[43] type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6207,7 +6207,7 @@ def get(self, **kwargs: Any) -> _models.UnionFloatLiteralProperty: a float type or a float type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6327,7 +6327,7 @@ def put( # pylint: disable=inconsistent-return-statements a float type or a float type. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6405,7 +6405,7 @@ def get(self, **kwargs: Any) -> _models.UnionEnumValueProperty: "property": "str" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -6523,7 +6523,7 @@ def put( # pylint: disable=inconsistent-return-statements "property": "str" # Property. Required. } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-scalar/typetest/scalar/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-scalar/typetest/scalar/aio/operations/_operations.py index 1e9336c17d5..b16a4f7086c 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-scalar/typetest/scalar/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-scalar/typetest/scalar/aio/operations/_operations.py @@ -9,7 +9,7 @@ import decimal import json import sys -from typing import Any, Callable, Dict, List, Optional, Type, TypeVar +from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -75,7 +75,7 @@ async def get(self, **kwargs: Any) -> str: :rtype: str :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -126,7 +126,7 @@ async def put(self, body: str, **kwargs: Any) -> None: # pylint: disable=incons :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -191,7 +191,7 @@ async def get(self, **kwargs: Any) -> bool: :rtype: bool :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -242,7 +242,7 @@ async def put(self, body: bool, **kwargs: Any) -> None: # pylint: disable=incon :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -307,7 +307,7 @@ async def get(self, **kwargs: Any) -> Any: :rtype: any :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -358,7 +358,7 @@ async def put(self, body: Any, **kwargs: Any) -> None: # pylint: disable=incons :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -423,7 +423,7 @@ async def response_body(self, **kwargs: Any) -> decimal.Decimal: :rtype: ~decimal.Decimal :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -476,7 +476,7 @@ async def request_body( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -527,7 +527,7 @@ async def request_parameter( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +588,7 @@ async def response_body(self, **kwargs: Any) -> decimal.Decimal: :rtype: ~decimal.Decimal :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -641,7 +641,7 @@ async def request_body( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -692,7 +692,7 @@ async def request_parameter( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -761,7 +761,7 @@ async def prepare_verify(self, **kwargs: Any) -> List[decimal.Decimal]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -814,7 +814,7 @@ async def verify( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -887,7 +887,7 @@ async def prepare_verify(self, **kwargs: Any) -> List[decimal.Decimal]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -940,7 +940,7 @@ async def verify( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-scalar/typetest/scalar/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-scalar/typetest/scalar/operations/_operations.py index d3d84bf60c7..7fabeb6bfcc 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-scalar/typetest/scalar/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-scalar/typetest/scalar/operations/_operations.py @@ -9,7 +9,7 @@ import decimal import json import sys -from typing import Any, Callable, Dict, List, Optional, Type, TypeVar +from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, Union from corehttp.exceptions import ( ClientAuthenticationError, @@ -278,7 +278,7 @@ def get(self, **kwargs: Any) -> str: :rtype: str :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -329,7 +329,7 @@ def put(self, body: str, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -394,7 +394,7 @@ def get(self, **kwargs: Any) -> bool: :rtype: bool :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -445,7 +445,7 @@ def put(self, body: bool, **kwargs: Any) -> None: # pylint: disable=inconsisten :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -510,7 +510,7 @@ def get(self, **kwargs: Any) -> Any: :rtype: any :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -561,7 +561,7 @@ def put(self, body: Any, **kwargs: Any) -> None: # pylint: disable=inconsistent :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -626,7 +626,7 @@ def response_body(self, **kwargs: Any) -> decimal.Decimal: :rtype: ~decimal.Decimal :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -679,7 +679,7 @@ def request_body( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -730,7 +730,7 @@ def request_parameter( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -791,7 +791,7 @@ def response_body(self, **kwargs: Any) -> decimal.Decimal: :rtype: ~decimal.Decimal :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -844,7 +844,7 @@ def request_body( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -895,7 +895,7 @@ def request_parameter( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -964,7 +964,7 @@ def prepare_verify(self, **kwargs: Any) -> List[decimal.Decimal]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1015,7 +1015,7 @@ def verify(self, body: decimal.Decimal, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1088,7 +1088,7 @@ def prepare_verify(self, **kwargs: Any) -> List[decimal.Decimal]: 0.0 # Optional. ] """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1139,7 +1139,7 @@ def verify(self, body: decimal.Decimal, **kwargs: Any) -> None: # pylint: disab :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/aio/operations/_operations.py index 00402ce178c..8808a4da80d 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/aio/operations/_operations.py @@ -92,7 +92,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse9: Literal["a"], Literal["b"], Literal["c"] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -217,7 +217,7 @@ async def send( # pylint: disable=inconsistent-return-statements Literal["a"], Literal["b"], Literal["c"] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -301,7 +301,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse8: Literal["b"], Literal["c"], str } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -426,7 +426,7 @@ async def send( # pylint: disable=inconsistent-return-statements Literal["b"], Literal["c"], str } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -509,7 +509,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse7: "prop": "str" # Required. Known values are: "b" and "c". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -636,7 +636,7 @@ async def send( # pylint: disable=inconsistent-return-statements "prop": "str" # Required. Known values are: "b" and "c". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -720,7 +720,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse6: Literal[1], Literal[2], Literal[3] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -841,7 +841,7 @@ async def send( # pylint: disable=inconsistent-return-statements Literal[1], Literal[2], Literal[3] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -925,7 +925,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse5: float, float, float } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1046,7 +1046,7 @@ async def send( # pylint: disable=inconsistent-return-statements float, float, float } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1131,7 +1131,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse4: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1254,7 +1254,7 @@ async def send( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1345,7 +1345,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse3: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1480,7 +1480,7 @@ async def send( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1569,7 +1569,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse2: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1700,7 +1700,7 @@ async def send( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1797,7 +1797,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse1: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1944,7 +1944,7 @@ async def send( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2040,7 +2040,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2185,7 +2185,7 @@ async def send( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/operations/_operations.py index e9974ef407f..9e1e0464f38 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/operations/_operations.py @@ -354,7 +354,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse9: Literal["a"], Literal["b"], Literal["c"] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -479,7 +479,7 @@ def send( # pylint: disable=inconsistent-return-statements Literal["a"], Literal["b"], Literal["c"] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -563,7 +563,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse8: Literal["b"], Literal["c"], str } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -688,7 +688,7 @@ def send( # pylint: disable=inconsistent-return-statements Literal["b"], Literal["c"], str } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -771,7 +771,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse7: "prop": "str" # Required. Known values are: "b" and "c". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -898,7 +898,7 @@ def send( # pylint: disable=inconsistent-return-statements "prop": "str" # Required. Known values are: "b" and "c". } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -982,7 +982,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse6: Literal[1], Literal[2], Literal[3] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1103,7 +1103,7 @@ def send( # pylint: disable=inconsistent-return-statements Literal[1], Literal[2], Literal[3] } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1187,7 +1187,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse5: float, float, float } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1308,7 +1308,7 @@ def send( # pylint: disable=inconsistent-return-statements float, float, float } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1393,7 +1393,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse4: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1516,7 +1516,7 @@ def send( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1607,7 +1607,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse3: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1742,7 +1742,7 @@ def send( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1831,7 +1831,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse2: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1962,7 +1962,7 @@ def send( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2059,7 +2059,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse1: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2206,7 +2206,7 @@ def send( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2302,7 +2302,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse: } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2447,7 +2447,7 @@ def send( # pylint: disable=inconsistent-return-statements } } """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping[int, Union[Type[HttpResponseError], Callable]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError,