From c951cb8bfa900149c35ff63785cef2cb87d3b34e Mon Sep 17 00:00:00 2001 From: annatisch Date: Mon, 9 May 2016 17:26:47 -0700 Subject: [PATCH] regenerated python tests --- .../autorestdurationtestservice/__init__.py | 7 +-- .../auto_rest_duration_test_service.py | 27 +++++++++-- .../__init__.py | 7 +-- ...to_rest_parameter_grouping_test_service.py | 27 +++++++++-- .../autorestreportserviceforazure/__init__.py | 7 +-- .../auto_rest_report_service_for_azure.py | 27 +++++++++-- .../__init__.py | 7 +-- ...o_rest_resource_flattening_test_service.py | 29 +++++++++--- .../__init__.py | 7 +-- ...st_azure_special_parameters_test_client.py | 33 +++++++++++-- .../__init__.py | 7 +-- ...uto_rest_parameterized_host_test_client.py | 29 ++++++++++-- .../Head/autorestheadtestservice/__init__.py | 7 +-- .../auto_rest_head_test_service.py | 27 +++++++++-- .../__init__.py | 7 +-- .../auto_rest_head_exception_test_service.py | 27 +++++++++-- .../__init__.py | 7 +-- ...est_long_running_operation_test_service.py | 27 +++++++++-- .../lr_os_custom_header_operations.py | 8 ++-- .../operations/lr_os_operations.py | 46 +++++++++---------- .../operations/lro_retrys_operations.py | 8 ++-- .../operations/lrosa_ds_operations.py | 36 +++++++-------- .../autorestpagingtestservice/__init__.py | 7 +-- .../auto_rest_paging_test_service.py | 27 +++++++++-- .../storagemanagementclient/__init__.py | 7 +-- .../operations/storage_accounts_operations.py | 8 ++-- .../storage_management_client.py | 33 +++++++++++-- .../microsoftazuretesturl/__init__.py | 7 +-- .../microsoft_azure_test_url.py | 31 +++++++++++-- .../__init__.py | 7 +-- .../auto_rest_swagger_bat_array_service.py | 14 ++++-- .../autorestbooltestservice/__init__.py | 7 +-- .../auto_rest_bool_test_service.py | 14 ++++-- .../autorestswaggerbatbyteservice/__init__.py | 7 +-- .../auto_rest_swagger_bat_byte_service.py | 14 ++++-- .../autorestcomplextestservice/__init__.py | 7 +-- .../auto_rest_complex_test_service.py | 16 +++++-- .../operations/array.py | 4 +- .../operations/basic_operations.py | 2 +- .../operations/dictionary.py | 4 +- .../operations/inheritance.py | 2 +- .../operations/polymorphicrecursive.py | 2 +- .../operations/polymorphism.py | 4 +- .../operations/primitive.py | 22 ++++----- .../operations/readonlyproperty.py | 2 +- .../autorestdatetestservice/__init__.py | 7 +-- .../auto_rest_date_test_service.py | 14 ++++-- .../autorestdatetimetestservice/__init__.py | 7 +-- .../auto_rest_date_time_test_service.py | 14 ++++-- .../__init__.py | 7 +-- ...uto_rest_rfc1123_date_time_test_service.py | 14 ++++-- .../__init__.py | 7 +-- ...uto_rest_swagger_ba_tdictionary_service.py | 14 ++++-- .../autorestdurationtestservice/__init__.py | 7 +-- .../auto_rest_duration_test_service.py | 14 ++++-- .../autorestswaggerbatfileservice/__init__.py | 7 +-- .../auto_rest_swagger_bat_file_service.py | 14 ++++-- .../__init__.py | 7 +-- ...auto_rest_swagger_bat_form_data_service.py | 14 ++++-- .../autorestintegertestservice/__init__.py | 7 +-- .../auto_rest_integer_test_service.py | 14 ++++-- .../operations/int_model.py | 16 +++---- .../autorestnumbertestservice/__init__.py | 7 +-- .../auto_rest_number_test_service.py | 14 ++++-- .../autorestswaggerbatservice/__init__.py | 7 +-- .../auto_rest_swagger_bat_service.py | 14 ++++-- .../__init__.py | 7 +-- ...uto_rest_parameterized_host_test_client.py | 16 +++++-- .../__init__.py | 7 +-- ...t_parameterized_custom_host_test_client.py | 18 ++++++-- .../__init__.py | 7 +-- .../auto_rest_swagger_bat_header_service.py | 14 ++++-- .../__init__.py | 7 +-- ...o_rest_http_infrastructure_test_service.py | 14 ++++-- .../__init__.py | 7 +-- ...o_rest_resource_flattening_test_service.py | 22 +++++---- .../autorestparameterflattening/__init__.py | 7 +-- .../auto_rest_parameter_flattening.py | 14 ++++-- .../operations/availability_sets.py | 2 +- .../Report/autorestreportservice/__init__.py | 7 +-- .../auto_rest_report_service.py | 14 ++++-- .../__init__.py | 7 +-- ...uto_rest_required_optional_test_service.py | 20 ++++++-- .../operations/explicit.py | 20 ++++---- .../Url/autoresturltestservice/__init__.py | 7 +-- .../auto_rest_url_test_service.py | 19 ++++++-- .../operations/paths.py | 4 +- .../autorestvalidationtest/__init__.py | 7 +-- .../auto_rest_validation_test.py | 22 ++++++--- .../storagemanagementclient/__init__.py | 7 +-- .../operations/storage_accounts_operations.py | 8 ++-- .../storage_management_client.py | 33 +++++++++++-- .../Python/swaggerpetstore/__init__.py | 7 +-- .../swaggerpetstore/swagger_petstore.py | 24 ++++++---- 94 files changed, 745 insertions(+), 491 deletions(-) diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureBodyDuration/autorestdurationtestservice/__init__.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureBodyDuration/autorestdurationtestservice/__init__.py index 2b089964f917f..4ec26f57486df 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureBodyDuration/autorestdurationtestservice/__init__.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureBodyDuration/autorestdurationtestservice/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_duration_test_service import AutoRestDurationTestService, AutoRestDurationTestServiceConfiguration +from .auto_rest_duration_test_service import AutoRestDurationTestService from .version import VERSION -__all__ = [ - 'AutoRestDurationTestService', - 'AutoRestDurationTestServiceConfiguration' -] +__all__ = ['AutoRestDurationTestService'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureBodyDuration/autorestdurationtestservice/auto_rest_duration_test_service.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureBodyDuration/autorestdurationtestservice/auto_rest_duration_test_service.py index 668b135381e1f..532c33c57375b 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureBodyDuration/autorestdurationtestservice/auto_rest_duration_test_service.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureBodyDuration/autorestdurationtestservice/auto_rest_duration_test_service.py @@ -63,21 +63,38 @@ def __init__( class AutoRestDurationTestService(object): """Test Infrastructure for AutoRest - :param config: Configuration for client. - :type config: AutoRestDurationTestServiceConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestDurationTestServiceConfiguration :ivar duration: Duration operations :vartype duration: .operations.DurationOperations + + :param credentials: Gets Azure subscription credentials. + :type credentials: :mod:`A msrestazure Credentials + object` + :param accept_language: Gets or sets the preferred language for the + response. + :type accept_language: str + :param long_running_operation_retry_timeout: Gets or sets the retry + timeout in seconds for Long Running Operations. Default value is 30. + :type long_running_operation_retry_timeout: int + :param generate_client_request_id: When set to true a unique + x-ms-client-request-id value is generated and included in each request. + Default is true. + :type generate_client_request_id: bool + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, credentials, accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, base_url=None, filepath=None): - self._client = ServiceClient(config.credentials, config) + self.config = AutoRestDurationTestServiceConfiguration(credentials, accept_language, long_running_operation_retry_timeout, generate_client_request_id, base_url, filepath) + self._client = ServiceClient(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.duration = DurationOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/__init__.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/__init__.py index 3ebb42c766ef0..375abf70c5f95 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/__init__.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_parameter_grouping_test_service import AutoRestParameterGroupingTestService, AutoRestParameterGroupingTestServiceConfiguration +from .auto_rest_parameter_grouping_test_service import AutoRestParameterGroupingTestService from .version import VERSION -__all__ = [ - 'AutoRestParameterGroupingTestService', - 'AutoRestParameterGroupingTestServiceConfiguration' -] +__all__ = ['AutoRestParameterGroupingTestService'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/auto_rest_parameter_grouping_test_service.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/auto_rest_parameter_grouping_test_service.py index 13e63f9569c81..15004842908ec 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/auto_rest_parameter_grouping_test_service.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/auto_rest_parameter_grouping_test_service.py @@ -63,21 +63,38 @@ def __init__( class AutoRestParameterGroupingTestService(object): """Test Infrastructure for AutoRest - :param config: Configuration for client. - :type config: AutoRestParameterGroupingTestServiceConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestParameterGroupingTestServiceConfiguration :ivar parameter_grouping: ParameterGrouping operations :vartype parameter_grouping: .operations.ParameterGroupingOperations + + :param credentials: Gets Azure subscription credentials. + :type credentials: :mod:`A msrestazure Credentials + object` + :param accept_language: Gets or sets the preferred language for the + response. + :type accept_language: str + :param long_running_operation_retry_timeout: Gets or sets the retry + timeout in seconds for Long Running Operations. Default value is 30. + :type long_running_operation_retry_timeout: int + :param generate_client_request_id: When set to true a unique + x-ms-client-request-id value is generated and included in each request. + Default is true. + :type generate_client_request_id: bool + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, credentials, accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, base_url=None, filepath=None): - self._client = ServiceClient(config.credentials, config) + self.config = AutoRestParameterGroupingTestServiceConfiguration(credentials, accept_language, long_running_operation_retry_timeout, generate_client_request_id, base_url, filepath) + self._client = ServiceClient(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.parameter_grouping = ParameterGroupingOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureReport/autorestreportserviceforazure/__init__.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureReport/autorestreportserviceforazure/__init__.py index 3b5e0464d00a4..c038eb8a5dcb4 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureReport/autorestreportserviceforazure/__init__.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureReport/autorestreportserviceforazure/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_report_service_for_azure import AutoRestReportServiceForAzure, AutoRestReportServiceForAzureConfiguration +from .auto_rest_report_service_for_azure import AutoRestReportServiceForAzure from .version import VERSION -__all__ = [ - 'AutoRestReportServiceForAzure', - 'AutoRestReportServiceForAzureConfiguration' -] +__all__ = ['AutoRestReportServiceForAzure'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureReport/autorestreportserviceforazure/auto_rest_report_service_for_azure.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureReport/autorestreportserviceforazure/auto_rest_report_service_for_azure.py index c02088e43b1a4..624bcd552166d 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureReport/autorestreportserviceforazure/auto_rest_report_service_for_azure.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureReport/autorestreportserviceforazure/auto_rest_report_service_for_azure.py @@ -64,19 +64,36 @@ def __init__( class AutoRestReportServiceForAzure(object): """Test Infrastructure for AutoRest - :param config: Configuration for client. - :type config: AutoRestReportServiceForAzureConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestReportServiceForAzureConfiguration + + :param credentials: Gets Azure subscription credentials. + :type credentials: :mod:`A msrestazure Credentials + object` + :param accept_language: Gets or sets the preferred language for the + response. + :type accept_language: str + :param long_running_operation_retry_timeout: Gets or sets the retry + timeout in seconds for Long Running Operations. Default value is 30. + :type long_running_operation_retry_timeout: int + :param generate_client_request_id: When set to true a unique + x-ms-client-request-id value is generated and included in each request. + Default is true. + :type generate_client_request_id: bool + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, credentials, accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, base_url=None, filepath=None): - self._client = ServiceClient(config.credentials, config) + self.config = AutoRestReportServiceForAzureConfiguration(credentials, accept_language, long_running_operation_retry_timeout, generate_client_request_id, base_url, filepath) + self._client = ServiceClient(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config def get_report( self, custom_headers={}, raw=False, **operation_config): diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureResource/autorestresourceflatteningtestservice/__init__.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureResource/autorestresourceflatteningtestservice/__init__.py index a81829bba4a6a..f01b0f4d27100 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureResource/autorestresourceflatteningtestservice/__init__.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureResource/autorestresourceflatteningtestservice/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_resource_flattening_test_service import AutoRestResourceFlatteningTestService, AutoRestResourceFlatteningTestServiceConfiguration +from .auto_rest_resource_flattening_test_service import AutoRestResourceFlatteningTestService from .version import VERSION -__all__ = [ - 'AutoRestResourceFlatteningTestService', - 'AutoRestResourceFlatteningTestServiceConfiguration' -] +__all__ = ['AutoRestResourceFlatteningTestService'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureResource/autorestresourceflatteningtestservice/auto_rest_resource_flattening_test_service.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureResource/autorestresourceflatteningtestservice/auto_rest_resource_flattening_test_service.py index 74f09db9d3400..aab82f8862e44 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureResource/autorestresourceflatteningtestservice/auto_rest_resource_flattening_test_service.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureResource/autorestresourceflatteningtestservice/auto_rest_resource_flattening_test_service.py @@ -64,19 +64,36 @@ def __init__( class AutoRestResourceFlatteningTestService(object): """Resource Flattening for AutoRest - :param config: Configuration for client. - :type config: AutoRestResourceFlatteningTestServiceConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestResourceFlatteningTestServiceConfiguration + + :param credentials: Gets Azure subscription credentials. + :type credentials: :mod:`A msrestazure Credentials + object` + :param accept_language: Gets or sets the preferred language for the + response. + :type accept_language: str + :param long_running_operation_retry_timeout: Gets or sets the retry + timeout in seconds for Long Running Operations. Default value is 30. + :type long_running_operation_retry_timeout: int + :param generate_client_request_id: When set to true a unique + x-ms-client-request-id value is generated and included in each request. + Default is true. + :type generate_client_request_id: bool + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, credentials, accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, base_url=None, filepath=None): - self._client = ServiceClient(config.credentials, config) + self.config = AutoRestResourceFlatteningTestServiceConfiguration(credentials, accept_language, long_running_operation_retry_timeout, generate_client_request_id, base_url, filepath) + self._client = ServiceClient(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config def put_array( self, resource_array=None, custom_headers={}, raw=False, **operation_config): @@ -312,7 +329,7 @@ def put_resource_collection( # Construct body if resource_complex_object is not None: - body_content = self._serialize.body(resource_complex_object, 'ResourceCollection') + body_content = self._serialize.body(resource_complex_object, models.ResourceCollection) else: body_content = None diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureSpecials/autorestazurespecialparameterstestclient/__init__.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureSpecials/autorestazurespecialparameterstestclient/__init__.py index 99cf572f3c11d..17626ce777bc5 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureSpecials/autorestazurespecialparameterstestclient/__init__.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureSpecials/autorestazurespecialparameterstestclient/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_azure_special_parameters_test_client import AutoRestAzureSpecialParametersTestClient, AutoRestAzureSpecialParametersTestClientConfiguration +from .auto_rest_azure_special_parameters_test_client import AutoRestAzureSpecialParametersTestClient from .version import VERSION -__all__ = [ - 'AutoRestAzureSpecialParametersTestClient', - 'AutoRestAzureSpecialParametersTestClientConfiguration' -] +__all__ = ['AutoRestAzureSpecialParametersTestClient'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureSpecials/autorestazurespecialparameterstestclient/auto_rest_azure_special_parameters_test_client.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureSpecials/autorestazurespecialparameterstestclient/auto_rest_azure_special_parameters_test_client.py index 95f2d47d0fb58..27217a362fa92 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureSpecials/autorestazurespecialparameterstestclient/auto_rest_azure_special_parameters_test_client.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureSpecials/autorestazurespecialparameterstestclient/auto_rest_azure_special_parameters_test_client.py @@ -84,8 +84,8 @@ def __init__( class AutoRestAzureSpecialParametersTestClient(object): """Test Infrastructure for AutoRest - :param config: Configuration for client. - :type config: AutoRestAzureSpecialParametersTestClientConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestAzureSpecialParametersTestClientConfiguration :ivar xms_client_request_id: XMsClientRequestId operations :vartype xms_client_request_id: .operations.XMsClientRequestIdOperations @@ -103,17 +103,40 @@ class AutoRestAzureSpecialParametersTestClient(object): :vartype odata: .operations.OdataOperations :ivar header: Header operations :vartype header: .operations.HeaderOperations + + :param credentials: Gets Azure subscription credentials. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The subscription id, which appears in the path, + always modeled in credentials. The value is always '1234-5678-9012-3456' + :type subscription_id: str + :param api_version: The api version, which appears in the query, the + value is always '2015-07-01-preview' + :type api_version: str + :param accept_language: Gets or sets the preferred language for the + response. + :type accept_language: str + :param long_running_operation_retry_timeout: Gets or sets the retry + timeout in seconds for Long Running Operations. Default value is 30. + :type long_running_operation_retry_timeout: int + :param generate_client_request_id: When set to true a unique + x-ms-client-request-id value is generated and included in each request. + Default is true. + :type generate_client_request_id: bool + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, credentials, subscription_id, api_version='2015-07-01-preview', accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, base_url=None, filepath=None): - self._client = ServiceClient(config.credentials, config) + self.config = AutoRestAzureSpecialParametersTestClientConfiguration(credentials, subscription_id, api_version, accept_language, long_running_operation_retry_timeout, generate_client_request_id, base_url, filepath) + self._client = ServiceClient(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.xms_client_request_id = XMsClientRequestIdOperations( self._client, self.config, self._serialize, self._deserialize) self.subscription_in_credentials = SubscriptionInCredentialsOperations( diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/__init__.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/__init__.py index ba883e5e5ac44..55019b8878d29 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/__init__.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_parameterized_host_test_client import AutoRestParameterizedHostTestClient, AutoRestParameterizedHostTestClientConfiguration +from .auto_rest_parameterized_host_test_client import AutoRestParameterizedHostTestClient from .version import VERSION -__all__ = [ - 'AutoRestParameterizedHostTestClient', - 'AutoRestParameterizedHostTestClientConfiguration' -] +__all__ = ['AutoRestParameterizedHostTestClient'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/auto_rest_parameterized_host_test_client.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/auto_rest_parameterized_host_test_client.py index 79e862f82db73..f6902e55c6869 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/auto_rest_parameterized_host_test_client.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/auto_rest_parameterized_host_test_client.py @@ -69,21 +69,40 @@ def __init__( class AutoRestParameterizedHostTestClient(object): """Test Infrastructure for AutoRest - :param config: Configuration for client. - :type config: AutoRestParameterizedHostTestClientConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestParameterizedHostTestClientConfiguration :ivar paths: Paths operations :vartype paths: .operations.PathsOperations + + :param credentials: Gets Azure subscription credentials. + :type credentials: :mod:`A msrestazure Credentials + object` + :param host: A string value that is used as a global part of the + parameterized host + :type host: str + :param accept_language: Gets or sets the preferred language for the + response. + :type accept_language: str + :param long_running_operation_retry_timeout: Gets or sets the retry + timeout in seconds for Long Running Operations. Default value is 30. + :type long_running_operation_retry_timeout: int + :param generate_client_request_id: When set to true a unique + x-ms-client-request-id value is generated and included in each request. + Default is true. + :type generate_client_request_id: bool + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, credentials, host, accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, filepath=None): - self._client = ServiceClient(config.credentials, config) + self.config = AutoRestParameterizedHostTestClientConfiguration(credentials, host, accept_language, long_running_operation_retry_timeout, generate_client_request_id, filepath) + self._client = ServiceClient(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.paths = PathsOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Head/autorestheadtestservice/__init__.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Head/autorestheadtestservice/__init__.py index ce653b3b55a8e..6413c91141662 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Head/autorestheadtestservice/__init__.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Head/autorestheadtestservice/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_head_test_service import AutoRestHeadTestService, AutoRestHeadTestServiceConfiguration +from .auto_rest_head_test_service import AutoRestHeadTestService from .version import VERSION -__all__ = [ - 'AutoRestHeadTestService', - 'AutoRestHeadTestServiceConfiguration' -] +__all__ = ['AutoRestHeadTestService'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Head/autorestheadtestservice/auto_rest_head_test_service.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Head/autorestheadtestservice/auto_rest_head_test_service.py index fc86a3308cb2e..786fdce1b8107 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Head/autorestheadtestservice/auto_rest_head_test_service.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Head/autorestheadtestservice/auto_rest_head_test_service.py @@ -62,21 +62,38 @@ def __init__( class AutoRestHeadTestService(object): """Test Infrastructure for AutoRest - :param config: Configuration for client. - :type config: AutoRestHeadTestServiceConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestHeadTestServiceConfiguration :ivar http_success: HttpSuccess operations :vartype http_success: .operations.HttpSuccessOperations + + :param credentials: Gets Azure subscription credentials. + :type credentials: :mod:`A msrestazure Credentials + object` + :param accept_language: Gets or sets the preferred language for the + response. + :type accept_language: str + :param long_running_operation_retry_timeout: Gets or sets the retry + timeout in seconds for Long Running Operations. Default value is 30. + :type long_running_operation_retry_timeout: int + :param generate_client_request_id: When set to true a unique + x-ms-client-request-id value is generated and included in each request. + Default is true. + :type generate_client_request_id: bool + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, credentials, accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, base_url=None, filepath=None): - self._client = ServiceClient(config.credentials, config) + self.config = AutoRestHeadTestServiceConfiguration(credentials, accept_language, long_running_operation_retry_timeout, generate_client_request_id, base_url, filepath) + self._client = ServiceClient(self.config.credentials, self.config) client_models = {} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.http_success = HttpSuccessOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/HeadExceptions/autorestheadexceptiontestservice/__init__.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/HeadExceptions/autorestheadexceptiontestservice/__init__.py index 3ab0679689ddc..0e63032ad6984 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/HeadExceptions/autorestheadexceptiontestservice/__init__.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/HeadExceptions/autorestheadexceptiontestservice/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_head_exception_test_service import AutoRestHeadExceptionTestService, AutoRestHeadExceptionTestServiceConfiguration +from .auto_rest_head_exception_test_service import AutoRestHeadExceptionTestService from .version import VERSION -__all__ = [ - 'AutoRestHeadExceptionTestService', - 'AutoRestHeadExceptionTestServiceConfiguration' -] +__all__ = ['AutoRestHeadExceptionTestService'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/HeadExceptions/autorestheadexceptiontestservice/auto_rest_head_exception_test_service.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/HeadExceptions/autorestheadexceptiontestservice/auto_rest_head_exception_test_service.py index d9745572729ef..0a040dc195f2d 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/HeadExceptions/autorestheadexceptiontestservice/auto_rest_head_exception_test_service.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/HeadExceptions/autorestheadexceptiontestservice/auto_rest_head_exception_test_service.py @@ -62,21 +62,38 @@ def __init__( class AutoRestHeadExceptionTestService(object): """Test Infrastructure for AutoRest - :param config: Configuration for client. - :type config: AutoRestHeadExceptionTestServiceConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestHeadExceptionTestServiceConfiguration :ivar head_exception: HeadException operations :vartype head_exception: .operations.HeadExceptionOperations + + :param credentials: Gets Azure subscription credentials. + :type credentials: :mod:`A msrestazure Credentials + object` + :param accept_language: Gets or sets the preferred language for the + response. + :type accept_language: str + :param long_running_operation_retry_timeout: Gets or sets the retry + timeout in seconds for Long Running Operations. Default value is 30. + :type long_running_operation_retry_timeout: int + :param generate_client_request_id: When set to true a unique + x-ms-client-request-id value is generated and included in each request. + Default is true. + :type generate_client_request_id: bool + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, credentials, accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, base_url=None, filepath=None): - self._client = ServiceClient(config.credentials, config) + self.config = AutoRestHeadExceptionTestServiceConfiguration(credentials, accept_language, long_running_operation_retry_timeout, generate_client_request_id, base_url, filepath) + self._client = ServiceClient(self.config.credentials, self.config) client_models = {} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.head_exception = HeadExceptionOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/__init__.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/__init__.py index 8186c26cc15cc..eb1578e8c7c95 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/__init__.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_long_running_operation_test_service import AutoRestLongRunningOperationTestService, AutoRestLongRunningOperationTestServiceConfiguration +from .auto_rest_long_running_operation_test_service import AutoRestLongRunningOperationTestService from .version import VERSION -__all__ = [ - 'AutoRestLongRunningOperationTestService', - 'AutoRestLongRunningOperationTestServiceConfiguration' -] +__all__ = ['AutoRestLongRunningOperationTestService'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/auto_rest_long_running_operation_test_service.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/auto_rest_long_running_operation_test_service.py index be1ddc0cc63c0..10be2f3377155 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/auto_rest_long_running_operation_test_service.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/auto_rest_long_running_operation_test_service.py @@ -66,8 +66,8 @@ def __init__( class AutoRestLongRunningOperationTestService(object): """Long-running Operation for AutoRest - :param config: Configuration for client. - :type config: AutoRestLongRunningOperationTestServiceConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestLongRunningOperationTestServiceConfiguration :ivar lr_os: LROs operations :vartype lr_os: .operations.LROsOperations @@ -77,17 +77,34 @@ class AutoRestLongRunningOperationTestService(object): :vartype lrosa_ds: .operations.LROSADsOperations :ivar lr_os_custom_header: LROsCustomHeader operations :vartype lr_os_custom_header: .operations.LROsCustomHeaderOperations + + :param credentials: Gets Azure subscription credentials. + :type credentials: :mod:`A msrestazure Credentials + object` + :param accept_language: Gets or sets the preferred language for the + response. + :type accept_language: str + :param long_running_operation_retry_timeout: Gets or sets the retry + timeout in seconds for Long Running Operations. Default value is 30. + :type long_running_operation_retry_timeout: int + :param generate_client_request_id: When set to true a unique + x-ms-client-request-id value is generated and included in each request. + Default is true. + :type generate_client_request_id: bool + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, credentials, accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, base_url=None, filepath=None): - self._client = ServiceClient(config.credentials, config) + self.config = AutoRestLongRunningOperationTestServiceConfiguration(credentials, accept_language, long_running_operation_retry_timeout, generate_client_request_id, base_url, filepath) + self._client = ServiceClient(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.lr_os = LROsOperations( self._client, self.config, self._serialize, self._deserialize) self.lro_retrys = LRORetrysOperations( diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/operations/lr_os_custom_header_operations.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/operations/lr_os_custom_header_operations.py index 96ade6d8e3ad8..521b8b7e132e2 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/operations/lr_os_custom_header_operations.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/operations/lr_os_custom_header_operations.py @@ -74,7 +74,7 @@ def put_async_retry_succeeded( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -168,7 +168,7 @@ def put201_creating_succeeded200( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -256,7 +256,7 @@ def post202_retry200( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -339,7 +339,7 @@ def post_async_retry_succeeded( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/operations/lr_os_operations.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/operations/lr_os_operations.py index 4a078a8a86f8f..743e4acfeda1e 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/operations/lr_os_operations.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/operations/lr_os_operations.py @@ -71,7 +71,7 @@ def put200_succeeded( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -156,7 +156,7 @@ def put200_succeeded_no_state( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -241,7 +241,7 @@ def put202_retry200( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -327,7 +327,7 @@ def put201_creating_succeeded200( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -415,7 +415,7 @@ def put200_updating_succeeded204( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -501,7 +501,7 @@ def put201_creating_failed200( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -589,7 +589,7 @@ def put200_acceptedcanceled200( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -674,7 +674,7 @@ def put_no_header_in_retry( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -765,7 +765,7 @@ def put_async_retry_succeeded( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -858,7 +858,7 @@ def put_async_no_retry_succeeded( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -950,7 +950,7 @@ def put_async_retry_failed( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -1043,7 +1043,7 @@ def put_async_no_retrycanceled( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -1134,7 +1134,7 @@ def put_async_no_header_in_retry( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -1221,7 +1221,7 @@ def put_non_resource( # Construct body if sku is not None: - body_content = self._serialize.body(sku, 'Sku') + body_content = self._serialize.body(sku, models.Sku) else: body_content = None @@ -1303,7 +1303,7 @@ def put_async_non_resource( # Construct body if sku is not None: - body_content = self._serialize.body(sku, 'Sku') + body_content = self._serialize.body(sku, models.Sku) else: body_content = None @@ -1386,7 +1386,7 @@ def put_sub_resource( # Construct body if product is not None: - body_content = self._serialize.body(product, 'SubProduct') + body_content = self._serialize.body(product, models.SubProduct) else: body_content = None @@ -1469,7 +1469,7 @@ def put_async_sub_resource( # Construct body if product is not None: - body_content = self._serialize.body(product, 'SubProduct') + body_content = self._serialize.body(product, models.SubProduct) else: body_content = None @@ -2549,7 +2549,7 @@ def post202_retry200( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -2631,7 +2631,7 @@ def post202_no_retry204( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -2723,7 +2723,7 @@ def post_async_retry_succeeded( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -2816,7 +2816,7 @@ def post_async_no_retry_succeeded( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -2908,7 +2908,7 @@ def post_async_retry_failed( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -2991,7 +2991,7 @@ def post_async_retrycanceled( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/operations/lro_retrys_operations.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/operations/lro_retrys_operations.py index 786c3c3bf6d7d..899a55b89635b 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/operations/lro_retrys_operations.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/operations/lro_retrys_operations.py @@ -73,7 +73,7 @@ def put201_creating_succeeded200( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -161,7 +161,7 @@ def put_async_relative_retry_succeeded( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -483,7 +483,7 @@ def post202_retry200( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -565,7 +565,7 @@ def post_async_relative_retry_succeeded( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/operations/lrosa_ds_operations.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/operations/lrosa_ds_operations.py index a211b6975e70d..d2de0cff4bd82 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/operations/lrosa_ds_operations.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/operations/lrosa_ds_operations.py @@ -70,7 +70,7 @@ def put_non_retry400( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -156,7 +156,7 @@ def put_non_retry201_creating400( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -242,7 +242,7 @@ def put_non_retry201_creating400_invalid_json( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -329,7 +329,7 @@ def put_async_relative_retry400( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -629,7 +629,7 @@ def post_non_retry400( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -708,7 +708,7 @@ def post202_non_retry400( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -789,7 +789,7 @@ def post_async_relative_retry400( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -871,7 +871,7 @@ def put_error201_no_provisioning_state_payload( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -959,7 +959,7 @@ def put_async_relative_retry_no_status( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -1052,7 +1052,7 @@ def put_async_relative_retry_no_status_payload( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -1280,7 +1280,7 @@ def post202_no_location( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -1362,7 +1362,7 @@ def post_async_relative_retry_no_payload( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -1444,7 +1444,7 @@ def put200_invalid_json( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -1529,7 +1529,7 @@ def put_async_relative_retry_invalid_header( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -1622,7 +1622,7 @@ def put_async_relative_retry_invalid_json_polling( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -1927,7 +1927,7 @@ def post202_retry_invalid_header( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -2008,7 +2008,7 @@ def post_async_relative_retry_invalid_header( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None @@ -2091,7 +2091,7 @@ def post_async_relative_retry_invalid_json_polling( # Construct body if product is not None: - body_content = self._serialize.body(product, 'Product') + body_content = self._serialize.body(product, models.Product) else: body_content = None diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/autorestpagingtestservice/__init__.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/autorestpagingtestservice/__init__.py index 40efea1e6c76f..68708b4282ef4 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/autorestpagingtestservice/__init__.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/autorestpagingtestservice/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_paging_test_service import AutoRestPagingTestService, AutoRestPagingTestServiceConfiguration +from .auto_rest_paging_test_service import AutoRestPagingTestService from .version import VERSION -__all__ = [ - 'AutoRestPagingTestService', - 'AutoRestPagingTestServiceConfiguration' -] +__all__ = ['AutoRestPagingTestService'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/autorestpagingtestservice/auto_rest_paging_test_service.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/autorestpagingtestservice/auto_rest_paging_test_service.py index e3cf9310642ed..b1bb993344a44 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/autorestpagingtestservice/auto_rest_paging_test_service.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/autorestpagingtestservice/auto_rest_paging_test_service.py @@ -63,21 +63,38 @@ def __init__( class AutoRestPagingTestService(object): """Long-running Operation for AutoRest - :param config: Configuration for client. - :type config: AutoRestPagingTestServiceConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestPagingTestServiceConfiguration :ivar paging: Paging operations :vartype paging: .operations.PagingOperations + + :param credentials: Gets Azure subscription credentials. + :type credentials: :mod:`A msrestazure Credentials + object` + :param accept_language: Gets or sets the preferred language for the + response. + :type accept_language: str + :param long_running_operation_retry_timeout: Gets or sets the retry + timeout in seconds for Long Running Operations. Default value is 30. + :type long_running_operation_retry_timeout: int + :param generate_client_request_id: When set to true a unique + x-ms-client-request-id value is generated and included in each request. + Default is true. + :type generate_client_request_id: bool + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, credentials, accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, base_url=None, filepath=None): - self._client = ServiceClient(config.credentials, config) + self.config = AutoRestPagingTestServiceConfiguration(credentials, accept_language, long_running_operation_retry_timeout, generate_client_request_id, base_url, filepath) + self._client = ServiceClient(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.paging = PagingOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/StorageManagementClient/storagemanagementclient/__init__.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/StorageManagementClient/storagemanagementclient/__init__.py index 928015217d6cc..0854715e0c106 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/StorageManagementClient/storagemanagementclient/__init__.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/StorageManagementClient/storagemanagementclient/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .storage_management_client import StorageManagementClient, StorageManagementClientConfiguration +from .storage_management_client import StorageManagementClient from .version import VERSION -__all__ = [ - 'StorageManagementClient', - 'StorageManagementClientConfiguration' -] +__all__ = ['StorageManagementClient'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/StorageManagementClient/storagemanagementclient/operations/storage_accounts_operations.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/StorageManagementClient/storagemanagementclient/operations/storage_accounts_operations.py index 2250ab10c1468..4c6883792aaeb 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/StorageManagementClient/storagemanagementclient/operations/storage_accounts_operations.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/StorageManagementClient/storagemanagementclient/operations/storage_accounts_operations.py @@ -78,7 +78,7 @@ def check_name_availability( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(account_name, 'StorageAccountCheckNameAvailabilityParameters') + body_content = self._serialize.body(account_name, models.StorageAccountCheckNameAvailabilityParameters) # Construct and send request request = self._client.post(url, query_parameters) @@ -155,7 +155,7 @@ def create( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'StorageAccountCreateParameters') + body_content = self._serialize.body(parameters, models.StorageAccountCreateParameters) # Construct and send request def long_running_send(): @@ -386,7 +386,7 @@ def update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'StorageAccountUpdateParameters') + body_content = self._serialize.body(parameters, models.StorageAccountUpdateParameters) # Construct and send request request = self._client.patch(url, query_parameters) @@ -656,7 +656,7 @@ def regenerate_key( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(regenerate_key, 'StorageAccountRegenerateKeyParameters') + body_content = self._serialize.body(regenerate_key, models.StorageAccountRegenerateKeyParameters) # Construct and send request request = self._client.post(url, query_parameters) diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/StorageManagementClient/storagemanagementclient/storage_management_client.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/StorageManagementClient/storagemanagementclient/storage_management_client.py index 1334ec94142ec..68f581fd81667 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/StorageManagementClient/storagemanagementclient/storage_management_client.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/StorageManagementClient/storagemanagementclient/storage_management_client.py @@ -78,24 +78,47 @@ def __init__( class StorageManagementClient(object): """StorageManagementClient - :param config: Configuration for client. - :type config: StorageManagementClientConfiguration + :ivar config: Configuration for client. + :vartype config: StorageManagementClientConfiguration :ivar storage_accounts: StorageAccounts operations :vartype storage_accounts: .operations.StorageAccountsOperations :ivar usage: Usage operations :vartype usage: .operations.UsageOperations + + :param credentials: Gets Azure subscription credentials. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Gets subscription credentials which uniquely + identify Microsoft Azure subscription. The subscription ID forms part of + the URI for every service call. + :type subscription_id: str + :param api_version: Client Api Version. + :type api_version: str + :param accept_language: Gets or sets the preferred language for the + response. + :type accept_language: str + :param long_running_operation_retry_timeout: Gets or sets the retry + timeout in seconds for Long Running Operations. Default value is 30. + :type long_running_operation_retry_timeout: int + :param generate_client_request_id: When set to true a unique + x-ms-client-request-id value is generated and included in each request. + Default is true. + :type generate_client_request_id: bool + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, credentials, subscription_id, api_version='2015-05-01-preview', accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, base_url=None, filepath=None): - self._client = ServiceClient(config.credentials, config) + self.config = StorageManagementClientConfiguration(credentials, subscription_id, api_version, accept_language, long_running_operation_retry_timeout, generate_client_request_id, base_url, filepath) + self._client = ServiceClient(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.storage_accounts = StorageAccountsOperations( self._client, self.config, self._serialize, self._deserialize) self.usage = UsageOperations( diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/SubscriptionIdApiVersion/microsoftazuretesturl/__init__.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/SubscriptionIdApiVersion/microsoftazuretesturl/__init__.py index 1841a70993a8f..fb1c1642d2859 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/SubscriptionIdApiVersion/microsoftazuretesturl/__init__.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/SubscriptionIdApiVersion/microsoftazuretesturl/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .microsoft_azure_test_url import MicrosoftAzureTestUrl, MicrosoftAzureTestUrlConfiguration +from .microsoft_azure_test_url import MicrosoftAzureTestUrl from .version import VERSION -__all__ = [ - 'MicrosoftAzureTestUrl', - 'MicrosoftAzureTestUrlConfiguration' -] +__all__ = ['MicrosoftAzureTestUrl'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/SubscriptionIdApiVersion/microsoftazuretesturl/microsoft_azure_test_url.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/SubscriptionIdApiVersion/microsoftazuretesturl/microsoft_azure_test_url.py index d16f3f25706a6..7283782c9388b 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/SubscriptionIdApiVersion/microsoftazuretesturl/microsoft_azure_test_url.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/SubscriptionIdApiVersion/microsoftazuretesturl/microsoft_azure_test_url.py @@ -75,21 +75,42 @@ def __init__( class MicrosoftAzureTestUrl(object): """Some cool documentation. - :param config: Configuration for client. - :type config: MicrosoftAzureTestUrlConfiguration + :ivar config: Configuration for client. + :vartype config: MicrosoftAzureTestUrlConfiguration :ivar group: Group operations :vartype group: .operations.GroupOperations + + :param credentials: Gets Azure subscription credentials. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription Id. + :type subscription_id: str + :param api_version: API Version with value '2014-04-01-preview'. + :type api_version: str + :param accept_language: Gets or sets the preferred language for the + response. + :type accept_language: str + :param long_running_operation_retry_timeout: Gets or sets the retry + timeout in seconds for Long Running Operations. Default value is 30. + :type long_running_operation_retry_timeout: int + :param generate_client_request_id: When set to true a unique + x-ms-client-request-id value is generated and included in each request. + Default is true. + :type generate_client_request_id: bool + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, credentials, subscription_id, api_version='2014-04-01-preview', accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, base_url=None, filepath=None): - self._client = ServiceClient(config.credentials, config) + self.config = MicrosoftAzureTestUrlConfiguration(credentials, subscription_id, api_version, accept_language, long_running_operation_retry_timeout, generate_client_request_id, base_url, filepath) + self._client = ServiceClient(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.group = GroupOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyArray/autorestswaggerbatarrayservice/__init__.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyArray/autorestswaggerbatarrayservice/__init__.py index aaf980709effe..1aef76714e640 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyArray/autorestswaggerbatarrayservice/__init__.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyArray/autorestswaggerbatarrayservice/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_swagger_bat_array_service import AutoRestSwaggerBATArrayService, AutoRestSwaggerBATArrayServiceConfiguration +from .auto_rest_swagger_bat_array_service import AutoRestSwaggerBATArrayService from .version import VERSION -__all__ = [ - 'AutoRestSwaggerBATArrayService', - 'AutoRestSwaggerBATArrayServiceConfiguration' -] +__all__ = ['AutoRestSwaggerBATArrayService'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyArray/autorestswaggerbatarrayservice/auto_rest_swagger_bat_array_service.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyArray/autorestswaggerbatarrayservice/auto_rest_swagger_bat_array_service.py index 8ebdaa19bfa3b..5708ff6c67216 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyArray/autorestswaggerbatarrayservice/auto_rest_swagger_bat_array_service.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyArray/autorestswaggerbatarrayservice/auto_rest_swagger_bat_array_service.py @@ -39,21 +39,25 @@ def __init__( class AutoRestSwaggerBATArrayService(object): """Test Infrastructure for AutoRest Swagger BAT - :param config: Configuration for client. - :type config: AutoRestSwaggerBATArrayServiceConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestSwaggerBATArrayServiceConfiguration :ivar array: Array operations :vartype array: .operations.Array + + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, base_url=None, filepath=None): - self._client = ServiceClient(None, config) + self.config = AutoRestSwaggerBATArrayServiceConfiguration(base_url, filepath) + self._client = ServiceClient(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.array = Array( self._client, self.config, self._serialize, self._deserialize) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyBoolean/autorestbooltestservice/__init__.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyBoolean/autorestbooltestservice/__init__.py index 1a9ee6215ad6b..b5af29ff2dae8 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyBoolean/autorestbooltestservice/__init__.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyBoolean/autorestbooltestservice/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_bool_test_service import AutoRestBoolTestService, AutoRestBoolTestServiceConfiguration +from .auto_rest_bool_test_service import AutoRestBoolTestService from .version import VERSION -__all__ = [ - 'AutoRestBoolTestService', - 'AutoRestBoolTestServiceConfiguration' -] +__all__ = ['AutoRestBoolTestService'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyBoolean/autorestbooltestservice/auto_rest_bool_test_service.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyBoolean/autorestbooltestservice/auto_rest_bool_test_service.py index 4b761abb6106a..362fed2136660 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyBoolean/autorestbooltestservice/auto_rest_bool_test_service.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyBoolean/autorestbooltestservice/auto_rest_bool_test_service.py @@ -39,21 +39,25 @@ def __init__( class AutoRestBoolTestService(object): """Test Infrastructure for AutoRest - :param config: Configuration for client. - :type config: AutoRestBoolTestServiceConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestBoolTestServiceConfiguration :ivar bool_model: BoolModel operations :vartype bool_model: .operations.BoolModel + + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, base_url=None, filepath=None): - self._client = ServiceClient(None, config) + self.config = AutoRestBoolTestServiceConfiguration(base_url, filepath) + self._client = ServiceClient(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.bool_model = BoolModel( self._client, self.config, self._serialize, self._deserialize) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyByte/autorestswaggerbatbyteservice/__init__.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyByte/autorestswaggerbatbyteservice/__init__.py index 96f86be7bcf6a..5db23a411c536 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyByte/autorestswaggerbatbyteservice/__init__.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyByte/autorestswaggerbatbyteservice/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_swagger_bat_byte_service import AutoRestSwaggerBATByteService, AutoRestSwaggerBATByteServiceConfiguration +from .auto_rest_swagger_bat_byte_service import AutoRestSwaggerBATByteService from .version import VERSION -__all__ = [ - 'AutoRestSwaggerBATByteService', - 'AutoRestSwaggerBATByteServiceConfiguration' -] +__all__ = ['AutoRestSwaggerBATByteService'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyByte/autorestswaggerbatbyteservice/auto_rest_swagger_bat_byte_service.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyByte/autorestswaggerbatbyteservice/auto_rest_swagger_bat_byte_service.py index 642657c97d75b..e95752ae8ff2f 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyByte/autorestswaggerbatbyteservice/auto_rest_swagger_bat_byte_service.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyByte/autorestswaggerbatbyteservice/auto_rest_swagger_bat_byte_service.py @@ -39,21 +39,25 @@ def __init__( class AutoRestSwaggerBATByteService(object): """Test Infrastructure for AutoRest Swagger BAT - :param config: Configuration for client. - :type config: AutoRestSwaggerBATByteServiceConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestSwaggerBATByteServiceConfiguration :ivar byte: Byte operations :vartype byte: .operations.Byte + + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, base_url=None, filepath=None): - self._client = ServiceClient(None, config) + self.config = AutoRestSwaggerBATByteServiceConfiguration(base_url, filepath) + self._client = ServiceClient(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.byte = Byte( self._client, self.config, self._serialize, self._deserialize) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/__init__.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/__init__.py index 88a5faf1c85ed..e1df7688a1326 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/__init__.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_complex_test_service import AutoRestComplexTestService, AutoRestComplexTestServiceConfiguration +from .auto_rest_complex_test_service import AutoRestComplexTestService from .version import VERSION -__all__ = [ - 'AutoRestComplexTestService', - 'AutoRestComplexTestServiceConfiguration' -] +__all__ = ['AutoRestComplexTestService'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/auto_rest_complex_test_service.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/auto_rest_complex_test_service.py index 3887687ac962c..06e9d1c27b303 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/auto_rest_complex_test_service.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/auto_rest_complex_test_service.py @@ -54,8 +54,8 @@ def __init__( class AutoRestComplexTestService(object): """Test Infrastructure for AutoRest - :param config: Configuration for client. - :type config: AutoRestComplexTestServiceConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestComplexTestServiceConfiguration :ivar basic_operations: BasicOperations operations :vartype basic_operations: .operations.BasicOperations @@ -73,17 +73,23 @@ class AutoRestComplexTestService(object): :vartype polymorphicrecursive: .operations.Polymorphicrecursive :ivar readonlyproperty: Readonlyproperty operations :vartype readonlyproperty: .operations.Readonlyproperty + + :param api_version: API ID. + :type api_version: str + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, api_version, base_url=None, filepath=None): - self._client = ServiceClient(None, config) + self.config = AutoRestComplexTestServiceConfiguration(api_version, base_url, filepath) + self._client = ServiceClient(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.basic_operations = BasicOperations( self._client, self.config, self._serialize, self._deserialize) self.primitive = Primitive( diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/array.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/array.py index e375d28d5b3ab..c059d47abde59 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/array.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/array.py @@ -107,7 +107,7 @@ def put_valid( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(complex_body, 'ArrayWrapper') + body_content = self._serialize.body(complex_body, models.ArrayWrapper) # Construct and send request request = self._client.put(url, query_parameters) @@ -197,7 +197,7 @@ def put_empty( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(complex_body, 'ArrayWrapper') + body_content = self._serialize.body(complex_body, models.ArrayWrapper) # Construct and send request request = self._client.put(url, query_parameters) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/basic_operations.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/basic_operations.py index f1cf4be957c2f..8421c46c8bbfd 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/basic_operations.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/basic_operations.py @@ -107,7 +107,7 @@ def put_valid( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(complex_body, 'Basic') + body_content = self._serialize.body(complex_body, models.Basic) # Construct and send request request = self._client.put(url, query_parameters) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/dictionary.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/dictionary.py index c99f68238ac66..265c0905f8a2e 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/dictionary.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/dictionary.py @@ -107,7 +107,7 @@ def put_valid( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(complex_body, 'DictionaryWrapper') + body_content = self._serialize.body(complex_body, models.DictionaryWrapper) # Construct and send request request = self._client.put(url, query_parameters) @@ -197,7 +197,7 @@ def put_empty( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(complex_body, 'DictionaryWrapper') + body_content = self._serialize.body(complex_body, models.DictionaryWrapper) # Construct and send request request = self._client.put(url, query_parameters) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/inheritance.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/inheritance.py index 94062da6c3bf5..273b3940cc52c 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/inheritance.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/inheritance.py @@ -109,7 +109,7 @@ def put_valid( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(complex_body, 'Siamese') + body_content = self._serialize.body(complex_body, models.Siamese) # Construct and send request request = self._client.put(url, query_parameters) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/polymorphicrecursive.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/polymorphicrecursive.py index d2aadc47ad3a8..37cf2c78fd52f 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/polymorphicrecursive.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/polymorphicrecursive.py @@ -158,7 +158,7 @@ def put_valid( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(complex_body, 'Fish') + body_content = self._serialize.body(complex_body, models.Fish) # Construct and send request request = self._client.put(url, query_parameters) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/polymorphism.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/polymorphism.py index 3b3d75f90dfb2..c9fe7cf53ad5a 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/polymorphism.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/polymorphism.py @@ -139,7 +139,7 @@ def put_valid( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(complex_body, 'Fish') + body_content = self._serialize.body(complex_body, models.Fish) # Construct and send request request = self._client.put(url, query_parameters) @@ -210,7 +210,7 @@ def put_valid_missing_required( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(complex_body, 'Fish') + body_content = self._serialize.body(complex_body, models.Fish) # Construct and send request request = self._client.put(url, query_parameters) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/primitive.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/primitive.py index de0386c4de16e..855d8902557f9 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/primitive.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/primitive.py @@ -106,7 +106,7 @@ def put_int( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(complex_body, 'IntWrapper') + body_content = self._serialize.body(complex_body, models.IntWrapper) # Construct and send request request = self._client.put(url, query_parameters) @@ -195,7 +195,7 @@ def put_long( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(complex_body, 'LongWrapper') + body_content = self._serialize.body(complex_body, models.LongWrapper) # Construct and send request request = self._client.put(url, query_parameters) @@ -284,7 +284,7 @@ def put_float( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(complex_body, 'FloatWrapper') + body_content = self._serialize.body(complex_body, models.FloatWrapper) # Construct and send request request = self._client.put(url, query_parameters) @@ -374,7 +374,7 @@ def put_double( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(complex_body, 'DoubleWrapper') + body_content = self._serialize.body(complex_body, models.DoubleWrapper) # Construct and send request request = self._client.put(url, query_parameters) @@ -463,7 +463,7 @@ def put_bool( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(complex_body, 'BooleanWrapper') + body_content = self._serialize.body(complex_body, models.BooleanWrapper) # Construct and send request request = self._client.put(url, query_parameters) @@ -552,7 +552,7 @@ def put_string( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(complex_body, 'StringWrapper') + body_content = self._serialize.body(complex_body, models.StringWrapper) # Construct and send request request = self._client.put(url, query_parameters) @@ -641,7 +641,7 @@ def put_date( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(complex_body, 'DateWrapper') + body_content = self._serialize.body(complex_body, models.DateWrapper) # Construct and send request request = self._client.put(url, query_parameters) @@ -731,7 +731,7 @@ def put_date_time( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(complex_body, 'DatetimeWrapper') + body_content = self._serialize.body(complex_body, models.DatetimeWrapper) # Construct and send request request = self._client.put(url, query_parameters) @@ -821,7 +821,7 @@ def put_date_time_rfc1123( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(complex_body, 'Datetimerfc1123Wrapper') + body_content = self._serialize.body(complex_body, models.Datetimerfc1123Wrapper) # Construct and send request request = self._client.put(url, query_parameters) @@ -911,7 +911,7 @@ def put_duration( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(complex_body, 'DurationWrapper') + body_content = self._serialize.body(complex_body, models.DurationWrapper) # Construct and send request request = self._client.put(url, query_parameters) @@ -1001,7 +1001,7 @@ def put_byte( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(complex_body, 'ByteWrapper') + body_content = self._serialize.body(complex_body, models.ByteWrapper) # Construct and send request request = self._client.put(url, query_parameters) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/readonlyproperty.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/readonlyproperty.py index fde563ffc3a26..3ad3012adf2bd 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/readonlyproperty.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/readonlyproperty.py @@ -106,7 +106,7 @@ def put_valid( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(complex_body, 'ReadonlyObj') + body_content = self._serialize.body(complex_body, models.ReadonlyObj) # Construct and send request request = self._client.put(url, query_parameters) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDate/autorestdatetestservice/__init__.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDate/autorestdatetestservice/__init__.py index b7af2707b1e97..f8fdc22a6549a 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDate/autorestdatetestservice/__init__.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDate/autorestdatetestservice/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_date_test_service import AutoRestDateTestService, AutoRestDateTestServiceConfiguration +from .auto_rest_date_test_service import AutoRestDateTestService from .version import VERSION -__all__ = [ - 'AutoRestDateTestService', - 'AutoRestDateTestServiceConfiguration' -] +__all__ = ['AutoRestDateTestService'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDate/autorestdatetestservice/auto_rest_date_test_service.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDate/autorestdatetestservice/auto_rest_date_test_service.py index 0f74549ec39ad..d589aef9c0782 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDate/autorestdatetestservice/auto_rest_date_test_service.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDate/autorestdatetestservice/auto_rest_date_test_service.py @@ -39,21 +39,25 @@ def __init__( class AutoRestDateTestService(object): """Test Infrastructure for AutoRest - :param config: Configuration for client. - :type config: AutoRestDateTestServiceConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestDateTestServiceConfiguration :ivar date_model: DateModel operations :vartype date_model: .operations.DateModel + + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, base_url=None, filepath=None): - self._client = ServiceClient(None, config) + self.config = AutoRestDateTestServiceConfiguration(base_url, filepath) + self._client = ServiceClient(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.date_model = DateModel( self._client, self.config, self._serialize, self._deserialize) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDateTime/autorestdatetimetestservice/__init__.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDateTime/autorestdatetimetestservice/__init__.py index 715d9b2347be7..40d7df46c4ee7 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDateTime/autorestdatetimetestservice/__init__.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDateTime/autorestdatetimetestservice/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_date_time_test_service import AutoRestDateTimeTestService, AutoRestDateTimeTestServiceConfiguration +from .auto_rest_date_time_test_service import AutoRestDateTimeTestService from .version import VERSION -__all__ = [ - 'AutoRestDateTimeTestService', - 'AutoRestDateTimeTestServiceConfiguration' -] +__all__ = ['AutoRestDateTimeTestService'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDateTime/autorestdatetimetestservice/auto_rest_date_time_test_service.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDateTime/autorestdatetimetestservice/auto_rest_date_time_test_service.py index ccfa0103070cd..63020ce190980 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDateTime/autorestdatetimetestservice/auto_rest_date_time_test_service.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDateTime/autorestdatetimetestservice/auto_rest_date_time_test_service.py @@ -39,21 +39,25 @@ def __init__( class AutoRestDateTimeTestService(object): """Test Infrastructure for AutoRest - :param config: Configuration for client. - :type config: AutoRestDateTimeTestServiceConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestDateTimeTestServiceConfiguration :ivar datetime_model: DatetimeModel operations :vartype datetime_model: .operations.DatetimeModel + + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, base_url=None, filepath=None): - self._client = ServiceClient(None, config) + self.config = AutoRestDateTimeTestServiceConfiguration(base_url, filepath) + self._client = ServiceClient(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.datetime_model = DatetimeModel( self._client, self.config, self._serialize, self._deserialize) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/autorestrfc1123datetimetestservice/__init__.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/autorestrfc1123datetimetestservice/__init__.py index 6ce64523d9928..85daa6afc2506 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/autorestrfc1123datetimetestservice/__init__.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/autorestrfc1123datetimetestservice/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_rfc1123_date_time_test_service import AutoRestRFC1123DateTimeTestService, AutoRestRFC1123DateTimeTestServiceConfiguration +from .auto_rest_rfc1123_date_time_test_service import AutoRestRFC1123DateTimeTestService from .version import VERSION -__all__ = [ - 'AutoRestRFC1123DateTimeTestService', - 'AutoRestRFC1123DateTimeTestServiceConfiguration' -] +__all__ = ['AutoRestRFC1123DateTimeTestService'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/autorestrfc1123datetimetestservice/auto_rest_rfc1123_date_time_test_service.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/autorestrfc1123datetimetestservice/auto_rest_rfc1123_date_time_test_service.py index 0863e02445f74..fb3ccf262d9a1 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/autorestrfc1123datetimetestservice/auto_rest_rfc1123_date_time_test_service.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/autorestrfc1123datetimetestservice/auto_rest_rfc1123_date_time_test_service.py @@ -39,21 +39,25 @@ def __init__( class AutoRestRFC1123DateTimeTestService(object): """Test Infrastructure for AutoRest - :param config: Configuration for client. - :type config: AutoRestRFC1123DateTimeTestServiceConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestRFC1123DateTimeTestServiceConfiguration :ivar datetimerfc1123: Datetimerfc1123 operations :vartype datetimerfc1123: .operations.Datetimerfc1123 + + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, base_url=None, filepath=None): - self._client = ServiceClient(None, config) + self.config = AutoRestRFC1123DateTimeTestServiceConfiguration(base_url, filepath) + self._client = ServiceClient(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.datetimerfc1123 = Datetimerfc1123( self._client, self.config, self._serialize, self._deserialize) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDictionary/autorestswaggerbatdictionaryservice/__init__.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDictionary/autorestswaggerbatdictionaryservice/__init__.py index b835d08c52f18..81ebb3c0c24dc 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDictionary/autorestswaggerbatdictionaryservice/__init__.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDictionary/autorestswaggerbatdictionaryservice/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_swagger_ba_tdictionary_service import AutoRestSwaggerBATdictionaryService, AutoRestSwaggerBATdictionaryServiceConfiguration +from .auto_rest_swagger_ba_tdictionary_service import AutoRestSwaggerBATdictionaryService from .version import VERSION -__all__ = [ - 'AutoRestSwaggerBATdictionaryService', - 'AutoRestSwaggerBATdictionaryServiceConfiguration' -] +__all__ = ['AutoRestSwaggerBATdictionaryService'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDictionary/autorestswaggerbatdictionaryservice/auto_rest_swagger_ba_tdictionary_service.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDictionary/autorestswaggerbatdictionaryservice/auto_rest_swagger_ba_tdictionary_service.py index 0347ffaeef4cd..c8fd56f67c1fc 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDictionary/autorestswaggerbatdictionaryservice/auto_rest_swagger_ba_tdictionary_service.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDictionary/autorestswaggerbatdictionaryservice/auto_rest_swagger_ba_tdictionary_service.py @@ -39,21 +39,25 @@ def __init__( class AutoRestSwaggerBATdictionaryService(object): """Test Infrastructure for AutoRest Swagger BAT - :param config: Configuration for client. - :type config: AutoRestSwaggerBATdictionaryServiceConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestSwaggerBATdictionaryServiceConfiguration :ivar dictionary: Dictionary operations :vartype dictionary: .operations.Dictionary + + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, base_url=None, filepath=None): - self._client = ServiceClient(None, config) + self.config = AutoRestSwaggerBATdictionaryServiceConfiguration(base_url, filepath) + self._client = ServiceClient(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.dictionary = Dictionary( self._client, self.config, self._serialize, self._deserialize) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDuration/autorestdurationtestservice/__init__.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDuration/autorestdurationtestservice/__init__.py index 2b089964f917f..4ec26f57486df 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDuration/autorestdurationtestservice/__init__.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDuration/autorestdurationtestservice/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_duration_test_service import AutoRestDurationTestService, AutoRestDurationTestServiceConfiguration +from .auto_rest_duration_test_service import AutoRestDurationTestService from .version import VERSION -__all__ = [ - 'AutoRestDurationTestService', - 'AutoRestDurationTestServiceConfiguration' -] +__all__ = ['AutoRestDurationTestService'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDuration/autorestdurationtestservice/auto_rest_duration_test_service.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDuration/autorestdurationtestservice/auto_rest_duration_test_service.py index 6b92034f35796..23ffff5204666 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDuration/autorestdurationtestservice/auto_rest_duration_test_service.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDuration/autorestdurationtestservice/auto_rest_duration_test_service.py @@ -39,21 +39,25 @@ def __init__( class AutoRestDurationTestService(object): """Test Infrastructure for AutoRest - :param config: Configuration for client. - :type config: AutoRestDurationTestServiceConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestDurationTestServiceConfiguration :ivar duration: Duration operations :vartype duration: .operations.Duration + + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, base_url=None, filepath=None): - self._client = ServiceClient(None, config) + self.config = AutoRestDurationTestServiceConfiguration(base_url, filepath) + self._client = ServiceClient(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.duration = Duration( self._client, self.config, self._serialize, self._deserialize) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyFile/autorestswaggerbatfileservice/__init__.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyFile/autorestswaggerbatfileservice/__init__.py index e50acad67ee85..51dcc09c83649 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyFile/autorestswaggerbatfileservice/__init__.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyFile/autorestswaggerbatfileservice/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_swagger_bat_file_service import AutoRestSwaggerBATFileService, AutoRestSwaggerBATFileServiceConfiguration +from .auto_rest_swagger_bat_file_service import AutoRestSwaggerBATFileService from .version import VERSION -__all__ = [ - 'AutoRestSwaggerBATFileService', - 'AutoRestSwaggerBATFileServiceConfiguration' -] +__all__ = ['AutoRestSwaggerBATFileService'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyFile/autorestswaggerbatfileservice/auto_rest_swagger_bat_file_service.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyFile/autorestswaggerbatfileservice/auto_rest_swagger_bat_file_service.py index ed4b424e1eee1..aa002c6d14bb5 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyFile/autorestswaggerbatfileservice/auto_rest_swagger_bat_file_service.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyFile/autorestswaggerbatfileservice/auto_rest_swagger_bat_file_service.py @@ -39,21 +39,25 @@ def __init__( class AutoRestSwaggerBATFileService(object): """Test Infrastructure for AutoRest Swagger BAT - :param config: Configuration for client. - :type config: AutoRestSwaggerBATFileServiceConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestSwaggerBATFileServiceConfiguration :ivar files: Files operations :vartype files: .operations.Files + + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, base_url=None, filepath=None): - self._client = ServiceClient(None, config) + self.config = AutoRestSwaggerBATFileServiceConfiguration(base_url, filepath) + self._client = ServiceClient(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.files = Files( self._client, self.config, self._serialize, self._deserialize) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyFormData/autorestswaggerbatformdataservice/__init__.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyFormData/autorestswaggerbatformdataservice/__init__.py index 37291171869ef..3460a7aa1b046 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyFormData/autorestswaggerbatformdataservice/__init__.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyFormData/autorestswaggerbatformdataservice/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_swagger_bat_form_data_service import AutoRestSwaggerBATFormDataService, AutoRestSwaggerBATFormDataServiceConfiguration +from .auto_rest_swagger_bat_form_data_service import AutoRestSwaggerBATFormDataService from .version import VERSION -__all__ = [ - 'AutoRestSwaggerBATFormDataService', - 'AutoRestSwaggerBATFormDataServiceConfiguration' -] +__all__ = ['AutoRestSwaggerBATFormDataService'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyFormData/autorestswaggerbatformdataservice/auto_rest_swagger_bat_form_data_service.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyFormData/autorestswaggerbatformdataservice/auto_rest_swagger_bat_form_data_service.py index 96060d040eb6f..5dab02ffeb01a 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyFormData/autorestswaggerbatformdataservice/auto_rest_swagger_bat_form_data_service.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyFormData/autorestswaggerbatformdataservice/auto_rest_swagger_bat_form_data_service.py @@ -39,21 +39,25 @@ def __init__( class AutoRestSwaggerBATFormDataService(object): """Test Infrastructure for AutoRest Swagger BAT - :param config: Configuration for client. - :type config: AutoRestSwaggerBATFormDataServiceConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestSwaggerBATFormDataServiceConfiguration :ivar formdata: Formdata operations :vartype formdata: .operations.Formdata + + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, base_url=None, filepath=None): - self._client = ServiceClient(None, config) + self.config = AutoRestSwaggerBATFormDataServiceConfiguration(base_url, filepath) + self._client = ServiceClient(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.formdata = Formdata( self._client, self.config, self._serialize, self._deserialize) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/__init__.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/__init__.py index 940d02de2bb48..ee85c655bdbb0 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/__init__.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_integer_test_service import AutoRestIntegerTestService, AutoRestIntegerTestServiceConfiguration +from .auto_rest_integer_test_service import AutoRestIntegerTestService from .version import VERSION -__all__ = [ - 'AutoRestIntegerTestService', - 'AutoRestIntegerTestServiceConfiguration' -] +__all__ = ['AutoRestIntegerTestService'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/auto_rest_integer_test_service.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/auto_rest_integer_test_service.py index 3fa0acf42d06f..cb2b63aeb46f6 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/auto_rest_integer_test_service.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/auto_rest_integer_test_service.py @@ -39,21 +39,25 @@ def __init__( class AutoRestIntegerTestService(object): """Test Infrastructure for AutoRest - :param config: Configuration for client. - :type config: AutoRestIntegerTestServiceConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestIntegerTestServiceConfiguration :ivar int_model: IntModel operations :vartype int_model: .operations.IntModel + + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, base_url=None, filepath=None): - self._client = ServiceClient(None, config) + self.config = AutoRestIntegerTestServiceConfiguration(base_url, filepath) + self._client = ServiceClient(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.int_model = IntModel( self._client, self.config, self._serialize, self._deserialize) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/operations/int_model.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/operations/int_model.py index a2b06061ed5cb..8474f7d5cdf3d 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/operations/int_model.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/operations/int_model.py @@ -477,7 +477,7 @@ def get_unix_time( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: long + :rtype: datetime :rtype: :class:`ClientRawResponse` if raw=true """ @@ -503,7 +503,7 @@ def get_unix_time( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('long', response) + deserialized = self._deserialize('unix-time', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -517,7 +517,7 @@ def put_unix_time_date( Put datetime encoded as Unix time :param int_body: - :type int_body: long + :type int_body: datetime :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -540,7 +540,7 @@ def put_unix_time_date( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(int_body, 'long') + body_content = self._serialize.body(int_body, 'unix-time') # Construct and send request request = self._client.put(url, query_parameters) @@ -564,7 +564,7 @@ def get_invalid_unix_time( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: long + :rtype: datetime :rtype: :class:`ClientRawResponse` if raw=true """ @@ -590,7 +590,7 @@ def get_invalid_unix_time( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('long', response) + deserialized = self._deserialize('unix-time', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -608,7 +608,7 @@ def get_null_unix_time( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: long + :rtype: datetime :rtype: :class:`ClientRawResponse` if raw=true """ @@ -634,7 +634,7 @@ def get_null_unix_time( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('long', response) + deserialized = self._deserialize('unix-time', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyNumber/autorestnumbertestservice/__init__.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyNumber/autorestnumbertestservice/__init__.py index 2de2f291c3a91..b43669b4296b1 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyNumber/autorestnumbertestservice/__init__.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyNumber/autorestnumbertestservice/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_number_test_service import AutoRestNumberTestService, AutoRestNumberTestServiceConfiguration +from .auto_rest_number_test_service import AutoRestNumberTestService from .version import VERSION -__all__ = [ - 'AutoRestNumberTestService', - 'AutoRestNumberTestServiceConfiguration' -] +__all__ = ['AutoRestNumberTestService'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyNumber/autorestnumbertestservice/auto_rest_number_test_service.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyNumber/autorestnumbertestservice/auto_rest_number_test_service.py index ff0cbc28173b6..cbc51e4caf41c 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyNumber/autorestnumbertestservice/auto_rest_number_test_service.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyNumber/autorestnumbertestservice/auto_rest_number_test_service.py @@ -39,21 +39,25 @@ def __init__( class AutoRestNumberTestService(object): """Test Infrastructure for AutoRest - :param config: Configuration for client. - :type config: AutoRestNumberTestServiceConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestNumberTestServiceConfiguration :ivar number: Number operations :vartype number: .operations.Number + + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, base_url=None, filepath=None): - self._client = ServiceClient(None, config) + self.config = AutoRestNumberTestServiceConfiguration(base_url, filepath) + self._client = ServiceClient(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.number = Number( self._client, self.config, self._serialize, self._deserialize) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/__init__.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/__init__.py index 6f40aa482a0e5..e9981a1677572 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/__init__.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_swagger_bat_service import AutoRestSwaggerBATService, AutoRestSwaggerBATServiceConfiguration +from .auto_rest_swagger_bat_service import AutoRestSwaggerBATService from .version import VERSION -__all__ = [ - 'AutoRestSwaggerBATService', - 'AutoRestSwaggerBATServiceConfiguration' -] +__all__ = ['AutoRestSwaggerBATService'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/auto_rest_swagger_bat_service.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/auto_rest_swagger_bat_service.py index 8f31568d50797..d2aca590c6fa5 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/auto_rest_swagger_bat_service.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/auto_rest_swagger_bat_service.py @@ -40,24 +40,28 @@ def __init__( class AutoRestSwaggerBATService(object): """Test Infrastructure for AutoRest Swagger BAT - :param config: Configuration for client. - :type config: AutoRestSwaggerBATServiceConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestSwaggerBATServiceConfiguration :ivar string: String operations :vartype string: .operations.String :ivar enum: Enum operations :vartype enum: .operations.Enum + + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, base_url=None, filepath=None): - self._client = ServiceClient(None, config) + self.config = AutoRestSwaggerBATServiceConfiguration(base_url, filepath) + self._client = ServiceClient(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.string = String( self._client, self.config, self._serialize, self._deserialize) self.enum = Enum( diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/__init__.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/__init__.py index ba883e5e5ac44..55019b8878d29 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/__init__.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_parameterized_host_test_client import AutoRestParameterizedHostTestClient, AutoRestParameterizedHostTestClientConfiguration +from .auto_rest_parameterized_host_test_client import AutoRestParameterizedHostTestClient from .version import VERSION -__all__ = [ - 'AutoRestParameterizedHostTestClient', - 'AutoRestParameterizedHostTestClientConfiguration' -] +__all__ = ['AutoRestParameterizedHostTestClient'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/auto_rest_parameterized_host_test_client.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/auto_rest_parameterized_host_test_client.py index 5839338b5a2d2..bbed94ec1caf1 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/auto_rest_parameterized_host_test_client.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/auto_rest_parameterized_host_test_client.py @@ -46,21 +46,27 @@ def __init__( class AutoRestParameterizedHostTestClient(object): """Test Infrastructure for AutoRest - :param config: Configuration for client. - :type config: AutoRestParameterizedHostTestClientConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestParameterizedHostTestClientConfiguration :ivar paths: Paths operations :vartype paths: .operations.Paths + + :param host: A string value that is used as a global part of the + parameterized host + :type host: str + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, host, filepath=None): - self._client = ServiceClient(None, config) + self.config = AutoRestParameterizedHostTestClientConfiguration(host, filepath) + self._client = ServiceClient(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.paths = Paths( self._client, self.config, self._serialize, self._deserialize) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/__init__.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/__init__.py index 6711cf5b14df9..edfa86f280067 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/__init__.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_parameterized_custom_host_test_client import AutoRestParameterizedCustomHostTestClient, AutoRestParameterizedCustomHostTestClientConfiguration +from .auto_rest_parameterized_custom_host_test_client import AutoRestParameterizedCustomHostTestClient from .version import VERSION -__all__ = [ - 'AutoRestParameterizedCustomHostTestClient', - 'AutoRestParameterizedCustomHostTestClientConfiguration' -] +__all__ = ['AutoRestParameterizedCustomHostTestClient'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/auto_rest_parameterized_custom_host_test_client.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/auto_rest_parameterized_custom_host_test_client.py index 6a61d697f46ef..3b659079f1922 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/auto_rest_parameterized_custom_host_test_client.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/auto_rest_parameterized_custom_host_test_client.py @@ -53,21 +53,29 @@ def __init__( class AutoRestParameterizedCustomHostTestClient(object): """Test Infrastructure for AutoRest - :param config: Configuration for client. - :type config: AutoRestParameterizedCustomHostTestClientConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestParameterizedCustomHostTestClientConfiguration :ivar paths: Paths operations :vartype paths: .operations.Paths + + :param subscription_id: The subscription id with value 'test12'. + :type subscription_id: str + :param dns_suffix: A string value that is used as a global part of the + parameterized host. Default value 'host'. + :type dns_suffix: str + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, subscription_id, dns_suffix, filepath=None): - self._client = ServiceClient(None, config) + self.config = AutoRestParameterizedCustomHostTestClientConfiguration(subscription_id, dns_suffix, filepath) + self._client = ServiceClient(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.paths = Paths( self._client, self.config, self._serialize, self._deserialize) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Header/autorestswaggerbatheaderservice/__init__.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Header/autorestswaggerbatheaderservice/__init__.py index 6068e7d5e068d..60f936ea909a8 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Header/autorestswaggerbatheaderservice/__init__.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Header/autorestswaggerbatheaderservice/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_swagger_bat_header_service import AutoRestSwaggerBATHeaderService, AutoRestSwaggerBATHeaderServiceConfiguration +from .auto_rest_swagger_bat_header_service import AutoRestSwaggerBATHeaderService from .version import VERSION -__all__ = [ - 'AutoRestSwaggerBATHeaderService', - 'AutoRestSwaggerBATHeaderServiceConfiguration' -] +__all__ = ['AutoRestSwaggerBATHeaderService'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Header/autorestswaggerbatheaderservice/auto_rest_swagger_bat_header_service.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Header/autorestswaggerbatheaderservice/auto_rest_swagger_bat_header_service.py index 65e70d44935bb..353542329d891 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Header/autorestswaggerbatheaderservice/auto_rest_swagger_bat_header_service.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Header/autorestswaggerbatheaderservice/auto_rest_swagger_bat_header_service.py @@ -39,21 +39,25 @@ def __init__( class AutoRestSwaggerBATHeaderService(object): """Test Infrastructure for AutoRest - :param config: Configuration for client. - :type config: AutoRestSwaggerBATHeaderServiceConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestSwaggerBATHeaderServiceConfiguration :ivar header: Header operations :vartype header: .operations.Header + + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, base_url=None, filepath=None): - self._client = ServiceClient(None, config) + self.config = AutoRestSwaggerBATHeaderServiceConfiguration(base_url, filepath) + self._client = ServiceClient(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.header = Header( self._client, self.config, self._serialize, self._deserialize) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/__init__.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/__init__.py index 8e690ea9480fa..539c0efb2a9a9 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/__init__.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_http_infrastructure_test_service import AutoRestHttpInfrastructureTestService, AutoRestHttpInfrastructureTestServiceConfiguration +from .auto_rest_http_infrastructure_test_service import AutoRestHttpInfrastructureTestService from .version import VERSION -__all__ = [ - 'AutoRestHttpInfrastructureTestService', - 'AutoRestHttpInfrastructureTestServiceConfiguration' -] +__all__ = ['AutoRestHttpInfrastructureTestService'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/auto_rest_http_infrastructure_test_service.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/auto_rest_http_infrastructure_test_service.py index a70f0e4750f87..c7c9308ea102f 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/auto_rest_http_infrastructure_test_service.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/auto_rest_http_infrastructure_test_service.py @@ -45,8 +45,8 @@ def __init__( class AutoRestHttpInfrastructureTestService(object): """Test Infrastructure for AutoRest - :param config: Configuration for client. - :type config: AutoRestHttpInfrastructureTestServiceConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestHttpInfrastructureTestServiceConfiguration :ivar http_failure: HttpFailure operations :vartype http_failure: .operations.HttpFailure @@ -62,17 +62,21 @@ class AutoRestHttpInfrastructureTestService(object): :vartype http_retry: .operations.HttpRetry :ivar multiple_responses: MultipleResponses operations :vartype multiple_responses: .operations.MultipleResponses + + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, base_url=None, filepath=None): - self._client = ServiceClient(None, config) + self.config = AutoRestHttpInfrastructureTestServiceConfiguration(base_url, filepath) + self._client = ServiceClient(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.http_failure = HttpFailure( self._client, self.config, self._serialize, self._deserialize) self.http_success = HttpSuccess( diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ModelFlattening/autorestresourceflatteningtestservice/__init__.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ModelFlattening/autorestresourceflatteningtestservice/__init__.py index a81829bba4a6a..f01b0f4d27100 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ModelFlattening/autorestresourceflatteningtestservice/__init__.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ModelFlattening/autorestresourceflatteningtestservice/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_resource_flattening_test_service import AutoRestResourceFlatteningTestService, AutoRestResourceFlatteningTestServiceConfiguration +from .auto_rest_resource_flattening_test_service import AutoRestResourceFlatteningTestService from .version import VERSION -__all__ = [ - 'AutoRestResourceFlatteningTestService', - 'AutoRestResourceFlatteningTestServiceConfiguration' -] +__all__ = ['AutoRestResourceFlatteningTestService'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ModelFlattening/autorestresourceflatteningtestservice/auto_rest_resource_flattening_test_service.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ModelFlattening/autorestresourceflatteningtestservice/auto_rest_resource_flattening_test_service.py index b0a90b0981ec1..2c737ce3767d2 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ModelFlattening/autorestresourceflatteningtestservice/auto_rest_resource_flattening_test_service.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ModelFlattening/autorestresourceflatteningtestservice/auto_rest_resource_flattening_test_service.py @@ -39,19 +39,23 @@ def __init__( class AutoRestResourceFlatteningTestService(object): """Resource Flattening for AutoRest - :param config: Configuration for client. - :type config: AutoRestResourceFlatteningTestServiceConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestResourceFlatteningTestServiceConfiguration + + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, base_url=None, filepath=None): - self._client = ServiceClient(None, config) + self.config = AutoRestResourceFlatteningTestServiceConfiguration(base_url, filepath) + self._client = ServiceClient(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config def put_array( self, resource_array=None, custom_headers={}, raw=False, **operation_config): @@ -267,7 +271,7 @@ def put_resource_collection( # Construct body if resource_complex_object is not None: - body_content = self._serialize.body(resource_complex_object, 'ResourceCollection') + body_content = self._serialize.body(resource_complex_object, models.ResourceCollection) else: body_content = None @@ -360,7 +364,7 @@ def put_simple_product( # Construct body if simple_body_product is not None: - body_content = self._serialize.body(simple_body_product, 'SimpleProduct') + body_content = self._serialize.body(simple_body_product, models.SimpleProduct) else: body_content = None @@ -429,7 +433,7 @@ def post_flattened_simple_product( # Construct body if simple_body_product is not None: - body_content = self._serialize.body(simple_body_product, 'SimpleProduct') + body_content = self._serialize.body(simple_body_product, models.SimpleProduct) else: body_content = None @@ -511,7 +515,7 @@ def put_simple_product_with_grouping( # Construct body if simple_body_product is not None: - body_content = self._serialize.body(simple_body_product, 'SimpleProduct') + body_content = self._serialize.body(simple_body_product, models.SimpleProduct) else: body_content = None diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/__init__.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/__init__.py index d7676b401a1e3..eb1fb871fdd18 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/__init__.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_parameter_flattening import AutoRestParameterFlattening, AutoRestParameterFlatteningConfiguration +from .auto_rest_parameter_flattening import AutoRestParameterFlattening from .version import VERSION -__all__ = [ - 'AutoRestParameterFlattening', - 'AutoRestParameterFlatteningConfiguration' -] +__all__ = ['AutoRestParameterFlattening'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/auto_rest_parameter_flattening.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/auto_rest_parameter_flattening.py index de25b7d5f0a74..35cc30f5052d9 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/auto_rest_parameter_flattening.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/auto_rest_parameter_flattening.py @@ -39,21 +39,25 @@ def __init__( class AutoRestParameterFlattening(object): """Resource Flattening for AutoRest - :param config: Configuration for client. - :type config: AutoRestParameterFlatteningConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestParameterFlatteningConfiguration :ivar availability_sets: AvailabilitySets operations :vartype availability_sets: .operations.AvailabilitySets + + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, base_url=None, filepath=None): - self._client = ServiceClient(None, config) + self.config = AutoRestParameterFlatteningConfiguration(base_url, filepath) + self._client = ServiceClient(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.availability_sets = AvailabilitySets( self._client, self.config, self._serialize, self._deserialize) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/operations/availability_sets.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/operations/availability_sets.py index ec69672916dca..5728b0ee3d15b 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/operations/availability_sets.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/operations/availability_sets.py @@ -72,7 +72,7 @@ def update( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(tags1, 'AvailabilitySetUpdateParameters') + body_content = self._serialize.body(tags1, models.AvailabilitySetUpdateParameters) # Construct and send request request = self._client.patch(url, query_parameters) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Report/autorestreportservice/__init__.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Report/autorestreportservice/__init__.py index 8ecae208fac42..22573b1921a87 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Report/autorestreportservice/__init__.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Report/autorestreportservice/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_report_service import AutoRestReportService, AutoRestReportServiceConfiguration +from .auto_rest_report_service import AutoRestReportService from .version import VERSION -__all__ = [ - 'AutoRestReportService', - 'AutoRestReportServiceConfiguration' -] +__all__ = ['AutoRestReportService'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Report/autorestreportservice/auto_rest_report_service.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Report/autorestreportservice/auto_rest_report_service.py index 333455a14a14c..31aeda82eab30 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Report/autorestreportservice/auto_rest_report_service.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Report/autorestreportservice/auto_rest_report_service.py @@ -39,19 +39,23 @@ def __init__( class AutoRestReportService(object): """Test Infrastructure for AutoRest - :param config: Configuration for client. - :type config: AutoRestReportServiceConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestReportServiceConfiguration + + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, base_url=None, filepath=None): - self._client = ServiceClient(None, config) + self.config = AutoRestReportServiceConfiguration(base_url, filepath) + self._client = ServiceClient(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config def get_report( self, custom_headers={}, raw=False, **operation_config): diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/__init__.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/__init__.py index 260d9c07a819d..23a6ed29f55e3 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/__init__.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_required_optional_test_service import AutoRestRequiredOptionalTestService, AutoRestRequiredOptionalTestServiceConfiguration +from .auto_rest_required_optional_test_service import AutoRestRequiredOptionalTestService from .version import VERSION -__all__ = [ - 'AutoRestRequiredOptionalTestService', - 'AutoRestRequiredOptionalTestServiceConfiguration' -] +__all__ = ['AutoRestRequiredOptionalTestService'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/auto_rest_required_optional_test_service.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/auto_rest_required_optional_test_service.py index 7dcce131d92ad..d9549ba15ea8a 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/auto_rest_required_optional_test_service.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/auto_rest_required_optional_test_service.py @@ -58,24 +58,34 @@ def __init__( class AutoRestRequiredOptionalTestService(object): """Test Infrastructure for AutoRest - :param config: Configuration for client. - :type config: AutoRestRequiredOptionalTestServiceConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestRequiredOptionalTestServiceConfiguration :ivar implicit: Implicit operations :vartype implicit: .operations.Implicit :ivar explicit: Explicit operations :vartype explicit: .operations.Explicit + + :param required_global_path: number of items to skip + :type required_global_path: str + :param required_global_query: number of items to skip + :type required_global_query: str + :param optional_global_query: number of items to skip + :type optional_global_query: int + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, required_global_path, required_global_query, optional_global_query=None, base_url=None, filepath=None): - self._client = ServiceClient(None, config) + self.config = AutoRestRequiredOptionalTestServiceConfiguration(required_global_path, required_global_query, optional_global_query, base_url, filepath) + self._client = ServiceClient(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.implicit = Implicit( self._client, self.config, self._serialize, self._deserialize) self.explicit = Explicit( diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/operations/explicit.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/operations/explicit.py index 4f56d1d617c05..f4f0239b0e480 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/operations/explicit.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/RequiredOptional/autorestrequiredoptionaltestservice/operations/explicit.py @@ -156,7 +156,7 @@ def post_required_integer_property( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(body_parameter, 'IntWrapper') + body_content = self._serialize.body(body_parameter, models.IntWrapper) # Construct and send request request = self._client.post(url, query_parameters) @@ -205,7 +205,7 @@ def post_optional_integer_property( # Construct body if body_parameter is not None: - body_content = self._serialize.body(body_parameter, 'IntOptionalWrapper') + body_content = self._serialize.body(body_parameter, models.IntOptionalWrapper) else: body_content = None @@ -431,7 +431,7 @@ def post_required_string_property( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(body_parameter, 'StringWrapper') + body_content = self._serialize.body(body_parameter, models.StringWrapper) # Construct and send request request = self._client.post(url, query_parameters) @@ -480,7 +480,7 @@ def post_optional_string_property( # Construct body if body_parameter is not None: - body_content = self._serialize.body(body_parameter, 'StringOptionalWrapper') + body_content = self._serialize.body(body_parameter, models.StringOptionalWrapper) else: body_content = None @@ -613,7 +613,7 @@ def post_required_class_parameter( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(body_parameter, 'Product') + body_content = self._serialize.body(body_parameter, models.Product) # Construct and send request request = self._client.post(url, query_parameters) @@ -658,7 +658,7 @@ def post_optional_class_parameter( # Construct body if body_parameter is not None: - body_content = self._serialize.body(body_parameter, 'Product') + body_content = self._serialize.body(body_parameter, models.Product) else: body_content = None @@ -709,7 +709,7 @@ def post_required_class_property( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(body_parameter, 'ClassWrapper') + body_content = self._serialize.body(body_parameter, models.ClassWrapper) # Construct and send request request = self._client.post(url, query_parameters) @@ -759,7 +759,7 @@ def post_optional_class_property( # Construct body if body_parameter is not None: - body_content = self._serialize.body(body_parameter, 'ClassOptionalWrapper') + body_content = self._serialize.body(body_parameter, models.ClassOptionalWrapper) else: body_content = None @@ -900,7 +900,7 @@ def post_required_array_property( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(body_parameter, 'ArrayWrapper') + body_content = self._serialize.body(body_parameter, models.ArrayWrapper) # Construct and send request request = self._client.post(url, query_parameters) @@ -949,7 +949,7 @@ def post_optional_array_property( # Construct body if body_parameter is not None: - body_content = self._serialize.body(body_parameter, 'ArrayOptionalWrapper') + body_content = self._serialize.body(body_parameter, models.ArrayOptionalWrapper) else: body_content = None diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/__init__.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/__init__.py index fc6d1efe1f583..523c4f1401789 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/__init__.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_url_test_service import AutoRestUrlTestService, AutoRestUrlTestServiceConfiguration +from .auto_rest_url_test_service import AutoRestUrlTestService from .version import VERSION -__all__ = [ - 'AutoRestUrlTestService', - 'AutoRestUrlTestServiceConfiguration' -] +__all__ = ['AutoRestUrlTestService'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/auto_rest_url_test_service.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/auto_rest_url_test_service.py index 34efde192fd6b..0c6834405656c 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/auto_rest_url_test_service.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/auto_rest_url_test_service.py @@ -55,8 +55,8 @@ def __init__( class AutoRestUrlTestService(object): """Test Infrastructure for AutoRest - :param config: Configuration for client. - :type config: AutoRestUrlTestServiceConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestUrlTestServiceConfiguration :ivar paths: Paths operations :vartype paths: .operations.Paths @@ -64,17 +64,26 @@ class AutoRestUrlTestService(object): :vartype queries: .operations.Queries :ivar path_items: PathItems operations :vartype path_items: .operations.PathItems + + :param global_string_path: A string value 'globalItemStringPath' that + appears in the path + :type global_string_path: str + :param global_string_query: should contain value null + :type global_string_query: str + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, global_string_path, global_string_query=None, base_url=None, filepath=None): - self._client = ServiceClient(None, config) + self.config = AutoRestUrlTestServiceConfiguration(global_string_path, global_string_query, base_url, filepath) + self._client = ServiceClient(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.paths = Paths( self._client, self.config, self._serialize, self._deserialize) self.queries = Queries( diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/paths.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/paths.py index c419d607826a2..3e6e638a031b2 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/paths.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/paths.py @@ -1121,7 +1121,7 @@ def unix_time_url( Get the date 2016-04-13 encoded value as '1460505600' (Unix time) :param unix_time_url_path: Unix time encoded value - :type unix_time_url_path: long + :type unix_time_url_path: datetime :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -1134,7 +1134,7 @@ def unix_time_url( # Construct URL url = '/paths/int/1460505600/{unixTimeUrlPath}' path_format_arguments = { - 'unixTimeUrlPath': self._serialize.url("unix_time_url_path", unix_time_url_path, 'long') + 'unixTimeUrlPath': self._serialize.url("unix_time_url_path", unix_time_url_path, 'unix-time') } url = self._client.format_url(url, **path_format_arguments) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Validation/autorestvalidationtest/__init__.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Validation/autorestvalidationtest/__init__.py index 202f03f0f743e..885383be0a477 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Validation/autorestvalidationtest/__init__.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Validation/autorestvalidationtest/__init__.py @@ -9,13 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_rest_validation_test import AutoRestValidationTest, AutoRestValidationTestConfiguration +from .auto_rest_validation_test import AutoRestValidationTest from .version import VERSION -__all__ = [ - 'AutoRestValidationTest', - 'AutoRestValidationTestConfiguration' -] +__all__ = ['AutoRestValidationTest'] __version__ = VERSION diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Validation/autorestvalidationtest/auto_rest_validation_test.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Validation/autorestvalidationtest/auto_rest_validation_test.py index f9a6b88ede469..9d63617ddbbfd 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Validation/autorestvalidationtest/auto_rest_validation_test.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Validation/autorestvalidationtest/auto_rest_validation_test.py @@ -55,19 +55,27 @@ def __init__( class AutoRestValidationTest(object): """Test Infrastructure for AutoRest. No server backend exists for these tests. - :param config: Configuration for client. - :type config: AutoRestValidationTestConfiguration + :ivar config: Configuration for client. + :vartype config: AutoRestValidationTestConfiguration + + :param subscription_id: Subscription ID. + :type subscription_id: str + :param api_version: Required string following pattern \\d{2}-\\d{2}-\\d{4} + :type api_version: str + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, subscription_id, api_version, base_url=None, filepath=None): - self._client = ServiceClient(None, config) + self.config = AutoRestValidationTestConfiguration(subscription_id, api_version, base_url, filepath) + self._client = ServiceClient(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config def validation_of_method_parameters( self, resource_group_name, id, custom_headers={}, raw=False, **operation_config): @@ -170,7 +178,7 @@ def validation_of_body( # Construct body if body is not None: - body_content = self._serialize.body(body, 'Product') + body_content = self._serialize.body(body, models.Product) else: body_content = None @@ -272,7 +280,7 @@ def post_with_constant_in_body( # Construct body if body is not None: - body_content = self._serialize.body(body, 'Product') + body_content = self._serialize.body(body, models.Product) else: body_content = None diff --git a/Samples/azure-storage/Azure.Python/storagemanagementclient/__init__.py b/Samples/azure-storage/Azure.Python/storagemanagementclient/__init__.py index 8da05fb0ca8e6..4ef2ad5559905 100644 --- a/Samples/azure-storage/Azure.Python/storagemanagementclient/__init__.py +++ b/Samples/azure-storage/Azure.Python/storagemanagementclient/__init__.py @@ -2,13 +2,10 @@ # -------------------------------------------------------------------------- # -------------------------------------------------------------------------- -from .storage_management_client import StorageManagementClient, StorageManagementClientConfiguration +from .storage_management_client import StorageManagementClient from .version import VERSION -__all__ = [ - 'StorageManagementClient', - 'StorageManagementClientConfiguration' -] +__all__ = ['StorageManagementClient'] __version__ = VERSION diff --git a/Samples/azure-storage/Azure.Python/storagemanagementclient/operations/storage_accounts_operations.py b/Samples/azure-storage/Azure.Python/storagemanagementclient/operations/storage_accounts_operations.py index ef19c00fbeeac..e8412716ef696 100644 --- a/Samples/azure-storage/Azure.Python/storagemanagementclient/operations/storage_accounts_operations.py +++ b/Samples/azure-storage/Azure.Python/storagemanagementclient/operations/storage_accounts_operations.py @@ -71,7 +71,7 @@ def check_name_availability( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(account_name, 'StorageAccountCheckNameAvailabilityParameters') + body_content = self._serialize.body(account_name, models.StorageAccountCheckNameAvailabilityParameters) # Construct and send request request = self._client.post(url, query_parameters) @@ -148,7 +148,7 @@ def create( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'StorageAccountCreateParameters') + body_content = self._serialize.body(parameters, models.StorageAccountCreateParameters) # Construct and send request def long_running_send(): @@ -380,7 +380,7 @@ def update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'StorageAccountUpdateParameters') + body_content = self._serialize.body(parameters, models.StorageAccountUpdateParameters) # Construct and send request request = self._client.patch(url, query_parameters) @@ -650,7 +650,7 @@ def regenerate_key( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(regenerate_key, 'StorageAccountRegenerateKeyParameters') + body_content = self._serialize.body(regenerate_key, models.StorageAccountRegenerateKeyParameters) # Construct and send request request = self._client.post(url, query_parameters) diff --git a/Samples/azure-storage/Azure.Python/storagemanagementclient/storage_management_client.py b/Samples/azure-storage/Azure.Python/storagemanagementclient/storage_management_client.py index 00031c87fca75..8c665e4cf9c40 100644 --- a/Samples/azure-storage/Azure.Python/storagemanagementclient/storage_management_client.py +++ b/Samples/azure-storage/Azure.Python/storagemanagementclient/storage_management_client.py @@ -71,24 +71,47 @@ def __init__( class StorageManagementClient(object): """The Storage Management Client. - :param config: Configuration for client. - :type config: StorageManagementClientConfiguration + :ivar config: Configuration for client. + :vartype config: StorageManagementClientConfiguration :ivar storage_accounts: StorageAccounts operations :vartype storage_accounts: .operations.StorageAccountsOperations :ivar usage: Usage operations :vartype usage: .operations.UsageOperations + + :param credentials: Gets Azure subscription credentials. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Gets subscription credentials which uniquely + identify Microsoft Azure subscription. The subscription ID forms part of + the URI for every service call. + :type subscription_id: str + :param api_version: Client Api Version. + :type api_version: str + :param accept_language: Gets or sets the preferred language for the + response. + :type accept_language: str + :param long_running_operation_retry_timeout: Gets or sets the retry + timeout in seconds for Long Running Operations. Default value is 30. + :type long_running_operation_retry_timeout: int + :param generate_client_request_id: When set to true a unique + x-ms-client-request-id value is generated and included in each request. + Default is true. + :type generate_client_request_id: bool + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, credentials, subscription_id, api_version='2015-06-15', accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, base_url=None, filepath=None): - self._client = ServiceClient(config.credentials, config) + self.config = StorageManagementClientConfiguration(credentials, subscription_id, api_version, accept_language, long_running_operation_retry_timeout, generate_client_request_id, base_url, filepath) + self._client = ServiceClient(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config self.storage_accounts = StorageAccountsOperations( self._client, self.config, self._serialize, self._deserialize) self.usage = UsageOperations( diff --git a/Samples/petstore/Python/swaggerpetstore/__init__.py b/Samples/petstore/Python/swaggerpetstore/__init__.py index 0caab4f5c7c79..06086d20d52d0 100644 --- a/Samples/petstore/Python/swaggerpetstore/__init__.py +++ b/Samples/petstore/Python/swaggerpetstore/__init__.py @@ -2,13 +2,10 @@ # -------------------------------------------------------------------------- # -------------------------------------------------------------------------- -from .swagger_petstore import SwaggerPetstore, SwaggerPetstoreConfiguration +from .swagger_petstore import SwaggerPetstore from .version import VERSION -__all__ = [ - 'SwaggerPetstore', - 'SwaggerPetstoreConfiguration' -] +__all__ = ['SwaggerPetstore'] __version__ = VERSION diff --git a/Samples/petstore/Python/swaggerpetstore/swagger_petstore.py b/Samples/petstore/Python/swaggerpetstore/swagger_petstore.py index 461a21d5e6993..ebc0bb5e009e9 100644 --- a/Samples/petstore/Python/swaggerpetstore/swagger_petstore.py +++ b/Samples/petstore/Python/swaggerpetstore/swagger_petstore.py @@ -33,19 +33,23 @@ def __init__( class SwaggerPetstore(object): """This is a sample server Petstore server. You can find out more about Swagger at <a href="http://swagger.io">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key "special-key" to test the authorization filters - :param config: Configuration for client. - :type config: SwaggerPetstoreConfiguration + :ivar config: Configuration for client. + :vartype config: SwaggerPetstoreConfiguration + + :param str base_url: Service URL + :param str filepath: Existing config """ - def __init__(self, config): + def __init__( + self, base_url=None, filepath=None): - self._client = ServiceClient(None, config) + self.config = SwaggerPetstoreConfiguration(base_url, filepath) + self._client = ServiceClient(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer() self._deserialize = Deserializer(client_models) - self.config = config def add_pet_using_byte_array( self, body=None, custom_headers={}, raw=False, **operation_config): @@ -124,7 +128,7 @@ def add_pet( # Construct body if body is not None: - body_content = self._serialize.body(body, 'Pet') + body_content = self._serialize.body(body, models.Pet) else: body_content = None @@ -170,7 +174,7 @@ def update_pet( # Construct body if body is not None: - body_content = self._serialize.body(body, 'Pet') + body_content = self._serialize.body(body, models.Pet) else: body_content = None @@ -619,7 +623,7 @@ def place_order( # Construct body if body is not None: - body_content = self._serialize.body(body, 'Order') + body_content = self._serialize.body(body, models.Order) else: body_content = None @@ -770,7 +774,7 @@ def create_user( # Construct body if body is not None: - body_content = self._serialize.body(body, 'User') + body_content = self._serialize.body(body, models.User) else: body_content = None @@ -1055,7 +1059,7 @@ def update_user( # Construct body if body is not None: - body_content = self._serialize.body(body, 'User') + body_content = self._serialize.body(body, models.User) else: body_content = None