diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/subscriptions_operations.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/subscriptions_operations.py index e48f00643a03..f9499b67ee98 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/subscriptions_operations.py +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/subscriptions_operations.py @@ -38,15 +38,13 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def list_locations( - self, subscription_id, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Gets all available geo-locations. This operation provides all the locations that are available for resource providers; however, each resource provider may support a subset of this list. - :param subscription_id: The ID of the target subscription. - :type subscription_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -63,7 +61,7 @@ def internal_paging(next_link=None, raw=False): # Construct URL url = self.list_locations.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -109,11 +107,9 @@ def internal_paging(next_link=None, raw=False): list_locations.metadata = {'url': '/subscriptions/{subscriptionId}/locations'} def get( - self, subscription_id, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Gets details about a specified subscription. - :param subscription_id: The ID of the target subscription. - :type subscription_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -128,7 +124,7 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) diff --git a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/subscription_client.py b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/subscription_client.py index 9c69fc7862e4..a7d985b17c27 100644 --- a/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/subscription_client.py +++ b/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/subscription_client.py @@ -26,14 +26,18 @@ class SubscriptionClientConfiguration(AzureConfiguration): :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str :param str base_url: Service URL """ def __init__( - self, credentials, base_url=None): + self, credentials, subscription_id, base_url=None): if credentials is None: raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") if not base_url: base_url = 'https://management.azure.com' @@ -43,6 +47,7 @@ def __init__( self.add_user_agent('Azure-SDK-For-Python') self.credentials = credentials + self.subscription_id = subscription_id class SubscriptionClient(object): @@ -59,13 +64,15 @@ class SubscriptionClient(object): :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str :param str base_url: Service URL """ def __init__( - self, credentials, base_url=None): + self, credentials, subscription_id, base_url=None): - self.config = SubscriptionClientConfiguration(credentials, base_url) + self.config = SubscriptionClientConfiguration(credentials, subscription_id, base_url) self._client = ServiceClient(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}