diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDuration/AutoRestDurationTestServiceExtensions.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDuration/AutoRestDurationTestServiceExtensions.cs deleted file mode 100644 index 261f2b6b56..0000000000 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDuration/AutoRestDurationTestServiceExtensions.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.Azure.AcceptanceTestsAzureBodyDuration -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - - /// - /// Extension methods for AutoRestDurationTestService. - /// - public static partial class AutoRestDurationTestServiceExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/AutoRestParameterGroupingTestServiceExtensions.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/AutoRestParameterGroupingTestServiceExtensions.cs deleted file mode 100644 index b7762a2f5f..0000000000 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/AutoRestParameterGroupingTestServiceExtensions.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.Azure.AcceptanceTestsAzureParameterGrouping -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - - /// - /// Extension methods for AutoRestParameterGroupingTestService. - /// - public static partial class AutoRestParameterGroupingTestServiceExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureSpecials/AutoRestAzureSpecialParametersTestClientExtensions.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureSpecials/AutoRestAzureSpecialParametersTestClientExtensions.cs deleted file mode 100644 index d876f176c9..0000000000 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureSpecials/AutoRestAzureSpecialParametersTestClientExtensions.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.Azure.AcceptanceTestsAzureSpecials -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - - /// - /// Extension methods for AutoRestAzureSpecialParametersTestClient. - /// - public static partial class AutoRestAzureSpecialParametersTestClientExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/CustomBaseUri/AutoRestParameterizedHostTestClientExtensions.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/CustomBaseUri/AutoRestParameterizedHostTestClientExtensions.cs deleted file mode 100644 index 4f06edca60..0000000000 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/CustomBaseUri/AutoRestParameterizedHostTestClientExtensions.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.Azure.AcceptanceTestsCustomBaseUri -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - - /// - /// Extension methods for AutoRestParameterizedHostTestClient. - /// - public static partial class AutoRestParameterizedHostTestClientExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Head/AutoRestHeadTestServiceExtensions.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Head/AutoRestHeadTestServiceExtensions.cs deleted file mode 100644 index 3874966a4e..0000000000 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Head/AutoRestHeadTestServiceExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.Azure.AcceptanceTestsHead -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - - /// - /// Extension methods for AutoRestHeadTestService. - /// - public static partial class AutoRestHeadTestServiceExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/HeadExceptions/AutoRestHeadExceptionTestServiceExtensions.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/HeadExceptions/AutoRestHeadExceptionTestServiceExtensions.cs deleted file mode 100644 index 5b42f85efa..0000000000 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/HeadExceptions/AutoRestHeadExceptionTestServiceExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.Azure.AcceptanceTestsHeadExceptions -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - - /// - /// Extension methods for AutoRestHeadExceptionTestService. - /// - public static partial class AutoRestHeadExceptionTestServiceExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/AutoRestLongRunningOperationTestServiceExtensions.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/AutoRestLongRunningOperationTestServiceExtensions.cs deleted file mode 100644 index 556eabfc3a..0000000000 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/AutoRestLongRunningOperationTestServiceExtensions.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.Azure.AcceptanceTestsLro -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - - /// - /// Extension methods for AutoRestLongRunningOperationTestService. - /// - public static partial class AutoRestLongRunningOperationTestServiceExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/AutoRestPagingTestServiceExtensions.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/AutoRestPagingTestServiceExtensions.cs deleted file mode 100644 index 6976b94427..0000000000 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/AutoRestPagingTestServiceExtensions.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.Azure.AcceptanceTestsPaging -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - - /// - /// Extension methods for AutoRestPagingTestService. - /// - public static partial class AutoRestPagingTestServiceExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/SubscriptionIdApiVersion/MicrosoftAzureTestUrlExtensions.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/SubscriptionIdApiVersion/MicrosoftAzureTestUrlExtensions.cs deleted file mode 100644 index 03ae848ab3..0000000000 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/SubscriptionIdApiVersion/MicrosoftAzureTestUrlExtensions.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.Azure.AcceptanceTestsSubscriptionIdApiVersion -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - - /// - /// Extension methods for MicrosoftAzureTestUrl. - /// - public static partial class MicrosoftAzureTestUrlExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/Azure.CSharp/AzureCSharpCodeGenerator.cs b/AutoRest/Generators/CSharp/Azure.CSharp/AzureCSharpCodeGenerator.cs index 6389be2b4d..5cb9c986a5 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp/AzureCSharpCodeGenerator.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp/AzureCSharpCodeGenerator.cs @@ -95,11 +95,14 @@ public override async Task Generate(ServiceClient serviceClient) await Write(serviceClientTemplate, serviceClient.Name + ".cs"); // Service client extensions - var extensionsTemplate = new ExtensionsTemplate + if (serviceClient.Methods.Any(m => m.Group == null)) { - Model = new AzureExtensionsTemplateModel(serviceClient, null), - }; - await Write(extensionsTemplate, serviceClient.Name + "Extensions.cs"); + var extensionsTemplate = new ExtensionsTemplate + { + Model = new AzureExtensionsTemplateModel(serviceClient, null), + }; + await Write(extensionsTemplate, serviceClient.Name + "Extensions.cs"); + } // Service client interface var serviceClientInterfaceTemplate = new ServiceClientInterfaceTemplate diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/AutoRest.Generator.CSharp.Tests.xproj b/AutoRest/Generators/CSharp/CSharp.Tests/AutoRest.Generator.CSharp.Tests.xproj index b001b02fc7..074eec6174 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/AutoRest.Generator.CSharp.Tests.xproj +++ b/AutoRest/Generators/CSharp/CSharp.Tests/AutoRest.Generator.CSharp.Tests.xproj @@ -25,7 +25,7 @@ - + \ No newline at end of file diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyArray/AutoRestSwaggerBATArrayServiceExtensions.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyArray/AutoRestSwaggerBATArrayServiceExtensions.cs deleted file mode 100644 index 7279d47f92..0000000000 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyArray/AutoRestSwaggerBATArrayServiceExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.AcceptanceTestsBodyArray -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Models; - - /// - /// Extension methods for AutoRestSwaggerBATArrayService. - /// - public static partial class AutoRestSwaggerBATArrayServiceExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyBoolean/AutoRestBoolTestServiceExtensions.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyBoolean/AutoRestBoolTestServiceExtensions.cs deleted file mode 100644 index 96a93d94bc..0000000000 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyBoolean/AutoRestBoolTestServiceExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.AcceptanceTestsBodyBoolean -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Models; - - /// - /// Extension methods for AutoRestBoolTestService. - /// - public static partial class AutoRestBoolTestServiceExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyByte/AutoRestSwaggerBATByteServiceExtensions.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyByte/AutoRestSwaggerBATByteServiceExtensions.cs deleted file mode 100644 index 7c2aa31e12..0000000000 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyByte/AutoRestSwaggerBATByteServiceExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.AcceptanceTestsBodyByte -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Models; - - /// - /// Extension methods for AutoRestSwaggerBATByteService. - /// - public static partial class AutoRestSwaggerBATByteServiceExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyComplex/AutoRestComplexTestServiceExtensions.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyComplex/AutoRestComplexTestServiceExtensions.cs deleted file mode 100644 index 5f3b3f1573..0000000000 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyComplex/AutoRestComplexTestServiceExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.AcceptanceTestsBodyComplex -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Models; - - /// - /// Extension methods for AutoRestComplexTestService. - /// - public static partial class AutoRestComplexTestServiceExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDate/AutoRestDateTestServiceExtensions.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDate/AutoRestDateTestServiceExtensions.cs deleted file mode 100644 index 25281e5a12..0000000000 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDate/AutoRestDateTestServiceExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.AcceptanceTestsBodyDate -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Models; - - /// - /// Extension methods for AutoRestDateTestService. - /// - public static partial class AutoRestDateTestServiceExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDateTime/AutoRestDateTimeTestServiceExtensions.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDateTime/AutoRestDateTimeTestServiceExtensions.cs deleted file mode 100644 index b66b49fb67..0000000000 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDateTime/AutoRestDateTimeTestServiceExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.AcceptanceTestsBodyDateTime -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Models; - - /// - /// Extension methods for AutoRestDateTimeTestService. - /// - public static partial class AutoRestDateTimeTestServiceExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/AutoRestRFC1123DateTimeTestServiceExtensions.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/AutoRestRFC1123DateTimeTestServiceExtensions.cs deleted file mode 100644 index c9596c4fdf..0000000000 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/AutoRestRFC1123DateTimeTestServiceExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.AcceptanceTestsBodyDateTimeRfc1123 -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Models; - - /// - /// Extension methods for AutoRestRFC1123DateTimeTestService. - /// - public static partial class AutoRestRFC1123DateTimeTestServiceExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDictionary/AutoRestSwaggerBATdictionaryServiceExtensions.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDictionary/AutoRestSwaggerBATdictionaryServiceExtensions.cs deleted file mode 100644 index 7de7223c90..0000000000 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDictionary/AutoRestSwaggerBATdictionaryServiceExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.AcceptanceTestsBodyDictionary -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Models; - - /// - /// Extension methods for AutoRestSwaggerBATdictionaryService. - /// - public static partial class AutoRestSwaggerBATdictionaryServiceExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDuration/AutoRestDurationTestServiceExtensions.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDuration/AutoRestDurationTestServiceExtensions.cs deleted file mode 100644 index c1b824832f..0000000000 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDuration/AutoRestDurationTestServiceExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.AcceptanceTestsBodyDuration -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Models; - - /// - /// Extension methods for AutoRestDurationTestService. - /// - public static partial class AutoRestDurationTestServiceExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyFile/AutoRestSwaggerBATFileServiceExtensions.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyFile/AutoRestSwaggerBATFileServiceExtensions.cs deleted file mode 100644 index 8dfb29038d..0000000000 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyFile/AutoRestSwaggerBATFileServiceExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.AcceptanceTestsBodyFile -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Models; - - /// - /// Extension methods for AutoRestSwaggerBATFileService. - /// - public static partial class AutoRestSwaggerBATFileServiceExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyFormData/AutoRestSwaggerBATFormDataServiceExtensions.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyFormData/AutoRestSwaggerBATFormDataServiceExtensions.cs deleted file mode 100644 index dfb6daa2af..0000000000 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyFormData/AutoRestSwaggerBATFormDataServiceExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.AcceptanceTestsBodyFormData -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Models; - - /// - /// Extension methods for AutoRestSwaggerBATFormDataService. - /// - public static partial class AutoRestSwaggerBATFormDataServiceExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyInteger/AutoRestIntegerTestServiceExtensions.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyInteger/AutoRestIntegerTestServiceExtensions.cs deleted file mode 100644 index 413b8cf8bb..0000000000 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyInteger/AutoRestIntegerTestServiceExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.AcceptanceTestsBodyInteger -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Models; - - /// - /// Extension methods for AutoRestIntegerTestService. - /// - public static partial class AutoRestIntegerTestServiceExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyNumber/AutoRestNumberTestServiceExtensions.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyNumber/AutoRestNumberTestServiceExtensions.cs deleted file mode 100644 index 9ef43d0970..0000000000 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyNumber/AutoRestNumberTestServiceExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.AcceptanceTestsBodyNumber -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Models; - - /// - /// Extension methods for AutoRestNumberTestService. - /// - public static partial class AutoRestNumberTestServiceExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyString/AutoRestSwaggerBATServiceExtensions.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyString/AutoRestSwaggerBATServiceExtensions.cs deleted file mode 100644 index 1aff0edf7c..0000000000 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyString/AutoRestSwaggerBATServiceExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.AcceptanceTestsBodyString -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Models; - - /// - /// Extension methods for AutoRestSwaggerBATService. - /// - public static partial class AutoRestSwaggerBATServiceExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CompositeBoolIntClient/CompositeBoolIntExtensions.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CompositeBoolIntClient/CompositeBoolIntExtensions.cs deleted file mode 100644 index 96ca3789f3..0000000000 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CompositeBoolIntClient/CompositeBoolIntExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.AcceptanceTestsCompositeBoolIntClient -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Models; - - /// - /// Extension methods for CompositeBoolInt. - /// - public static partial class CompositeBoolIntExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUri/AutoRestParameterizedHostTestClientExtensions.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUri/AutoRestParameterizedHostTestClientExtensions.cs deleted file mode 100644 index 4aebc596c3..0000000000 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUri/AutoRestParameterizedHostTestClientExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.AcceptanceTestsCustomBaseUri -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Models; - - /// - /// Extension methods for AutoRestParameterizedHostTestClient. - /// - public static partial class AutoRestParameterizedHostTestClientExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/AutoRestSwaggerBATHeaderServiceExtensions.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/AutoRestSwaggerBATHeaderServiceExtensions.cs deleted file mode 100644 index 776e183fb4..0000000000 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/AutoRestSwaggerBATHeaderServiceExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.AcceptanceTestsHeader -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Models; - - /// - /// Extension methods for AutoRestSwaggerBATHeaderService. - /// - public static partial class AutoRestSwaggerBATHeaderServiceExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/AutoRestHttpInfrastructureTestServiceExtensions.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/AutoRestHttpInfrastructureTestServiceExtensions.cs deleted file mode 100644 index af9bda5fe2..0000000000 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/AutoRestHttpInfrastructureTestServiceExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.AcceptanceTestsHttp -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Models; - - /// - /// Extension methods for AutoRestHttpInfrastructureTestService. - /// - public static partial class AutoRestHttpInfrastructureTestServiceExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ParameterFlattening/AutoRestParameterFlatteningExtensions.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ParameterFlattening/AutoRestParameterFlatteningExtensions.cs deleted file mode 100644 index 225e9e096f..0000000000 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ParameterFlattening/AutoRestParameterFlatteningExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.AcceptanceTestsParameterFlattening -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Models; - - /// - /// Extension methods for AutoRestParameterFlattening. - /// - public static partial class AutoRestParameterFlatteningExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/RequiredOptional/AutoRestRequiredOptionalTestServiceExtensions.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/RequiredOptional/AutoRestRequiredOptionalTestServiceExtensions.cs deleted file mode 100644 index 345c353ee7..0000000000 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/RequiredOptional/AutoRestRequiredOptionalTestServiceExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.AcceptanceTestsRequiredOptional -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Models; - - /// - /// Extension methods for AutoRestRequiredOptionalTestService. - /// - public static partial class AutoRestRequiredOptionalTestServiceExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Url/AutoRestUrlTestServiceExtensions.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Url/AutoRestUrlTestServiceExtensions.cs deleted file mode 100644 index 65c5327c14..0000000000 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Url/AutoRestUrlTestServiceExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.AcceptanceTestsUrl -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - using Models; - - /// - /// Extension methods for AutoRestUrlTestService. - /// - public static partial class AutoRestUrlTestServiceExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Internal.Ctors/InternalClientExtensions.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Internal.Ctors/InternalClientExtensions.cs deleted file mode 100644 index 416d306140..0000000000 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Internal.Ctors/InternalClientExtensions.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Fixtures.InternalCtors -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Rest; - - /// - /// Extension methods for InternalClient. - /// - public static partial class InternalClientExtensions - { - } -} diff --git a/AutoRest/Generators/CSharp/CSharp/CSharpCodeGenerator.cs b/AutoRest/Generators/CSharp/CSharp/CSharpCodeGenerator.cs index 77a0576562..b0a43b1bc5 100644 --- a/AutoRest/Generators/CSharp/CSharp/CSharpCodeGenerator.cs +++ b/AutoRest/Generators/CSharp/CSharp/CSharpCodeGenerator.cs @@ -102,11 +102,14 @@ public override async Task Generate(ServiceClient serviceClient) await Write(serviceClientTemplate, serviceClient.Name + ".cs"); // Service client extensions - var extensionsTemplate = new ExtensionsTemplate + if (serviceClient.Methods.Any(m => m.Group == null)) { - Model = new ExtensionsTemplateModel(serviceClient, null), - }; - await Write(extensionsTemplate, serviceClient.Name + "Extensions.cs"); + var extensionsTemplate = new ExtensionsTemplate + { + Model = new ExtensionsTemplateModel(serviceClient, null), + }; + await Write(extensionsTemplate, serviceClient.Name + "Extensions.cs"); + } // Service client interface var serviceClientInterfaceTemplate = new ServiceClientInterfaceTemplate diff --git a/AutoRest/Generators/CSharp/CSharp/TemplateModels/MethodTemplateModel.cs b/AutoRest/Generators/CSharp/CSharp/TemplateModels/MethodTemplateModel.cs index b622b8f34f..7f7fc797d6 100644 --- a/AutoRest/Generators/CSharp/CSharp/TemplateModels/MethodTemplateModel.cs +++ b/AutoRest/Generators/CSharp/CSharp/TemplateModels/MethodTemplateModel.cs @@ -429,9 +429,17 @@ public virtual string BuildUrl(string variableName) } builder.AppendLine("if (_queryParameters.Count > 0)") - .AppendLine("{").Indent() - .AppendLine("{0} += \"?\" + string.Join(\"&\", _queryParameters);", variableName).Outdent() - .AppendLine("}"); + .AppendLine("{").Indent(); + if (this.Extensions.ContainsKey("nextLinkMethod") && (bool)this.Extensions["nextLinkMethod"]) + { + builder.AppendLine("{0} += ({0}.Contains(\"?\") ? \"&\" : \"?\") + string.Join(\"&\", _queryParameters);", variableName); + } + else + { + builder.AppendLine("{0} += \"?\" + string.Join(\"&\", _queryParameters);", variableName); + } + + builder.Outdent().AppendLine("}"); } return builder.ToString(); diff --git a/AutoRest/Generators/Extensions/Azure.Extensions/AzureExtensions.cs b/AutoRest/Generators/Extensions/Azure.Extensions/AzureExtensions.cs index e5f2e72c37..c38246fdcc 100644 --- a/AutoRest/Generators/Extensions/Azure.Extensions/AzureExtensions.cs +++ b/AutoRest/Generators/Extensions/Azure.Extensions/AzureExtensions.cs @@ -358,6 +358,10 @@ public static void AddPageableMethod(ServiceClient serviceClient, CodeNamer code { nextLinkMethod = serviceClient.Methods.FirstOrDefault(m => pageableExtension.OperationName.Equals(m.SerializedName, StringComparison.OrdinalIgnoreCase)); + if (nextLinkMethod != null) + { + nextLinkMethod.Extensions["nextLinkMethod"] = true; + } } if (nextLinkMethod == null) @@ -377,6 +381,7 @@ public static void AddPageableMethod(ServiceClient serviceClient, CodeNamer code } method.Extensions["nextMethodName"] = nextLinkMethod.Name; method.Extensions["nextMethodGroup"] = nextLinkMethod.Group; + nextLinkMethod.Extensions["nextLinkMethod"] = true; nextLinkMethod.Parameters.Clear(); nextLinkMethod.Url = "{nextLink}"; nextLinkMethod.IsAbsoluteUrl = true; diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS/AzureNodeJSCodeGenerator.cs b/AutoRest/Generators/NodeJS/Azure.NodeJS/AzureNodeJSCodeGenerator.cs index 1cc16160fe..cddd7a2adb 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS/AzureNodeJSCodeGenerator.cs +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS/AzureNodeJSCodeGenerator.cs @@ -18,7 +18,7 @@ namespace Microsoft.Rest.Generator.Azure.NodeJS { public class AzureNodeJSCodeGenerator : NodeJSCodeGenerator { - private const string ClientRuntimePackage = "ms-rest-azure version 1.9.0"; + private const string ClientRuntimePackage = "ms-rest-azure version 1.10.0"; // List of models with paging extensions. private IList pageModels; diff --git a/AutoRest/Generators/NodeJS/NodeJS/NodeJSCodeGenerator.cs b/AutoRest/Generators/NodeJS/NodeJS/NodeJSCodeGenerator.cs index 0ec698f645..bdc9153f1c 100644 --- a/AutoRest/Generators/NodeJS/NodeJS/NodeJSCodeGenerator.cs +++ b/AutoRest/Generators/NodeJS/NodeJS/NodeJSCodeGenerator.cs @@ -16,7 +16,7 @@ namespace Microsoft.Rest.Generator.NodeJS { public class NodeJSCodeGenerator : CodeGenerator { - private const string ClientRuntimePackage = "ms-rest version 1.9.0"; + private const string ClientRuntimePackage = "ms-rest version 1.10.0"; public NodeJsCodeNamer Namer { get; private set; } diff --git a/AutoRest/Generators/NodeJS/NodeJS/TemplateModels/MethodTemplateModel.cs b/AutoRest/Generators/NodeJS/NodeJS/TemplateModels/MethodTemplateModel.cs index b08c980c71..72bd8ddfff 100644 --- a/AutoRest/Generators/NodeJS/NodeJS/TemplateModels/MethodTemplateModel.cs +++ b/AutoRest/Generators/NodeJS/NodeJS/TemplateModels/MethodTemplateModel.cs @@ -529,12 +529,20 @@ public virtual string BuildUrl(string variableName) /// /// The variable reference for the url /// The string builder for url construction - private static void AddQueryParametersToUrl(string variableName, IndentedStringBuilder builder) + private void AddQueryParametersToUrl(string variableName, IndentedStringBuilder builder) { builder.AppendLine("if (queryParameters.length > 0) {") - .Indent() - .AppendLine("{0} += '?' + queryParameters.join('&');", variableName).Outdent() - .AppendLine("}"); + .Indent(); + if (this.Extensions.ContainsKey("nextLinkMethod") && (bool)this.Extensions["nextLinkMethod"]) + { + builder.AppendLine("{0} += ({0}.indexOf('?') !== -1 ? '&' : '?') + queryParameters.join('&');", variableName); + } + else + { + builder.AppendLine("{0} += '?' + queryParameters.join('&');", variableName); + } + + builder.Outdent().AppendLine("}"); } /// 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 ef29d77b62..af1e9659ee 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 @@ -452,7 +452,7 @@ def put_simple_product_with_grouping( path_format_arguments = { 'name': self._serialize.url("name", name, 'str') } - url = url.format(**path_format_arguments) + url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} 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 16ce0e100b..95ceb38df3 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 @@ -58,7 +58,7 @@ def update( 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str') } - url = url.format(**path_format_arguments) + url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} diff --git a/ClientRuntimes/NodeJS/ms-rest-azure/README.md b/ClientRuntimes/NodeJS/ms-rest-azure/README.md index 7e8306a438..fa4dfef78d 100644 --- a/ClientRuntimes/NodeJS/ms-rest-azure/README.md +++ b/ClientRuntimes/NodeJS/ms-rest-azure/README.md @@ -11,6 +11,21 @@ Infrastructure for error handling, tracing, and http client pipeline configurati npm install ms-rest-azure ``` +## Usage +```javascript +var msrestAzure = require('ms-rest-azure'); +``` +## Authentication + +```javascript + //user authentication + var credentials = new msRestAzure.UserTokenCredentials('your-client-id', 'your-domain', 'your-username', 'your-password', 'your-redirect-uri'); + //service principal authentication + var credentials = new msRestAzure.ApplicationTokenCredentials('your-client-id', 'your-domain', 'your-secret'); +``` +### Non-Interactive Authentication +If you need to create an automation account for non interactive or scripting scenarios then please take a look at the documentation over [here](https://github.com/Azure/azure-sdk-for-node/blob/autorest/Documentation/Authentication.md). + ## Related Projects - [AutoRest](https://github.com/Azure/AutoRest) \ No newline at end of file diff --git a/ClientRuntimes/NodeJS/ms-rest-azure/package.json b/ClientRuntimes/NodeJS/ms-rest-azure/package.json index dc3a3f823e..53c7f60061 100644 --- a/ClientRuntimes/NodeJS/ms-rest-azure/package.json +++ b/ClientRuntimes/NodeJS/ms-rest-azure/package.json @@ -5,7 +5,7 @@ "email": "azsdkteam@microsoft.com", "url": "https://github.com/Azure/AutoRest" }, - "version": "1.9.0", + "version": "1.10.0", "description": "Client Runtime for Node.js Azure client libraries generated using AutoRest", "tags": [ "node", "microsoft", "autorest", "azure", "clientruntime" ], "keywords": [ "node", "microsoft", "autorest", "azure", "clientruntime" ], @@ -23,7 +23,7 @@ "async": "0.2.7", "uuid": "2.0.1", "adal-node": "0.1.16", - "ms-rest": "^1.9.0", + "ms-rest": "^1.10.0", "underscore": "^1.4.0", "moment": "^2.6.0" }, diff --git a/ClientRuntimes/NodeJS/ms-rest/README.md b/ClientRuntimes/NodeJS/ms-rest/README.md index c21d6d14fb..2de613038f 100644 --- a/ClientRuntimes/NodeJS/ms-rest/README.md +++ b/ClientRuntimes/NodeJS/ms-rest/README.md @@ -1,6 +1,6 @@ # MS-Rest -Infrastructure for error handling, tracing, and http client pipeline configuration. Required by nodeJS client libraries generated using AutoRest. +Infrastructure for serialization/deserialization, error handling, tracing, and http client pipeline configuration. Required by nodeJS client libraries generated using AutoRest. - **Node.js version: 0.10.0 or higher** @@ -11,6 +11,47 @@ Infrastructure for error handling, tracing, and http client pipeline configurati npm install ms-rest ``` +## Usage +```javascript +var msrest = require('ms-rest'); +``` +## Serialization/Deserialization +Features +- Type checking + - (String, Number, Boolean, ByteArray, Date, DateTime, Enum, TimeSpan, DateTimeRfc1123, Object, Stream, Sequence, Dictionary, Composite) +- Validation of specified constraints + - ExclusiveMaximum, ExclusiveMinimum, InclusiveMaximum, InclusiveMinimum, MaxItems, MaxLength, MinItems, MinLength, MultipleOf, Pattern, UniqueItems +- Flattening/Unflattening properties +- Default Values +- Model Properties marked as constant are set during serialization, irrespective of they being provided or not +- Required check (If a model or property is marked required and is not provided in the object then an error is thrown) +- Readonly check (If a model or property is marked readonly then it is not sent on the wire during, serialization) + +- serialize an array of dictionary of primitive values +```javascript +var mapper = { + type : { + name: 'Sequence', + element: { + type : { + name: 'Dictionary', + value: { + type: { + name: 'Boolean' + } + } + } + } + } +}; +var array = [{ 1: true }, { 2: false }, { 1: true, 2: false, 3: true }]; +var serializedArray = msRest.serialize(mapper, array, 'arrayObj'); +assert.deepEqual(array, serializedArray); +var serializedProduct = msrest.serialize(mapper, productObj, 'productObject'); +var deserializedArray = msRest.deserialize(mapper, serializedArray, 'serializedArrayObj'); +``` +For more examples on serialization/deserialization with complex types please take a look over [here](https://github.com/Azure/autorest/blob/master/ClientRuntimes/NodeJS/ms-rest/test/serializationTests.js#L116). + ## Related Projects - [AutoRest](https://github.com/Azure/AutoRest) \ No newline at end of file diff --git a/ClientRuntimes/NodeJS/ms-rest/package.json b/ClientRuntimes/NodeJS/ms-rest/package.json index ad39250008..65bb76c33e 100644 --- a/ClientRuntimes/NodeJS/ms-rest/package.json +++ b/ClientRuntimes/NodeJS/ms-rest/package.json @@ -5,7 +5,7 @@ "email": "azsdkteam@microsoft.com", "url": "https://github.com/Azure/AutoRest" }, - "version": "1.9.0", + "version": "1.10.0", "description": "Client Runtime for Node.js client libraries generated using AutoRest", "tags": ["node", "microsoft", "autorest", "clientruntime"], "keywords": ["node", "microsoft", "autorest", "clientruntime"], diff --git a/Documentation/README.md b/Documentation/README.md index 39e2b4304f..890f11b09d 100644 --- a/Documentation/README.md +++ b/Documentation/README.md @@ -17,8 +17,7 @@ - Overview - Code Generators - Modelers -5. Compiling AutoRest - - [Functional & Unit testing](building-code.md) +5. [Building AutoRest](building-code.md) 6. Contributing to the code [Swagger2.0]:https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md diff --git a/Documentation/building-code.md b/Documentation/building-code.md index 8d73f5a650..d6ffd5548c 100644 --- a/Documentation/building-code.md +++ b/Documentation/building-code.md @@ -1,44 +1,137 @@ -# Prerequisites - Visual Studio 2013 Update 2 is the minimum version for building AutoRest. +# Building AutoRest -## Build -### Visual Studio Build -The ClientRuntime solution includes separate build configurations for the following targets: -* Net40-Debug -* Net40-Release -* Net45-Debug -* Net45-Release -* Portable-Debug -* Portable-Release -Switch between targets using the ConfigurationManager found in the Build menu of Visual Studio. - -### Command-line Build -To build from the command line, use the Developer Command Prompt. A shortcut to launch it is installed by default in -```bash - "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\Shortcuts\Developer Command Prompt for VS2013.lnk" -``` -The command-line build will compile Net40, Net45 and Portable configurations. From the root of the project, run: -```bash -msbuild build.proj -``` +## Build Prerequisites +AutoRest is developed primarily in C# but generates code for multiple languages. To build and test AutoRest requires a few things be installed locally. -## Run Unit Tests -Tests can be run from the Test menu in Visual Studio or they can be started from the command line using the **clean** build target. +### .Net +#### on Windows +Install the [Microsoft Build Tools](http://go.microsoft.com/?linkid=9832060) or get them with [Visual Studio](https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx). +Ensure that msbuild is in your path by running vcvarsall.bat +>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat -```bash -msbuild build.proj /t:test -``` -Compile and run the tests by using multiple build targets. -```bash -msbuild build.proj /t:build;test -``` +To compile the code in Visual Studio IDE, +- Ensure you are using Visual Studio 2015 +- Ensure "Nuget Package Manager For Visual Studio" is updated to a newer version, like "2.8.60723.765", which is needed to install xunit. +- Install [Task Runner Explorer](https://visualstudiogallery.msdn.microsoft.com/8e1b4368-4afb-467a-bc13-9650572db708) to run gulp tasks such as synchonize nuget version, assembly info, etc. + +Install DNVM using [these steps](https://docs.asp.net/en/latest/getting-started/installing-on-windows.html) and configure DNX 1.0.0-rc1. + +#### on Mac or Linux +Install Mono 4.3.0 (MonoFramework-MDK-4.3.0.372.macos10.xamarin.x86.pkg) + +Install DNVM using [these steps](https://docs.asp.net/en/latest/getting-started/installing-on-mac.html). + +### Node.js +Install the latest from [nodejs.org](https://nodejs.org/). Then from the project root run `npm install`. + +### Java / Android +Install the latest Java SE Development Kit from [Java SE Downloads](http://www.oracle.com/technetwork/java/javase/downloads/index.html). +Ensure that the JDK binaries are in your `PATH`. +>set PATH=PATH;C:\Program Files\java\jdk1.8.0_45\bin + +Ensure that your environment includes the `JAVA_HOME`. +>set JAVA_HOME=C:\Program Files\java\jdk1.8.0_45 + +Install the latest Android environment from http://developer.android.com/sdk/index.html. You can either install Android Studio if you want to do actual development work in Android, or simply install the [SDK tools](http://developer.android.com/sdk/index.html#Other) that is minimally requried to build the Android code. -## Additional Build Targets -Rebuild by including the **clean** target to remove existing temporary outputs. +In SDK Manager, make sure that build tools >23.0.1, Android Support Repository, and Google Repository are installed. Make sure ANDROID_HOME is in your environment variable. If you installed Android Studio, you can find it out from Android Studio settings. If you installed SDK tools, its default location is `C:\Program Files (x86)\Android\android-sdk` on Windows. + +#### Gradle +Install the `Gradle build system` from [Gradle downloads](http://gradle.org/gradle-download/). +Ensure Gradle is in your `PATH`. +>set PATH=PATH;C:\gradle-2.6\bin + +Ensure that your environment includes the `GRADLE_HOME`. +>set GRADLE_HOME=C:\gradle-2.6 + +#### Java IDE +You may want a Java IDE. +- Install Jetbrains IntelliJ IDEA from [JetBrains downloads](https://www.jetbrains.com/idea/download/.) + OR +- Install `Eclipse IDE for Java EE Developer` from [Eclipse downloads](http://eclipse.org/downloads/) + +### Ruby +[RubyInstaller](http://rubyinstaller.org/downloads/) version 2+ - 32-bit version. +By default, Ruby installs to C:\Ruby21 or Ruby22, etc. Ensure that C:\Ruby21\bin is in your `PATH`. +>set PATH=PATH;C:\Ruby21\bin + +[RubyDevKit](http://rubyinstaller.org/downloads/) 32-bit version for use with Ruby 2.0 and above +The DevKit installer just unpacks files. Navigate to the directory and run the following: ```bash -msbuild build.proj /t:clean;build +ruby dk.rb init +ruby dk.rb install +gem install bundler ``` -Build NuGet packages. The packages will be placed in `'.\binaries\packages'`. + +### Python +Install [Python 2.7 and Python 3.5](https://www.python.org/downloads/), and add one of them to your PATH (we recommend 3.5). +>set PATH=PATH;C:\Python35 + +## Build + +### Visual Studio Build +There are 2 solutions used to build C# ClientRuntime and AutoRest code generator. AutoRest.sln is used to build AutoRest code generator. ClientRuntime.sln is used to build C# ClientRuntime. + +###Command Line +We use [gulp](http://gulpjs.com) and msbuild / xbuild to handle the builds. Install for global use with +>npm install gulp -g +>gulp + +If you would like to see what commands are available to you, run `gulp -T`. That will list all of the gulp tasks you can run. By default, just running `gulp` will run a build that will execute clean, build, code analysis, package and test. + +### Output from gulp -T ```bash -msbuild build.proj /t:build;package +[13:54:21] Using gulpfile ./autorest/gulpfile.js +[13:54:21] Tasks for ./autorest/gulpfile.js +[13:54:21] ├── regenerate:expected +[13:54:21] ├── regenerate:delete +[13:54:21] ├── regenerate:expected:csazure +[13:54:21] ├── regenerate:expected:cs +[13:54:21] ├── clean:build +[13:54:21] ├── clean:templates +[13:54:21] ├── clean:generatedTest +[13:54:21] ├─┬ clean +[13:54:21] │ ├── clean:build +[13:54:21] │ ├── clean:templates +[13:54:21] │ └── clean:generatedTest +[13:54:21] ├── syncNugetProjs +[13:54:21] ├── syncNuspecs +[13:54:21] ├─┬ syncDotNetDependencies +[13:54:21] │ ├── syncNugetProjs +[13:54:21] │ └── syncNuspecs +[13:54:21] ├── build +[13:54:21] ├── package +[13:54:21] ├── test +[13:54:21] ├── analysis +[13:54:21] └── default ``` + +### Running the tests +Prior to executing `gulp` to build and then test the code, make sure that the latest tools are setup for your build environment. + + >gulp test + +# Releasing AutoRest and ClientRuntimes + + - [ ] Merge pending PRs into the master branch + - [ ] Create a release branch from master + - [ ] Bump up the version of autorest.exe + - [ ] Update Changelog.md + - [ ] Publish .NET Runtimes (increment versions as appropriate) using [automated build](http://azuresdkci.cloudapp.net/view/3-AutoRest/job/autorest-publish/) + - [ ] Publish Node Runtimes (increment versions as appropriate) + - [ ] Publish Java Runtimes (increment versions as appropriate) + - [ ] Publish Ruby Runtimes (increment versions as appropriate) + - [ ] Publish Python Runtimes (increment versions as appropriate) + - [ ] Create a signed package and smoke test it + - [ ] Publish Choco packages + - [ ] Create a github release from the release branch including a tag + - [ ] Add -SNAPSHOT to Java Runtime versions + - [ ] Update [Docker file](https://github.com/Azure/autorest/blob/master/Tools/dockerfiles/Dockerfile) + - [ ] Add zip packages as a binary to the release + - [ ] Copy over the changelog as release notes for github release + - [ ] Publish the github release + - [ ] Smoke test the nuget and npm packages + - [ ] Merge release -> master + + + diff --git a/README.md b/README.md index d7988eabf7..388f9c0127 100644 --- a/README.md +++ b/README.md @@ -16,110 +16,12 @@ Alternatively it can be installed from [Chocolatey](https://chocolatey.org/) by Nightlies are available via MyGet: [![AutoRest MyGet](https://img.shields.io/myget/autorest/vpre/autorest.svg?style=flat-square)](https://www.myget.org/gallery/autorest) -## Build Prerequisites -AutoRest is developed primarily in C# but generates code for multiple languages. To build and test AutoRest requires a few things be installed locally. +AutoRest can be run on OSX and Unix using Mono or by running Docker container: + + docker pull azuresdk/autorest:latest -### .Net -#### on Windows -Install the [Microsoft Build Tools](http://go.microsoft.com/?linkid=9832060) or get them with [Visual Studio](https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx). -Ensure that msbuild is in your path by running vcvarsall.bat ->C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat - -To compile the code in Visual Studio IDE, -- Ensure you are using Visual Studio 2015 -- Ensure "Nuget Package Manager For Visual Studio" is updated to a newer version, like "2.8.60723.765", which is needed to install xunit. -- Install [Task Runner Explorer](https://visualstudiogallery.msdn.microsoft.com/8e1b4368-4afb-467a-bc13-9650572db708) to run gulp tasks such as synchonize nuget version, assembly info, etc. - -Install DNVM using [these steps](https://docs.asp.net/en/latest/getting-started/installing-on-windows.html) and configure DNX 1.0.0-rc1. - -#### on Mac or Linux -Install Mono 4.3.0 (MonoFramework-MDK-4.3.0.372.macos10.xamarin.x86.pkg) - -Install DNVM using [these steps](https://docs.asp.net/en/latest/getting-started/installing-on-mac.html). - -### Node.js -Install the latest from [nodejs.org](https://nodejs.org/). Then from the project root run `npm install`. - -### Java / Android -Install the latest Java SE Development Kit from [Java SE Downloads](http://www.oracle.com/technetwork/java/javase/downloads/index.html). -Ensure that the JDK binaries are in your `PATH`. ->set PATH=PATH;C:\Program Files\java\jdk1.8.0_45\bin - -Ensure that your environment includes the `JAVA_HOME`. ->set JAVA_HOME=C:\Program Files\java\jdk1.8.0_45 - -Install the latest Android environment from http://developer.android.com/sdk/index.html. You can either install Android Studio if you want to do actual development work in Android, or simply install the [SDK tools](http://developer.android.com/sdk/index.html#Other) that is minimally requried to build the Android code. - -In SDK Manager, make sure that build tools >23.0.1, Android Support Repository, and Google Repository are installed. Make sure ANDROID_HOME is in your environment variable. If you installed Android Studio, you can find it out from Android Studio settings. If you installed SDK tools, its default location is `C:\Program Files (x86)\Android\android-sdk` on Windows. - -#### Gradle -Install the `Gradle build system` from [Gradle downloads](http://gradle.org/gradle-download/). -Ensure Gradle is in your `PATH`. ->set PATH=PATH;C:\gradle-2.6\bin - -Ensure that your environment includes the `GRADLE_HOME`. ->set GRADLE_HOME=C:\gradle-2.6 - -#### Java IDE -You may want a Java IDE. -- Install Jetbrains IntelliJ IDEA from [JetBrains downloads](https://www.jetbrains.com/idea/download/.) - OR -- Install `Eclipse IDE for Java EE Developer` from [Eclipse downloads](http://eclipse.org/downloads/) - -### Ruby -[RubyInstaller](http://rubyinstaller.org/downloads/) version 2+ - 32-bit version. -By default, Ruby installs to C:\Ruby21 or Ruby22, etc. Ensure that C:\Ruby21\bin is in your `PATH`. ->set PATH=PATH;C:\Ruby21\bin - -[RubyDevKit](http://rubyinstaller.org/downloads/) 32-bit version for use with Ruby 2.0 and above -The DevKit installer just unpacks files. Navigate to the directory and run the following: -```bash -ruby dk.rb init -ruby dk.rb install -gem install bundler -``` - -### Python -Install [Python 2.7 and Python 3.5](https://www.python.org/downloads/), and add one of them to your PATH (we recommend 3.5). ->set PATH=PATH;C:\Python35 - -## Gulp -We use [gulp](http://gulpjs.com) and msbuild / xbuild to handle the builds. Install for global use with ->npm install gulp -g - -If you would like to see what commands are available to you, run `gulp -T`. That will list all of the gulp tasks you can run. By default, just running `gulp` will run a build that will execute clean, build, code analysis, package and test. - -### Output from gulp -T -```bash -[13:54:21] Using gulpfile ./autorest/gulpfile.js -[13:54:21] Tasks for ./autorest/gulpfile.js -[13:54:21] ├── regenerate:expected -[13:54:21] ├── regenerate:delete -[13:54:21] ├── regenerate:expected:csazure -[13:54:21] ├── regenerate:expected:cs -[13:54:21] ├── clean:build -[13:54:21] ├── clean:templates -[13:54:21] ├── clean:generatedTest -[13:54:21] ├─┬ clean -[13:54:21] │ ├── clean:build -[13:54:21] │ ├── clean:templates -[13:54:21] │ └── clean:generatedTest -[13:54:21] ├── syncNugetProjs -[13:54:21] ├── syncNuspecs -[13:54:21] ├─┬ syncDotNetDependencies -[13:54:21] │ ├── syncNugetProjs -[13:54:21] │ └── syncNuspecs -[13:54:21] ├── build -[13:54:21] ├── package -[13:54:21] ├── test -[13:54:21] ├── analysis -[13:54:21] └── default -``` - -### Running the tests -Prior to executing `gulp` to build and then test the code, make sure that the latest tools are setup for your build environment. - -- run `bundle install` from the root directory +## Building AutoRest +AutoRest is developed primarily in C# but generates code for multiple languages. See [this link](Documentation/building-code.md) to build and test AutoRest. ## Hello World For this version of Hello World, we will use **AutoRest** to generate a client library and use it to call a web service. The trivial web service that just returns a string is defined as follows: @@ -194,4 +96,4 @@ C:\>HelloWorld.exe Hello via AutoRest. ``` -With that same basic pattern in place, you can now explore how different REST API operations and payloads are described in Swagger and exposed in the code generated by **AutoRest**. +With that same basic pattern in place, you can now explore how different REST API operations and payloads are described in Swagger and exposed in the code generated by **AutoRest**. \ No newline at end of file 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 a65be2ff97..e372998aff 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 @@ -48,7 +48,7 @@ def check_name_availability( path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } - url = url.format(**path_format_arguments) + url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} @@ -120,7 +120,7 @@ def create( 'accountName': self._serialize.url("account_name", account_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } - url = url.format(**path_format_arguments) + url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} @@ -204,7 +204,7 @@ def delete( 'accountName': self._serialize.url("account_name", account_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } - url = url.format(**path_format_arguments) + url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} @@ -261,7 +261,7 @@ def get_properties( 'accountName': self._serialize.url("account_name", account_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } - url = url.format(**path_format_arguments) + url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} @@ -338,7 +338,7 @@ def update( 'accountName': self._serialize.url("account_name", account_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } - url = url.format(**path_format_arguments) + url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} @@ -400,7 +400,7 @@ def list_keys( 'accountName': self._serialize.url("account_name", account_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } - url = url.format(**path_format_arguments) + url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} @@ -457,7 +457,7 @@ def internal_paging(next_link=None, raw=False): path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } - url = url.format(**path_format_arguments) + url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} @@ -524,7 +524,7 @@ def internal_paging(next_link=None, raw=False): 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } - url = url.format(**path_format_arguments) + url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} @@ -595,7 +595,7 @@ def regenerate_key( 'accountName': self._serialize.url("account_name", account_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } - url = url.format(**path_format_arguments) + url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} diff --git a/Samples/azure-storage/Azure.Python/storagemanagementclient/operations/usage_operations.py b/Samples/azure-storage/Azure.Python/storagemanagementclient/operations/usage_operations.py index 64864ef5fa..4085eded18 100644 --- a/Samples/azure-storage/Azure.Python/storagemanagementclient/operations/usage_operations.py +++ b/Samples/azure-storage/Azure.Python/storagemanagementclient/operations/usage_operations.py @@ -46,7 +46,7 @@ def internal_paging(next_link=None, raw=False): path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } - url = url.format(**path_format_arguments) + url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} diff --git a/Samples/petstore/Python/swaggerpetstore/swagger_petstore.py b/Samples/petstore/Python/swaggerpetstore/swagger_petstore.py index 09cabc098a..9344ec8b5b 100644 --- a/Samples/petstore/Python/swaggerpetstore/swagger_petstore.py +++ b/Samples/petstore/Python/swaggerpetstore/swagger_petstore.py @@ -288,7 +288,7 @@ def find_pets_with_byte_array( path_format_arguments = { 'petId': self._serialize.url("pet_id", pet_id, 'long') } - url = url.format(**path_format_arguments) + url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} @@ -337,7 +337,7 @@ def get_pet_by_id( path_format_arguments = { 'petId': self._serialize.url("pet_id", pet_id, 'long') } - url = url.format(**path_format_arguments) + url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} @@ -388,7 +388,7 @@ def update_pet_with_form( path_format_arguments = { 'petId': self._serialize.url("pet_id", pet_id, 'str') } - url = url.format(**path_format_arguments) + url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} @@ -437,7 +437,7 @@ def delete_pet( path_format_arguments = { 'petId': self._serialize.url("pet_id", pet_id, 'long') } - url = url.format(**path_format_arguments) + url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} @@ -483,7 +483,7 @@ def upload_file( path_format_arguments = { 'petId': self._serialize.url("pet_id", pet_id, 'long') } - url = url.format(**path_format_arguments) + url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} @@ -624,7 +624,7 @@ def get_order_by_id( path_format_arguments = { 'orderId': self._serialize.url("order_id", order_id, 'str') } - url = url.format(**path_format_arguments) + url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} @@ -673,7 +673,7 @@ def delete_order( path_format_arguments = { 'orderId': self._serialize.url("order_id", order_id, 'str') } - url = url.format(**path_format_arguments) + url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} @@ -927,7 +927,7 @@ def get_user_by_name( path_format_arguments = { 'username': self._serialize.url("username", username, 'str') } - url = url.format(**path_format_arguments) + url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} @@ -977,7 +977,7 @@ def update_user( path_format_arguments = { 'username': self._serialize.url("username", username, 'str') } - url = url.format(**path_format_arguments) + url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} @@ -1025,7 +1025,7 @@ def delete_user( path_format_arguments = { 'username': self._serialize.url("username", username, 'str') } - url = url.format(**path_format_arguments) + url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} diff --git a/schema/swagger-extensions.json b/schema/swagger-extensions.json index e8e6e4761a..9e5d8d9581 100644 --- a/schema/swagger-extensions.json +++ b/schema/swagger-extensions.json @@ -975,7 +975,12 @@ { "$ref": "#/definitions/nonBodyParameter" } - ] + ], + "properties": { + "x-ms-client-flatten": { + "$ref": "#/definitions/xmsClientFlatten" + } + } }, "schema": { "type": "object", @@ -1114,7 +1119,10 @@ "externalDocs": { "$ref": "#/definitions/externalDocs" }, - "example": { } + "example": { }, + "x-ms-client-flatten": { + "$ref": "#/definitions/xmsClientFlatten" + } }, "additionalProperties": false }, @@ -1775,6 +1783,9 @@ "$ref": "#/definitions/xmsHostParametersList" } } + }, + "xmsClientFlatten": { + "type": "boolean" } } }