diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/AcceptanceTests/azureCustomBaseUri.js b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/AcceptanceTests/azureCustomBaseUri.js index 70960a0e08..c50f1f521a 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/AcceptanceTests/azureCustomBaseUri.js +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/AcceptanceTests/azureCustomBaseUri.js @@ -18,7 +18,8 @@ var clientOptions = {}; describe('nodejs', function () { describe('Custom BaseUri Client', function () { - var testClient = new customBaseUriClient(credentials, 'host:3000', clientOptions); + clientOptions.host = 'host:3000'; + var testClient = new customBaseUriClient(credentials, clientOptions); it('should return 200', function (done) { testClient.paths.getEmpty('local', function (error, result, request, response) { should.not.exist(error); diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUri/autoRestParameterizedHostTestClient.d.ts b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUri/autoRestParameterizedHostTestClient.d.ts index 59cea5a89b..5092268e0d 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUri/autoRestParameterizedHostTestClient.d.ts +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUri/autoRestParameterizedHostTestClient.d.ts @@ -19,8 +19,6 @@ declare class AutoRestParameterizedHostTestClient { * * @param {credentials} credentials - Gets Azure subscription credentials. * - * @param {string} host - A string value that is used as a global part of the parameterized host - * * @param {object} [options] - The parameter options * * @param {Array} [options.filters] - Filters to be added to the request pipeline @@ -30,6 +28,8 @@ declare class AutoRestParameterizedHostTestClient { * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * + * @param {string} [options.host] - A string value that is used as a global part of the parameterized host + * * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. * * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. @@ -37,7 +37,7 @@ declare class AutoRestParameterizedHostTestClient { * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * */ - constructor(credentials: ServiceClientCredentials, host: string, options: ServiceClientOptions); + constructor(credentials: ServiceClientCredentials, options: ServiceClientOptions); credentials: ServiceClientCredentials; diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUri/autoRestParameterizedHostTestClient.js b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUri/autoRestParameterizedHostTestClient.js index 9c7f803b70..43f7a3c828 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUri/autoRestParameterizedHostTestClient.js +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUri/autoRestParameterizedHostTestClient.js @@ -29,8 +29,6 @@ var operations = require('./operations'); * * @param {credentials} credentials - Gets Azure subscription credentials. * - * @param {string} host - A string value that is used as a global part of the parameterized host - * * @param {object} [options] - The parameter options * * @param {Array} [options.filters] - Filters to be added to the request pipeline @@ -40,6 +38,8 @@ var operations = require('./operations'); * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * + * @param {string} [options.host] - A string value that is used as a global part of the parameterized host + * * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. * * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. @@ -47,7 +47,7 @@ var operations = require('./operations'); * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * */ -function AutoRestParameterizedHostTestClient(credentials, host, options) { +function AutoRestParameterizedHostTestClient(credentials, options) { this.host = 'host'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; @@ -55,19 +55,16 @@ function AutoRestParameterizedHostTestClient(credentials, host, options) { if (credentials === null || credentials === undefined) { throw new Error('\'credentials\' cannot be null.'); } - if (host === null || host === undefined) { - throw new Error('\'host\' cannot be null.'); - } if (!options) options = {}; AutoRestParameterizedHostTestClient['super_'].call(this, credentials, options); - if (!this.baseUri) { - this.baseUri = 'http://{accountName}{host}'; - } + this.baseUri = 'http://{accountName}{host}'; this.credentials = credentials; - this.host = host; + if(options.host !== null && options.host !== undefined) { + this.host = options.host; + } if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { this.acceptLanguage = options.acceptLanguage; } diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS/Templates/AzureServiceClientTemplate.cshtml b/AutoRest/Generators/NodeJS/Azure.NodeJS/Templates/AzureServiceClientTemplate.cshtml index cdfc5a425e..e0639dec63 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS/Templates/AzureServiceClientTemplate.cshtml +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS/Templates/AzureServiceClientTemplate.cshtml @@ -40,8 +40,8 @@ var ServiceClient = msRestAzure.AzureServiceClient; @:var operations = require('./operations'); } @EmptyLine -@{var requiredParameters = Model.Properties.Where(p => p.IsRequired && !p.IsConstant);} -@{var optionalParameters = Model.Properties.Where(p => !p.IsRequired && !p.IsConstant);} +@{var requiredParameters = Model.Properties.Where(p => p.IsRequired && !p.IsConstant && string.IsNullOrEmpty(p.DefaultValue));} +@{var optionalParameters = Model.Properties.Where(p => (!p.IsRequired || p.IsRequired && !string.IsNullOrEmpty(p.DefaultValue)) && !p.IsConstant);} /** * @@class * Initializes a new instance of the @Model.Name class. @@ -73,7 +73,7 @@ var ServiceClient = msRestAzure.AzureServiceClient; @: * } */ -function @(Model.Name)(@(Model.RequiredConstructorParameters), options) { +function @(Model.Name)(@(!string.IsNullOrEmpty(Model.RequiredConstructorParameters) ? Model.RequiredConstructorParameters + ", " : "")options) { @foreach (var property in Model.Properties.Where(p => p.DefaultValue != null)) { @:this.@(property.Name) = @(property.DefaultValue); @@ -91,11 +91,16 @@ function @(Model.Name)(@(Model.RequiredConstructorParameters), options) { @if(!Model.IsCustomBaseUri) { @:this.baseUri = baseUri; + @:if (!this.baseUri) { + @:this.baseUri = '@Model.BaseUrl'; + @:} +} +else +{ + @:this.baseUri = '@Model.BaseUrl'; } - if (!this.baseUri) { - this.baseUri = '@Model.BaseUrl'; - } + @foreach (var param in requiredParameters) { @: this.@(param.Name) = @(param.Name); diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS/Templates/AzureServiceClientTemplateTS.cshtml b/AutoRest/Generators/NodeJS/Azure.NodeJS/Templates/AzureServiceClientTemplateTS.cshtml index b7142e35c4..5448c378c4 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS/Templates/AzureServiceClientTemplateTS.cshtml +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS/Templates/AzureServiceClientTemplateTS.cshtml @@ -18,8 +18,8 @@ import { ServiceClientOptions, RequestOptions, ServiceCallback, ServiceClientCre } @EmptyLine declare class @(Model.Name) { - @{var requiredParameters = Model.Properties.Where(p => p.IsRequired && !p.IsConstant);} - @{var optionalParameters = Model.Properties.Where(p => !p.IsRequired && !p.IsConstant);} + @{var requiredParameters = Model.Properties.Where(p => p.IsRequired && !p.IsConstant && string.IsNullOrEmpty(p.DefaultValue));} + @{var optionalParameters = Model.Properties.Where(p => (!p.IsRequired || p.IsRequired && !string.IsNullOrEmpty(p.DefaultValue)) && !p.IsConstant);} /** * @@class * Initializes a new instance of the @Model.Name class. @@ -52,7 +52,7 @@ declare class @(Model.Name) { @: * } */ - constructor(@(Model.RequiredConstructorParametersTS), options: ServiceClientOptions); + constructor(@(!string.IsNullOrEmpty(Model.RequiredConstructorParametersTS) ? Model.RequiredConstructorParametersTS + ", " : "")options: ServiceClientOptions); @foreach (var property in Model.Properties) { diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/AcceptanceTests/acceptanceTests.ts b/AutoRest/Generators/NodeJS/NodeJS.Tests/AcceptanceTests/acceptanceTests.ts index 52e27445dc..c7404da84e 100644 --- a/AutoRest/Generators/NodeJS/NodeJS.Tests/AcceptanceTests/acceptanceTests.ts +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/AcceptanceTests/acceptanceTests.ts @@ -65,7 +65,10 @@ describe('nodejs', function () { describe('Swagger BAT', function () { describe('Custom BaseUri Client', function () { - var testClient = new customBaseUriClient('host:3000', clientOptions); + var customOptions = { + host: 'host:3000' + }; + var testClient = new customBaseUriClient(customOptions); it('should return 200', function (done) { testClient.paths.getEmpty('local', function (error, result, request, response) { should.not.exist(error); diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUri/autoRestParameterizedHostTestClient.d.ts b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUri/autoRestParameterizedHostTestClient.d.ts index 7dfd384801..55373a0e96 100644 --- a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUri/autoRestParameterizedHostTestClient.d.ts +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUri/autoRestParameterizedHostTestClient.d.ts @@ -17,8 +17,6 @@ declare class AutoRestParameterizedHostTestClient { * Initializes a new instance of the AutoRestParameterizedHostTestClient class. * @constructor * - * @param {string} host - A string value that is used as a global part of the parameterized host - * * @param {object} [options] - The parameter options * * @param {Array} [options.filters] - Filters to be added to the request pipeline @@ -28,8 +26,10 @@ declare class AutoRestParameterizedHostTestClient { * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * + * @param {string} [options.host] - A string value that is used as a global part of the parameterized host + * */ - constructor(host: string, options: ServiceClientOptions); + constructor(options: ServiceClientOptions); host: string; diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUri/autoRestParameterizedHostTestClient.js b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUri/autoRestParameterizedHostTestClient.js index 96817a9819..84e01146a9 100644 --- a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUri/autoRestParameterizedHostTestClient.js +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUri/autoRestParameterizedHostTestClient.js @@ -26,8 +26,6 @@ var operations = require('./operations'); * Initializes a new instance of the AutoRestParameterizedHostTestClient class. * @constructor * - * @param {string} host - A string value that is used as a global part of the parameterized host - * * @param {object} [options] - The parameter options * * @param {Array} [options.filters] - Filters to be added to the request pipeline @@ -37,21 +35,20 @@ var operations = require('./operations'); * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * + * @param {string} [options.host] - A string value that is used as a global part of the parameterized host + * */ -function AutoRestParameterizedHostTestClient(host, options) { +function AutoRestParameterizedHostTestClient(options) { this.host = 'host'; - if (host === null || host === undefined) { - throw new Error('\'host\' cannot be null.'); - } if (!options) options = {}; AutoRestParameterizedHostTestClient['super_'].call(this, null, options); - if (!this.baseUri) { - this.baseUri = 'http://{accountName}{host}'; - } - this.host = host; + this.baseUri = 'http://{accountName}{host}'; + if(options.host !== null && options.host !== undefined) { + this.host = options.host; + } this.paths = new operations.Paths(this); this.models = models; msRest.addSerializationMixin(this); diff --git a/AutoRest/Generators/NodeJS/NodeJS/TemplateModels/ServiceClientTemplateModel.cs b/AutoRest/Generators/NodeJS/NodeJS/TemplateModels/ServiceClientTemplateModel.cs index 577a91bd3e..ec34d6af04 100644 --- a/AutoRest/Generators/NodeJS/NodeJS/TemplateModels/ServiceClientTemplateModel.cs +++ b/AutoRest/Generators/NodeJS/NodeJS/TemplateModels/ServiceClientTemplateModel.cs @@ -154,13 +154,18 @@ public string RequiredConstructorParameters get { var requireParams = new List(); - this.Properties.Where(p => p.IsRequired && !p.IsConstant) + this.Properties.Where(p => p.IsRequired && !p.IsConstant && string.IsNullOrEmpty(p.DefaultValue)) .ForEach(p => requireParams.Add(p.Name.ToCamelCase())); if (!IsCustomBaseUri) { requireParams.Add("baseUri"); } + if(requireParams == null || requireParams.Count == 0) + { + return string.Empty; + } + return string.Join(", ", requireParams); } } @@ -174,7 +179,7 @@ public string RequiredConstructorParametersTS { bool first = true; foreach (var p in this.Properties) { - if (!p.IsRequired || p.IsConstant) + if (!p.IsRequired || p.IsConstant || (p.IsRequired && !string.IsNullOrEmpty(p.DefaultValue))) continue; if (!first) diff --git a/AutoRest/Generators/NodeJS/NodeJS/Templates/ServiceClientTemplate.cshtml b/AutoRest/Generators/NodeJS/NodeJS/Templates/ServiceClientTemplate.cshtml index 07092323c7..0550384017 100644 --- a/AutoRest/Generators/NodeJS/NodeJS/Templates/ServiceClientTemplate.cshtml +++ b/AutoRest/Generators/NodeJS/NodeJS/Templates/ServiceClientTemplate.cshtml @@ -37,8 +37,8 @@ var ServiceClient = msRest.ServiceClient; @:var operations = require('./operations'); } @EmptyLine -@{var requiredParameters = Model.Properties.Where(p => p.IsRequired && !p.IsConstant);} -@{var optionalParameters = Model.Properties.Where(p => !p.IsRequired && !p.IsConstant);} +@{var requiredParameters = Model.Properties.Where(p => p.IsRequired && !p.IsConstant && string.IsNullOrEmpty(p.DefaultValue));} +@{var optionalParameters = Model.Properties.Where(p => (!p.IsRequired || p.IsRequired && !string.IsNullOrEmpty(p.DefaultValue)) && !p.IsConstant);} /** * @@class * Initializes a new instance of the @Model.Name class. @@ -71,7 +71,7 @@ var ServiceClient = msRest.ServiceClient; @: * } */ -function @(Model.Name)(@(Model.RequiredConstructorParameters), options) { +function @(Model.Name)(@(!string.IsNullOrEmpty(Model.RequiredConstructorParameters) ? Model.RequiredConstructorParameters + ", ": "")options) { @foreach (var property in Model.Properties.Where(p => p.DefaultValue != null)) { @:this.@(property.Name) = @(property.DefaultValue); @@ -91,11 +91,17 @@ function @(Model.Name)(@(Model.RequiredConstructorParameters), options) { @if(!Model.IsCustomBaseUri) { @:this.baseUri = baseUri; + + @:if (!this.baseUri) { + @:this.baseUri = '@Model.BaseUrl'; + @:} +} +else +{ + @:this.baseUri = '@Model.BaseUrl'; } - if (!this.baseUri) { - this.baseUri = '@Model.BaseUrl'; - } + @foreach (var param in requiredParameters) { diff --git a/AutoRest/Generators/NodeJS/NodeJS/Templates/ServiceClientTemplateTS.cshtml b/AutoRest/Generators/NodeJS/NodeJS/Templates/ServiceClientTemplateTS.cshtml index 61edf0e006..c9e479a3c9 100644 --- a/AutoRest/Generators/NodeJS/NodeJS/Templates/ServiceClientTemplateTS.cshtml +++ b/AutoRest/Generators/NodeJS/NodeJS/Templates/ServiceClientTemplateTS.cshtml @@ -18,8 +18,8 @@ import { ServiceClientOptions, RequestOptions, ServiceCallback } from 'ms-rest'; } @EmptyLine declare class @(Model.Name) { - @{var requiredParameters = Model.Properties.Where(p => p.IsRequired && !p.IsConstant);} - @{var optionalParameters = Model.Properties.Where(p => !p.IsRequired && !p.IsConstant);} + @{var requiredParameters = Model.Properties.Where(p => p.IsRequired && !p.IsConstant && string.IsNullOrEmpty(p.DefaultValue));} + @{var optionalParameters = Model.Properties.Where(p => (!p.IsRequired || p.IsRequired && !string.IsNullOrEmpty(p.DefaultValue)) && !p.IsConstant);} /** * @@class * Initializes a new instance of the @Model.Name class. @@ -52,7 +52,7 @@ declare class @(Model.Name) { @: * } */ - constructor(@(Model.RequiredConstructorParametersTS), options: ServiceClientOptions); + constructor(@(!string.IsNullOrEmpty(Model.RequiredConstructorParametersTS) ? Model.RequiredConstructorParametersTS + ", ": "")options: ServiceClientOptions); @foreach (var property in Model.Properties) { diff --git a/Samples/azure-storage/Azure.Python/setup.py b/Samples/azure-storage/Azure.Python/setup.py index f3539db297..b9fe5db7a8 100644 --- a/Samples/azure-storage/Azure.Python/setup.py +++ b/Samples/azure-storage/Azure.Python/setup.py @@ -15,7 +15,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -REQUIRES = ["msrest>=0.1.0", "msrestazure>=0.1.0"] +REQUIRES = ["msrest>=0.2.0", "msrestazure>=0.2.1"] setup( name=NAME, diff --git a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/check_name_availability_result.py b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/check_name_availability_result.py index 0bbc5f5c29..1c7ee5c86a 100644 --- a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/check_name_availability_result.py +++ b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/check_name_availability_result.py @@ -28,7 +28,7 @@ class CheckNameAvailabilityResult(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, name_available=None, reason=None, message=None, **kwargs): + def __init__(self, name_available=None, reason=None, message=None): self.name_available = name_available self.reason = reason self.message = message diff --git a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/custom_domain.py b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/custom_domain.py index ee95d5f7d6..77a0857f91 100644 --- a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/custom_domain.py +++ b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/custom_domain.py @@ -27,6 +27,6 @@ class CustomDomain(Model): 'use_sub_domain': {'key': 'useSubDomain', 'type': 'bool'}, } - def __init__(self, name, use_sub_domain=None, **kwargs): + def __init__(self, name, use_sub_domain=None): self.name = name self.use_sub_domain = use_sub_domain diff --git a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/endpoints.py b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/endpoints.py index de3d2386cd..155622f515 100644 --- a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/endpoints.py +++ b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/endpoints.py @@ -27,7 +27,7 @@ class Endpoints(Model): 'file': {'key': 'file', 'type': 'str'}, } - def __init__(self, blob=None, queue=None, table=None, file=None, **kwargs): + def __init__(self, blob=None, queue=None, table=None, file=None): self.blob = blob self.queue = queue self.table = table diff --git a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/resource.py b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/resource.py index 0bcb8add02..e784f71766 100644 --- a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/resource.py +++ b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/resource.py @@ -28,7 +28,7 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, id=None, name=None, type=None, location=None, tags=None, **kwargs): + def __init__(self, id=None, name=None, type=None, location=None, tags=None): self.id = id self.name = name self.type = type diff --git a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account.py b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account.py index 3949fa133f..274af1b587 100644 --- a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account.py +++ b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account.py @@ -33,6 +33,6 @@ class StorageAccount(Resource): 'properties': {'key': 'properties', 'type': 'StorageAccountProperties'}, } - def __init__(self, id=None, name=None, type=None, location=None, tags=None, properties=None, **kwargs): - super(StorageAccount, self).__init__(id=id, name=name, type=type, location=location, tags=tags, **kwargs) + def __init__(self, id=None, name=None, type=None, location=None, tags=None, properties=None): + super(StorageAccount, self).__init__(id=id, name=name, type=type, location=location, tags=tags) self.properties = properties diff --git a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_check_name_availability_parameters.py b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_check_name_availability_parameters.py index 2ee4a450e0..bca58a1d79 100644 --- a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_check_name_availability_parameters.py +++ b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_check_name_availability_parameters.py @@ -23,6 +23,6 @@ class StorageAccountCheckNameAvailabilityParameters(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, name, type="Microsoft.Storage/storageAccounts", **kwargs): + def __init__(self, name, type="Microsoft.Storage/storageAccounts"): self.name = name self.type = type diff --git a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_create_parameters.py b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_create_parameters.py index d490562665..1f5fe04cca 100644 --- a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_create_parameters.py +++ b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_create_parameters.py @@ -28,7 +28,7 @@ class StorageAccountCreateParameters(Model): 'properties': {'key': 'properties', 'type': 'StorageAccountPropertiesCreateParameters'}, } - def __init__(self, location, tags=None, properties=None, **kwargs): + def __init__(self, location, tags=None, properties=None): self.location = location self.tags = tags self.properties = properties diff --git a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_keys.py b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_keys.py index 3bc0943541..171d1d785f 100644 --- a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_keys.py +++ b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_keys.py @@ -20,6 +20,6 @@ class StorageAccountKeys(Model): 'key2': {'key': 'key2', 'type': 'str'}, } - def __init__(self, key1=None, key2=None, **kwargs): + def __init__(self, key1=None, key2=None): self.key1 = key1 self.key2 = key2 diff --git a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_properties.py b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_properties.py index cb58445a1c..2259b66353 100644 --- a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_properties.py +++ b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_properties.py @@ -69,7 +69,7 @@ class StorageAccountProperties(Model): 'secondary_endpoints': {'key': 'secondaryEndpoints', 'type': 'Endpoints'}, } - def __init__(self, provisioning_state=None, account_type=None, primary_endpoints=None, primary_location=None, status_of_primary=None, last_geo_failover_time=None, secondary_location=None, status_of_secondary=None, creation_time=None, custom_domain=None, secondary_endpoints=None, **kwargs): + def __init__(self, provisioning_state=None, account_type=None, primary_endpoints=None, primary_location=None, status_of_primary=None, last_geo_failover_time=None, secondary_location=None, status_of_secondary=None, creation_time=None, custom_domain=None, secondary_endpoints=None): self.provisioning_state = provisioning_state self.account_type = account_type self.primary_endpoints = primary_endpoints diff --git a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_properties_create_parameters.py b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_properties_create_parameters.py index 4d69da5caf..b2d63195ed 100644 --- a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_properties_create_parameters.py +++ b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_properties_create_parameters.py @@ -22,5 +22,5 @@ class StorageAccountPropertiesCreateParameters(Model): 'account_type': {'key': 'accountType', 'type': 'AccountType'}, } - def __init__(self, account_type, **kwargs): + def __init__(self, account_type): self.account_type = account_type diff --git a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_properties_update_parameters.py b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_properties_update_parameters.py index 9a5fbc12e1..a9a27ddebd 100644 --- a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_properties_update_parameters.py +++ b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_properties_update_parameters.py @@ -26,6 +26,6 @@ class StorageAccountPropertiesUpdateParameters(Model): 'custom_domain': {'key': 'customDomain', 'type': 'CustomDomain'}, } - def __init__(self, account_type=None, custom_domain=None, **kwargs): + def __init__(self, account_type=None, custom_domain=None): self.account_type = account_type self.custom_domain = custom_domain diff --git a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_regenerate_key_parameters.py b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_regenerate_key_parameters.py index 04c4ce47cf..057ea3a491 100644 --- a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_regenerate_key_parameters.py +++ b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_regenerate_key_parameters.py @@ -20,5 +20,5 @@ class StorageAccountRegenerateKeyParameters(Model): 'key_name': {'key': 'keyName', 'type': 'str'}, } - def __init__(self, key_name, **kwargs): + def __init__(self, key_name): self.key_name = key_name diff --git a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_update_parameters.py b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_update_parameters.py index f339b37d57..39c5cd78d1 100644 --- a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_update_parameters.py +++ b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/storage_account_update_parameters.py @@ -21,6 +21,6 @@ class StorageAccountUpdateParameters(Model): 'properties': {'key': 'properties', 'type': 'StorageAccountPropertiesUpdateParameters'}, } - def __init__(self, tags=None, properties=None, **kwargs): + def __init__(self, tags=None, properties=None): self.tags = tags self.properties = properties diff --git a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/usage.py b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/usage.py index aa81987351..a22a532456 100644 --- a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/usage.py +++ b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/usage.py @@ -37,7 +37,7 @@ class Usage(Model): 'name': {'key': 'name', 'type': 'UsageName'}, } - def __init__(self, unit, current_value, limit, name, **kwargs): + def __init__(self, unit, current_value, limit, name): self.unit = unit self.current_value = current_value self.limit = limit diff --git a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/usage_name.py b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/usage_name.py index 3477988bfb..5edfc23c32 100644 --- a/Samples/azure-storage/Azure.Python/storagemanagementclient/models/usage_name.py +++ b/Samples/azure-storage/Azure.Python/storagemanagementclient/models/usage_name.py @@ -21,6 +21,6 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self, value=None, localized_value=None, **kwargs): + def __init__(self, value=None, localized_value=None): self.value = value self.localized_value = localized_value diff --git a/Samples/petstore/Python/setup.py b/Samples/petstore/Python/setup.py index f1c57ff21b..bd6e6ed040 100644 --- a/Samples/petstore/Python/setup.py +++ b/Samples/petstore/Python/setup.py @@ -15,7 +15,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -REQUIRES = ["msrest>=0.1.0"] +REQUIRES = ["msrest>=0.2.0"] setup( name=NAME, diff --git a/Samples/petstore/Python/swaggerpetstore/models/category.py b/Samples/petstore/Python/swaggerpetstore/models/category.py index 274c76da92..70aae7c8f0 100644 --- a/Samples/petstore/Python/swaggerpetstore/models/category.py +++ b/Samples/petstore/Python/swaggerpetstore/models/category.py @@ -19,6 +19,6 @@ class Category(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, id=None, name=None, **kwargs): + def __init__(self, id=None, name=None): self.id = id self.name = name diff --git a/Samples/petstore/Python/swaggerpetstore/models/order.py b/Samples/petstore/Python/swaggerpetstore/models/order.py index e02faeb181..8b7b27a2bb 100644 --- a/Samples/petstore/Python/swaggerpetstore/models/order.py +++ b/Samples/petstore/Python/swaggerpetstore/models/order.py @@ -32,7 +32,7 @@ class Order(Model): 'complete': {'key': 'complete', 'type': 'bool'}, } - def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=None, **kwargs): + def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=None): self.id = id self.pet_id = pet_id self.quantity = quantity diff --git a/Samples/petstore/Python/swaggerpetstore/models/pet.py b/Samples/petstore/Python/swaggerpetstore/models/pet.py index eea3cb945d..3c01b6a3ba 100644 --- a/Samples/petstore/Python/swaggerpetstore/models/pet.py +++ b/Samples/petstore/Python/swaggerpetstore/models/pet.py @@ -37,7 +37,7 @@ class Pet(Model): 'status': {'key': 'status', 'type': 'str'}, } - def __init__(self, name, photo_urls, id=None, category=None, tags=None, status=None, **kwargs): + def __init__(self, name, photo_urls, id=None, category=None, tags=None, status=None): self.id = id self.category = category self.name = name diff --git a/Samples/petstore/Python/swaggerpetstore/models/tag.py b/Samples/petstore/Python/swaggerpetstore/models/tag.py index 34b6460af1..38d4ffbabc 100644 --- a/Samples/petstore/Python/swaggerpetstore/models/tag.py +++ b/Samples/petstore/Python/swaggerpetstore/models/tag.py @@ -19,6 +19,6 @@ class Tag(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, id=None, name=None, **kwargs): + def __init__(self, id=None, name=None): self.id = id self.name = name diff --git a/Samples/petstore/Python/swaggerpetstore/models/user.py b/Samples/petstore/Python/swaggerpetstore/models/user.py index ce6eeadc63..17d843abff 100644 --- a/Samples/petstore/Python/swaggerpetstore/models/user.py +++ b/Samples/petstore/Python/swaggerpetstore/models/user.py @@ -37,7 +37,7 @@ class User(Model): 'user_status': {'key': 'userStatus', 'type': 'int'}, } - def __init__(self, id=None, username=None, first_name=None, last_name=None, email=None, password=None, phone=None, user_status=None, **kwargs): + def __init__(self, id=None, username=None, first_name=None, last_name=None, email=None, password=None, phone=None, user_status=None): self.id = id self.username = username self.first_name = first_name