|
3 | 3 | # Licensed under the MIT License. See License.txt in the project root for |
4 | 4 | # license information. |
5 | 5 | # -------------------------------------------------------------------------- |
6 | | -from typing import List |
| 6 | +from typing import List, cast |
7 | 7 |
|
8 | 8 | from . import utils |
9 | | -from ..models import Client, ParameterMethodLocation |
| 9 | +from ..models import Client, ParameterMethodLocation, Parameter |
10 | 10 | from .parameter_serializer import ParameterSerializer, PopKwargType |
11 | 11 | from ...utils import build_policies |
12 | 12 |
|
@@ -82,12 +82,13 @@ def initialize_config(self) -> List[str]: |
82 | 82 | additional_signatures = [] |
83 | 83 | if self.client.need_cloud_setting: |
84 | 84 | additional_signatures.append("credential_scopes=credential_scopes") |
| 85 | + endpoint_parameter = cast(Parameter, self.client.endpoint_parameter) |
85 | 86 | retval.extend( |
86 | 87 | [ |
87 | 88 | '_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore', |
88 | 89 | "_endpoints = get_arm_endpoints(_cloud)", |
89 | | - "if not base_url:", |
90 | | - ' base_url = _endpoints["resource_manager"]', |
| 90 | + f"if not {endpoint_parameter.client_name}:", |
| 91 | + f' {endpoint_parameter.client_name} = _endpoints["resource_manager"]', |
91 | 92 | 'credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])', |
92 | 93 | ] |
93 | 94 | ) |
|
0 commit comments