From 63b9fd6403b55679f7a35931b880812f51456f1b Mon Sep 17 00:00:00 2001 From: Amar Zavery Date: Thu, 7 Apr 2016 21:17:27 -0700 Subject: [PATCH 01/27] Enhancement to x-ms-parameterized-host extension --- ...Generator.AzureResourceSchema.Tests.csproj | 4 +- .../AzureResourceSchema.Tests/packages.config | 14 +- .../CSharp/CSharp.Tests/AcceptanceTests.cs | 16 ++ ...toRestParameterizedCustomHostTestClient.cs | 128 +++++++++ ...toRestParameterizedCustomHostTestClient.cs | 57 ++++ .../CustomBaseUriMoreOptions/IPaths.cs | 47 ++++ .../CustomBaseUriMoreOptions/Models/Error.cs | 45 ++++ .../Models/ErrorException.cs | 99 +++++++ .../CustomBaseUriMoreOptions/Paths.cs | 203 +++++++++++++++ .../PathsExtensions.cs | 74 ++++++ .../Extensions/Extensions/Extensions.cs | 57 +++- .../Properties/Resources.Designer.cs | 9 + .../Extensions/Properties/Resources.resx | 3 + ...RestParameterizedCustomHostTestClient.java | 86 ++++++ ...ParameterizedCustomHostTestClientImpl.java | 121 +++++++++ .../PathsOperations.java | 75 ++++++ .../PathsOperationsImpl.java | 245 ++++++++++++++++++ .../models/Error.java | 64 +++++ .../models/ErrorException.java | 89 +++++++ .../models/package-info.java | 13 + .../package-info.java | 13 + .../AcceptanceTests/acceptanceTests.ts | 15 +- ...RestParameterizedCustomHostTestClient.d.ts | 44 ++++ ...toRestParameterizedCustomHostTestClient.js | 65 +++++ .../models/errorModel.js | 58 +++++ .../models/index.d.ts | 24 ++ .../CustomBaseUriMoreOptions/models/index.js | 17 ++ .../operations/index.d.ts | 44 ++++ .../operations/index.js | 17 ++ .../operations/paths.js | 167 ++++++++++++ .../__init__.py | 21 ++ ...t_parameterized_custom_host_test_client.py | 69 +++++ .../credentials.py | 15 ++ .../exceptions.py | 21 ++ .../models/__init__.py | 16 ++ .../models/error.py | 44 ++++ .../operations/__init__.py | 16 ++ .../operations/paths.py | 87 +++++++ .../version.py | 13 + .../CustomBaseUriMoreOptions/setup.py | 40 +++ .../Python/Python.Tests/Python.Tests.pyproj | 4 + AutoRest/TestServer/server/app.js | 2 + .../TestServer/server/routes/customUri.js | 11 + .../swagger/custom-baseUrl-more-options.json | 109 ++++++++ Documentation/swagger-extensions.md | 2 + gulpfile.js | 3 +- schema/swagger-extensions.json | 9 + 47 files changed, 2378 insertions(+), 17 deletions(-) create mode 100644 AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/AutoRestParameterizedCustomHostTestClient.cs create mode 100644 AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/IAutoRestParameterizedCustomHostTestClient.cs create mode 100644 AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/IPaths.cs create mode 100644 AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/Models/Error.cs create mode 100644 AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/Models/ErrorException.cs create mode 100644 AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/Paths.cs create mode 100644 AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/PathsExtensions.cs create mode 100644 AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/AutoRestParameterizedCustomHostTestClient.java create mode 100644 AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/AutoRestParameterizedCustomHostTestClientImpl.java create mode 100644 AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/PathsOperations.java create mode 100644 AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/PathsOperationsImpl.java create mode 100644 AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/models/Error.java create mode 100644 AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/models/ErrorException.java create mode 100644 AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/models/package-info.java create mode 100644 AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/package-info.java create mode 100644 AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autoRestParameterizedCustomHostTestClient.d.ts create mode 100644 AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autoRestParameterizedCustomHostTestClient.js create mode 100644 AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/models/errorModel.js create mode 100644 AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/models/index.d.ts create mode 100644 AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/models/index.js create mode 100644 AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/operations/index.d.ts create mode 100644 AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/operations/index.js create mode 100644 AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/operations/paths.js create mode 100644 AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/__init__.py create mode 100644 AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/auto_rest_parameterized_custom_host_test_client.py create mode 100644 AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/credentials.py create mode 100644 AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/exceptions.py create mode 100644 AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/models/__init__.py create mode 100644 AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/models/error.py create mode 100644 AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/operations/__init__.py create mode 100644 AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/operations/paths.py create mode 100644 AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/version.py create mode 100644 AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/setup.py create mode 100644 AutoRest/TestServer/swagger/custom-baseUrl-more-options.json diff --git a/AutoRest/Generators/AzureResourceSchema/AzureResourceSchema.Tests/AutoRest.Generator.AzureResourceSchema.Tests.csproj b/AutoRest/Generators/AzureResourceSchema/AzureResourceSchema.Tests/AutoRest.Generator.AzureResourceSchema.Tests.csproj index 079278b9d781b..01522ea89f2b4 100644 --- a/AutoRest/Generators/AzureResourceSchema/AzureResourceSchema.Tests/AutoRest.Generator.AzureResourceSchema.Tests.csproj +++ b/AutoRest/Generators/AzureResourceSchema/AzureResourceSchema.Tests/AutoRest.Generator.AzureResourceSchema.Tests.csproj @@ -62,7 +62,9 @@ - + + PreserveNewest + diff --git a/AutoRest/Generators/AzureResourceSchema/AzureResourceSchema.Tests/packages.config b/AutoRest/Generators/AzureResourceSchema/AzureResourceSchema.Tests/packages.config index 64fb5d7b3b792..4e690e09d9def 100644 --- a/AutoRest/Generators/AzureResourceSchema/AzureResourceSchema.Tests/packages.config +++ b/AutoRest/Generators/AzureResourceSchema/AzureResourceSchema.Tests/packages.config @@ -1,10 +1,10 @@  - - - - - - - + + + + + + + \ No newline at end of file diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/AcceptanceTests.cs b/AutoRest/Generators/CSharp/CSharp.Tests/AcceptanceTests.cs index 0c6e31b1c1467..0d5c31f0e5182 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/AcceptanceTests.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/AcceptanceTests.cs @@ -50,6 +50,7 @@ using Fixtures.PetstoreV2; using Fixtures.AcceptanceTestsCompositeBoolIntClient; using Fixtures.AcceptanceTestsCustomBaseUri; +using Fixtures.AcceptanceTestsCustomBaseUriMoreOptions; using System.Net.Http; using Fixtures.AcceptanceTestsModelFlattening; using Fixtures.AcceptanceTestsModelFlattening.Models; @@ -1951,6 +1952,21 @@ public void CustomBaseUriTests() } } + [Fact] + public void CustomBaseUriMoreOptionsTests() + { + SwaggerSpecRunner.RunTests( + SwaggerPath("custom-baseUrl-more-options.json"), ExpectedPath("CustomBaseUriMoreOptions")); + using (var client = new AutoRestParameterizedCustomHostTestClient()) + { + client.SubscriptionId = "test12"; + // small modification to the "host" portion to include the port and the '.' + client.DnsSuffix = string.Format(CultureInfo.InvariantCulture, "{0}.:{1}", "host", Fixture.Port); + Assert.Equal(HttpStatusCode.OK, + client.Paths.GetEmptyWithHttpMessagesAsync("http://lo", "cal", "key1").Result.Response.StatusCode); + } + } + [Fact] public void CustomBaseUriNegativeTests() { diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/AutoRestParameterizedCustomHostTestClient.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/AutoRestParameterizedCustomHostTestClient.cs new file mode 100644 index 0000000000000..e680cbe6a8731 --- /dev/null +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/AutoRestParameterizedCustomHostTestClient.cs @@ -0,0 +1,128 @@ +// 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.AcceptanceTestsCustomBaseUriMoreOptions +{ + using System; + using System.Linq; + using System.Collections.Generic; + using System.Diagnostics; + using System.Net; + using System.Net.Http; + using System.Net.Http.Headers; + using System.Text; + using System.Text.RegularExpressions; + using System.Threading; + using System.Threading.Tasks; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using Models; + + /// + /// Test Infrastructure for AutoRest + /// + public partial class AutoRestParameterizedCustomHostTestClient : ServiceClient, IAutoRestParameterizedCustomHostTestClient + { + /// + /// The base URI of the service. + /// + internal string BaseUri {get; set;} + + /// + /// Gets or sets json serialization settings. + /// + public JsonSerializerSettings SerializationSettings { get; private set; } + + /// + /// Gets or sets json deserialization settings. + /// + public JsonSerializerSettings DeserializationSettings { get; private set; } + + /// + /// The subscription id with value 'test12'. + /// + public string SubscriptionId { get; set; } + + /// + /// A string value that is used as a global part of the parameterized host. + /// Default value 'host'. + /// + public string DnsSuffix { get; set; } + + /// + /// Gets the IPaths. + /// + public virtual IPaths Paths { get; private set; } + + /// + /// Initializes a new instance of the AutoRestParameterizedCustomHostTestClient class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + public AutoRestParameterizedCustomHostTestClient(params DelegatingHandler[] handlers) : base(handlers) + { + this.Initialize(); + } + + /// + /// Initializes a new instance of the AutoRestParameterizedCustomHostTestClient class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + public AutoRestParameterizedCustomHostTestClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + this.Initialize(); + } + + /// + /// An optional partial-method to perform custom initialization. + /// + partial void CustomInitialize(); + /// + /// Initializes client properties. + /// + private void Initialize() + { + this.Paths = new Paths(this); + this.BaseUri = "{vault}{secret}{dnsSuffix}"; + this.DnsSuffix = "host"; + SerializationSettings = new JsonSerializerSettings + { + Formatting = Formatting.Indented, + DateFormatHandling = DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = DateTimeZoneHandling.Utc, + NullValueHandling = NullValueHandling.Ignore, + ReferenceLoopHandling = ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + DeserializationSettings = new JsonSerializerSettings + { + DateFormatHandling = DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = DateTimeZoneHandling.Utc, + NullValueHandling = NullValueHandling.Ignore, + ReferenceLoopHandling = ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + CustomInitialize(); + } + } +} diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/IAutoRestParameterizedCustomHostTestClient.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/IAutoRestParameterizedCustomHostTestClient.cs new file mode 100644 index 0000000000000..87db999d81c42 --- /dev/null +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/IAutoRestParameterizedCustomHostTestClient.cs @@ -0,0 +1,57 @@ +// 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.AcceptanceTestsCustomBaseUriMoreOptions +{ + using System; + using System.Collections.Generic; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + using Newtonsoft.Json; + using Microsoft.Rest; + using Models; + + /// + /// Test Infrastructure for AutoRest + /// + public partial interface IAutoRestParameterizedCustomHostTestClient : IDisposable + { + /// + /// The base URI of the service. + /// + + /// + /// Gets or sets json serialization settings. + /// + JsonSerializerSettings SerializationSettings { get; } + + /// + /// Gets or sets json deserialization settings. + /// + JsonSerializerSettings DeserializationSettings { get; } + + /// + /// The subscription id with value 'test12'. + /// + string SubscriptionId { get; set; } + + /// + /// A string value that is used as a global part of the parameterized + /// host. Default value 'host'. + /// + string DnsSuffix { get; set; } + + + /// + /// Gets the IPaths. + /// + IPaths Paths { get; } + + } +} diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/IPaths.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/IPaths.cs new file mode 100644 index 0000000000000..a117b914e7526 --- /dev/null +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/IPaths.cs @@ -0,0 +1,47 @@ +// 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.AcceptanceTestsCustomBaseUriMoreOptions +{ + using System; + using System.Collections.Generic; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + using Microsoft.Rest; + using Models; + + /// + /// Paths operations. + /// + public partial interface IPaths + { + /// + /// Get a 200 to test a valid base uri + /// + /// + /// The vault name, e.g. https://myvault + /// + /// + /// Secret value. + /// + /// + /// The key name with value 'key1'. + /// + /// + /// The key version. Default value 'v1'. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task GetEmptyWithHttpMessagesAsync(string vault, string secret, string keyName, string keyVersion = "v1", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/Models/Error.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/Models/Error.cs new file mode 100644 index 0000000000000..82a4873e61389 --- /dev/null +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/Models/Error.cs @@ -0,0 +1,45 @@ +// 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.AcceptanceTestsCustomBaseUriMoreOptions.Models +{ + using System; + using System.Linq; + using System.Collections.Generic; + using Newtonsoft.Json; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + + public partial class Error + { + /// + /// Initializes a new instance of the Error class. + /// + public Error() { } + + /// + /// Initializes a new instance of the Error class. + /// + public Error(int? status = default(int?), string message = default(string)) + { + Status = status; + Message = message; + } + + /// + /// + [JsonProperty(PropertyName = "status")] + public int? Status { get; set; } + + /// + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + } +} diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/Models/ErrorException.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/Models/ErrorException.cs new file mode 100644 index 0000000000000..e3ab1c0a08abc --- /dev/null +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/Models/ErrorException.cs @@ -0,0 +1,99 @@ +// 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.AcceptanceTestsCustomBaseUriMoreOptions.Models +{ + using Microsoft.Rest; + using System; + using System.Net.Http; + using System.Runtime.Serialization; +#if !PORTABLE && !DNXCORE50 + using System.Security.Permissions; +#endif + + /// + /// Exception thrown for an invalid response with Error information. + /// +#if !PORTABLE && !DNXCORE50 + [Serializable] +#endif + public class ErrorException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public Error Body { get; set; } + + /// + /// Initializes a new instance of the ErrorException class. + /// + public ErrorException() + { + } + + /// + /// Initializes a new instance of the ErrorException class. + /// + /// The exception message. + public ErrorException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ErrorException class. + /// + /// The exception message. + /// Inner exception. + public ErrorException(string message, Exception innerException) + : base(message, innerException) + { + } + +#if !PORTABLE && !DNXCORE50 + /// + /// Initializes a new instance of the ErrorException class. + /// + /// Serialization info. + /// Streaming context. + protected ErrorException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } + + /// + /// Serializes content of the exception. + /// + /// Serialization info. + /// Streaming context. + [SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)] + public override void GetObjectData(SerializationInfo info, StreamingContext context) + { + base.GetObjectData(info, context); + if (info == null) + { + throw new ArgumentNullException("info"); + } + + info.AddValue("Request", Request); + info.AddValue("Response", Response); + info.AddValue("Body", Body); + } +#endif + } +} diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/Paths.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/Paths.cs new file mode 100644 index 0000000000000..a8599cf083382 --- /dev/null +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/Paths.cs @@ -0,0 +1,203 @@ +// 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.AcceptanceTestsCustomBaseUriMoreOptions +{ + using System; + using System.Linq; + using System.Collections.Generic; + using System.Net; + using System.Net.Http; + using System.Net.Http.Headers; + using System.Text; + using System.Text.RegularExpressions; + using System.Threading; + using System.Threading.Tasks; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using Models; + + /// + /// Paths operations. + /// + public partial class Paths : IServiceOperations, IPaths + { + /// + /// Initializes a new instance of the Paths class. + /// + /// + /// Reference to the service client. + /// + public Paths(AutoRestParameterizedCustomHostTestClient client) + { + if (client == null) + { + throw new ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the AutoRestParameterizedCustomHostTestClient + /// + public AutoRestParameterizedCustomHostTestClient Client { get; private set; } + + /// + /// Get a 200 to test a valid base uri + /// + /// + /// The vault name, e.g. https://myvault + /// + /// + /// Secret value. + /// + /// + /// The key name with value 'key1'. + /// + /// + /// The key version. Default value 'v1'. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task GetEmptyWithHttpMessagesAsync(string vault, string secret, string keyName, string keyVersion = "v1", Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (vault == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vault"); + } + if (secret == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "secret"); + } + if (this.Client.DnsSuffix == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.DnsSuffix"); + } + if (keyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "keyName"); + } + if (this.Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vault", vault); + tracingParameters.Add("secret", secret); + tracingParameters.Add("keyName", keyName); + tracingParameters.Add("keyVersion", keyVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetEmpty", tracingParameters); + } + // Construct URL + var _baseUrl = this.Client.BaseUri; + var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "customuri/{subscriptionId}/{keyName}"; + _url = _url.Replace("{vault}", vault); + _url = _url.Replace("{secret}", secret); + _url = _url.Replace("{dnsSuffix}", this.Client.DnsSuffix); + _url = _url.Replace("{keyName}", Uri.EscapeDataString(keyName)); + _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + List _queryParameters = new List(); + if (keyVersion != null) + { + _queryParameters.Add(string.Format("keyVersion={0}", Uri.EscapeDataString(keyVersion))); + } + if (_queryParameters.Count > 0) + { + _url += "?" + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + HttpRequestMessage _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new Uri(_url); + // Set Headers + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new HttpOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/PathsExtensions.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/PathsExtensions.cs new file mode 100644 index 0000000000000..c553414304ed0 --- /dev/null +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/PathsExtensions.cs @@ -0,0 +1,74 @@ +// 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.AcceptanceTestsCustomBaseUriMoreOptions +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + using Microsoft.Rest; + using Models; + + /// + /// Extension methods for Paths. + /// + public static partial class PathsExtensions + { + /// + /// Get a 200 to test a valid base uri + /// + /// + /// The operations group for this extension method. + /// + /// + /// The vault name, e.g. https://myvault + /// + /// + /// Secret value. + /// + /// + /// The key name with value 'key1'. + /// + /// + /// The key version. Default value 'v1'. + /// + public static void GetEmpty(this IPaths operations, string vault, string secret, string keyName, string keyVersion = "v1") + { + Task.Factory.StartNew(s => ((IPaths)s).GetEmptyAsync(vault, secret, keyName, keyVersion), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Get a 200 to test a valid base uri + /// + /// + /// The operations group for this extension method. + /// + /// + /// The vault name, e.g. https://myvault + /// + /// + /// Secret value. + /// + /// + /// The key name with value 'key1'. + /// + /// + /// The key version. Default value 'v1'. + /// + /// + /// The cancellation token. + /// + public static async Task GetEmptyAsync(this IPaths operations, string vault, string secret, string keyName, string keyVersion = "v1", CancellationToken cancellationToken = default(CancellationToken)) + { + await operations.GetEmptyWithHttpMessagesAsync(vault, secret, keyName, keyVersion, null, cancellationToken).ConfigureAwait(false); + } + + } +} diff --git a/AutoRest/Generators/Extensions/Extensions/Extensions.cs b/AutoRest/Generators/Extensions/Extensions/Extensions.cs index e974d9563af25..b80820b8c0c58 100644 --- a/AutoRest/Generators/Extensions/Extensions/Extensions.cs +++ b/AutoRest/Generators/Extensions/Extensions/Extensions.cs @@ -12,6 +12,8 @@ using Microsoft.Rest.Modeler.Swagger.Model; using Newtonsoft.Json.Linq; using Newtonsoft.Json; +using System.Text.RegularExpressions; +using Microsoft.Rest.Generator.Properties; namespace Microsoft.Rest.Generator { @@ -27,6 +29,8 @@ public abstract class Extensions public const string FlattenOriginalTypeName = "x-ms-client-flatten-original-type-name"; public const string ParameterGroupExtension = "x-ms-parameter-grouping"; public const string ParameterizedHostExtension = "x-ms-parameterized-host"; + public const string UseSchemePrefix = "useSchemePrefix"; + public const string PositionInOperation = "positionInOperation"; private static bool hostChecked = false; @@ -67,6 +71,28 @@ public static void ProcessParameterizedHost(ServiceClient serviceClient, Setting { var hostTemplate = (string)hostExtension["hostTemplate"]; var parametersJson = hostExtension["parameters"].ToString(); + var useSchemePrefix = true; + if (hostExtension[UseSchemePrefix] != null) + { + useSchemePrefix = bool.Parse(hostExtension[UseSchemePrefix].ToString()); + } + + var position = "last"; + + if (hostExtension[PositionInOperation] != null) + { + var pat = "^(fir|la)st$"; + Regex r = new Regex(pat, RegexOptions.IgnoreCase); + var text = hostExtension[PositionInOperation].ToString(); + Match m = r.Match(text); + if (!m.Success) + { + throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, + Resources.InvalidExtensionProperty, text, PositionInOperation, ParameterizedHostExtension, "first, last")); + } + position = text; + } + if (!string.IsNullOrEmpty(parametersJson)) { var jsonSettings = new JsonSerializerSettings @@ -76,7 +102,7 @@ public static void ProcessParameterizedHost(ServiceClient serviceClient, Setting }; var swaggerParams = JsonConvert.DeserializeObject>(parametersJson, jsonSettings); - + List hostParamList = new List(); foreach (var swaggerParameter in swaggerParams) { // Build parameter @@ -89,16 +115,33 @@ public static void ProcessParameterizedHost(ServiceClient serviceClient, Setting parameter.ClientProperty = serviceClient.Properties.Single(p => p.SerializedName.Equals(parameter.SerializedName)); } parameter.Extensions["hostParameter"] = true; + hostParamList.Add(parameter); + } - foreach (var method in serviceClient.Methods) + foreach (var method in serviceClient.Methods) + { + if (position.Equals("first", StringComparison.OrdinalIgnoreCase)) { - method.Parameters.Add(parameter); + method.Parameters.InsertRange(0, hostParamList); } + else + { + method.Parameters.AddRange(hostParamList); + } + } - - serviceClient.BaseUrl = string.Format(CultureInfo.InvariantCulture, "{0}://{1}{2}", - modeler.ServiceDefinition.Schemes[0].ToString().ToLowerInvariant(), - hostTemplate, modeler.ServiceDefinition.BasePath); + if (useSchemePrefix) + { + serviceClient.BaseUrl = string.Format(CultureInfo.InvariantCulture, "{0}://{1}{2}", + modeler.ServiceDefinition.Schemes[0].ToString().ToLowerInvariant(), + hostTemplate, modeler.ServiceDefinition.BasePath); + } + else + { + serviceClient.BaseUrl = string.Format(CultureInfo.InvariantCulture, "{0}{1}", + hostTemplate, modeler.ServiceDefinition.BasePath); + } + } } } diff --git a/AutoRest/Generators/Extensions/Extensions/Properties/Resources.Designer.cs b/AutoRest/Generators/Extensions/Extensions/Properties/Resources.Designer.cs index 689a601b826f3..f98e2ea0b022c 100644 --- a/AutoRest/Generators/Extensions/Extensions/Properties/Resources.Designer.cs +++ b/AutoRest/Generators/Extensions/Extensions/Properties/Resources.Designer.cs @@ -69,6 +69,15 @@ internal static string HeadMethodInvalidResponses { } } + /// + /// Looks up a localized string similar to The value '{0}' provided for property '{1}' of extension '{2} is invalid. Valid values are: '{3}'.. + /// + internal static string InvalidExtensionProperty { + get { + return ResourceManager.GetString("InvalidExtensionProperty", resourceCulture); + } + } + /// /// Looks up a localized string similar to Azure resource {0} is missing required 'properties' property.. /// diff --git a/AutoRest/Generators/Extensions/Extensions/Properties/Resources.resx b/AutoRest/Generators/Extensions/Extensions/Properties/Resources.resx index d06a580a716fe..7df584f0a47aa 100644 --- a/AutoRest/Generators/Extensions/Extensions/Properties/Resources.resx +++ b/AutoRest/Generators/Extensions/Extensions/Properties/Resources.resx @@ -120,6 +120,9 @@ Head method '{0}' should contain only 200 level responses, or 404. + + The value '{0}' provided for property '{1}' of extension '{2} is invalid. Valid values are: '{3}'. + Azure resource {0} is missing required 'properties' property. diff --git a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/AutoRestParameterizedCustomHostTestClient.java b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/AutoRestParameterizedCustomHostTestClient.java new file mode 100644 index 0000000000000..7c5bb29be05d4 --- /dev/null +++ b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/AutoRestParameterizedCustomHostTestClient.java @@ -0,0 +1,86 @@ +/** + * 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. + */ + +package fixtures.custombaseurimoreoptions; + +import java.util.List; +import okhttp3.Interceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import com.microsoft.rest.AutoRestBaseUrl; +import com.microsoft.rest.serializer.JacksonMapperAdapter; + +/** + * The interface for AutoRestParameterizedCustomHostTestClient class. + */ +public interface AutoRestParameterizedCustomHostTestClient { + /** + * Gets the URL used as the base for all cloud service requests. + * + * @return the BaseUrl object. + */ + AutoRestBaseUrl getBaseUrl(); + + /** + * Gets the list of interceptors the OkHttp client will execute. + * + * @return the list of interceptors. + */ + List getClientInterceptors(); + + /** + * Sets the logging level for OkHttp client. + * + * @param logLevel the logging level enum. + */ + void setLogLevel(Level logLevel); + + /** + * Gets the adapter for {@link com.fasterxml.jackson.databind.ObjectMapper} for serialization + * and deserialization operations.. + * + * @return the adapter. + */ + JacksonMapperAdapter getMapperAdapter(); + + /** + * Gets The subscription id with value 'test12'.. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Sets The subscription id with value 'test12'.. + * + * @param subscriptionId the subscriptionId value. + */ + void setSubscriptionId(String subscriptionId); + + /** + * Gets A string value that is used as a global part of the parameterized host. Default value 'host'.. + * + * @return the dnsSuffix value. + */ + String getDnsSuffix(); + + /** + * Sets A string value that is used as a global part of the parameterized host. Default value 'host'.. + * + * @param dnsSuffix the dnsSuffix value. + */ + void setDnsSuffix(String dnsSuffix); + + /** + * Gets the PathsOperations object to access its operations. + * @return the PathsOperations object. + */ + PathsOperations getPathsOperations(); + +} diff --git a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/AutoRestParameterizedCustomHostTestClientImpl.java b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/AutoRestParameterizedCustomHostTestClientImpl.java new file mode 100644 index 0000000000000..ad9fe946dc423 --- /dev/null +++ b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/AutoRestParameterizedCustomHostTestClientImpl.java @@ -0,0 +1,121 @@ +/** + * 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. + */ + +package fixtures.custombaseurimoreoptions; + +import com.microsoft.rest.ServiceClient; +import com.microsoft.rest.AutoRestBaseUrl; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; + +/** + * Initializes a new instance of the AutoRestParameterizedCustomHostTestClient class. + */ +public final class AutoRestParameterizedCustomHostTestClientImpl extends ServiceClient implements AutoRestParameterizedCustomHostTestClient { + /** + * The URL used as the base for all cloud service requests. + */ + private final AutoRestBaseUrl baseUrl; + + /** + * Gets the URL used as the base for all cloud service requests. + * + * @return The BaseUrl value. + */ + public AutoRestBaseUrl getBaseUrl() { + return this.baseUrl; + } + + /** The subscription id with value 'test12'. */ + private String subscriptionId; + + /** + * Gets The subscription id with value 'test12'. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The subscription id with value 'test12'. + * + * @param subscriptionId the subscriptionId value. + */ + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + /** A string value that is used as a global part of the parameterized host. Default value 'host'. */ + private String dnsSuffix; + + /** + * Gets A string value that is used as a global part of the parameterized host. Default value 'host'. + * + * @return the dnsSuffix value. + */ + public String getDnsSuffix() { + return this.dnsSuffix; + } + + /** + * Sets A string value that is used as a global part of the parameterized host. Default value 'host'. + * + * @param dnsSuffix the dnsSuffix value. + */ + public void setDnsSuffix(String dnsSuffix) { + this.dnsSuffix = dnsSuffix; + } + + /** + * Gets the PathsOperations object to access its operations. + * @return the PathsOperations object. + */ + public PathsOperations getPathsOperations() { + return new PathsOperationsImpl(this.retrofitBuilder.client(clientBuilder.build()).build(), this); + } + + /** + * Initializes an instance of AutoRestParameterizedCustomHostTestClient client. + */ + public AutoRestParameterizedCustomHostTestClientImpl() { + this("{vault}{secret}{dnsSuffix}"); + } + + /** + * Initializes an instance of AutoRestParameterizedCustomHostTestClient client. + * + * @param baseUrl the base URL of the host + */ + private AutoRestParameterizedCustomHostTestClientImpl(String baseUrl) { + super(); + this.baseUrl = new AutoRestBaseUrl(baseUrl); + initialize(); + } + + /** + * Initializes an instance of AutoRestParameterizedCustomHostTestClient client. + * + * @param clientBuilder the builder for building up an {@link OkHttpClient} + * @param retrofitBuilder the builder for building up a {@link Retrofit} + */ + public AutoRestParameterizedCustomHostTestClientImpl(OkHttpClient.Builder clientBuilder, Retrofit.Builder retrofitBuilder) { + super(clientBuilder, retrofitBuilder); + this.baseUrl = new AutoRestBaseUrl("{vault}{secret}{dnsSuffix}"); + initialize(); + } + + @Override + protected void initialize() { + super.initialize(); + this.retrofitBuilder.baseUrl(baseUrl); + } +} diff --git a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/PathsOperations.java b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/PathsOperations.java new file mode 100644 index 0000000000000..6273f3426d73c --- /dev/null +++ b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/PathsOperations.java @@ -0,0 +1,75 @@ +/** + * 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. + */ + +package fixtures.custombaseurimoreoptions; + +import com.microsoft.rest.ServiceCall; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceResponse; +import fixtures.custombaseurimoreoptions.models.ErrorException; +import java.io.IOException; + +/** + * An instance of this class provides access to all the operations defined + * in PathsOperations. + */ +public interface PathsOperations { + /** + * Get a 200 to test a valid base uri. + * + * @param vault The vault name, e.g. https://myvault + * @param secret Secret value. + * @param keyName The key name with value 'key1'. + * @throws ErrorException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse getEmpty(String vault, String secret, String keyName) throws ErrorException, IOException, IllegalArgumentException; + + /** + * Get a 200 to test a valid base uri. + * + * @param vault The vault name, e.g. https://myvault + * @param secret Secret value. + * @param keyName The key name with value 'key1'. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getEmptyAsync(String vault, String secret, String keyName, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Get a 200 to test a valid base uri. + * + * @param vault The vault name, e.g. https://myvault + * @param secret Secret value. + * @param keyName The key name with value 'key1'. + * @param keyVersion The key version. Default value 'v1'. + * @throws ErrorException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse getEmpty(String vault, String secret, String keyName, String keyVersion) throws ErrorException, IOException, IllegalArgumentException; + + /** + * Get a 200 to test a valid base uri. + * + * @param vault The vault name, e.g. https://myvault + * @param secret Secret value. + * @param keyName The key name with value 'key1'. + * @param keyVersion The key version. Default value 'v1'. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getEmptyAsync(String vault, String secret, String keyName, String keyVersion, final ServiceCallback serviceCallback) throws IllegalArgumentException; + +} diff --git a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/PathsOperationsImpl.java b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/PathsOperationsImpl.java new file mode 100644 index 0000000000000..13994720257bd --- /dev/null +++ b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/PathsOperationsImpl.java @@ -0,0 +1,245 @@ +/** + * 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. + */ + +package fixtures.custombaseurimoreoptions; + +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCall; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseBuilder; +import com.microsoft.rest.ServiceResponseCallback; +import fixtures.custombaseurimoreoptions.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.Call; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import retrofit2.Retrofit; + +/** + * An instance of this class provides access to all the operations defined + * in PathsOperations. + */ +public final class PathsOperationsImpl implements PathsOperations { + /** The Retrofit service to perform REST calls. */ + private PathsService service; + /** The service client containing this operation class. */ + private AutoRestParameterizedCustomHostTestClient client; + + /** + * Initializes an instance of PathsOperations. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PathsOperationsImpl(Retrofit retrofit, AutoRestParameterizedCustomHostTestClient client) { + this.service = retrofit.create(PathsService.class); + this.client = client; + } + + /** + * The interface defining all the services for PathsOperations to be + * used by Retrofit to perform actually REST calls. + */ + interface PathsService { + @Headers("Content-Type: application/json; charset=utf-8") + @GET("customuri/{subscriptionId}/{keyName}") + Call getEmpty(@Path("keyName") String keyName, @Path("subscriptionId") String subscriptionId, @Query("keyVersion") String keyVersion); + + } + + /** + * Get a 200 to test a valid base uri. + * + * @param vault The vault name, e.g. https://myvault + * @param secret Secret value. + * @param keyName The key name with value 'key1'. + * @throws ErrorException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse getEmpty(String vault, String secret, String keyName) throws ErrorException, IOException, IllegalArgumentException { + if (vault == null) { + throw new IllegalArgumentException("Parameter vault is required and cannot be null."); + } + if (secret == null) { + throw new IllegalArgumentException("Parameter secret is required and cannot be null."); + } + if (this.client.getDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getDnsSuffix() is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + final String keyVersion = null; + this.client.getBaseUrl().set("{vault}", vault); + this.client.getBaseUrl().set("{secret}", secret); + this.client.getBaseUrl().set("{dnsSuffix}", this.client.getDnsSuffix()); + Call call = service.getEmpty(keyName, this.client.getSubscriptionId(), keyVersion); + return getEmptyDelegate(call.execute()); + } + + /** + * Get a 200 to test a valid base uri. + * + * @param vault The vault name, e.g. https://myvault + * @param secret Secret value. + * @param keyName The key name with value 'key1'. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getEmptyAsync(String vault, String secret, String keyName, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (vault == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter vault is required and cannot be null.")); + return null; + } + if (secret == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter secret is required and cannot be null.")); + return null; + } + if (this.client.getDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getDnsSuffix() is required and cannot be null.")); + return null; + } + if (keyName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + final String keyVersion = null; + this.client.getBaseUrl().set("{vault}", vault); + this.client.getBaseUrl().set("{secret}", secret); + this.client.getBaseUrl().set("{dnsSuffix}", this.client.getDnsSuffix()); + Call call = service.getEmpty(keyName, this.client.getSubscriptionId(), keyVersion); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getEmptyDelegate(response)); + } catch (ErrorException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Get a 200 to test a valid base uri. + * + * @param vault The vault name, e.g. https://myvault + * @param secret Secret value. + * @param keyName The key name with value 'key1'. + * @param keyVersion The key version. Default value 'v1'. + * @throws ErrorException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse getEmpty(String vault, String secret, String keyName, String keyVersion) throws ErrorException, IOException, IllegalArgumentException { + if (vault == null) { + throw new IllegalArgumentException("Parameter vault is required and cannot be null."); + } + if (secret == null) { + throw new IllegalArgumentException("Parameter secret is required and cannot be null."); + } + if (this.client.getDnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.getDnsSuffix() is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (this.client.getSubscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."); + } + this.client.getBaseUrl().set("{vault}", vault); + this.client.getBaseUrl().set("{secret}", secret); + this.client.getBaseUrl().set("{dnsSuffix}", this.client.getDnsSuffix()); + Call call = service.getEmpty(keyName, this.client.getSubscriptionId(), keyVersion); + return getEmptyDelegate(call.execute()); + } + + /** + * Get a 200 to test a valid base uri. + * + * @param vault The vault name, e.g. https://myvault + * @param secret Secret value. + * @param keyName The key name with value 'key1'. + * @param keyVersion The key version. Default value 'v1'. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getEmptyAsync(String vault, String secret, String keyName, String keyVersion, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (vault == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter vault is required and cannot be null.")); + return null; + } + if (secret == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter secret is required and cannot be null.")); + return null; + } + if (this.client.getDnsSuffix() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getDnsSuffix() is required and cannot be null.")); + return null; + } + if (keyName == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + return null; + } + if (this.client.getSubscriptionId() == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return null; + } + this.client.getBaseUrl().set("{vault}", vault); + this.client.getBaseUrl().set("{secret}", secret); + this.client.getBaseUrl().set("{dnsSuffix}", this.client.getDnsSuffix()); + Call call = service.getEmpty(keyName, this.client.getSubscriptionId(), keyVersion); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getEmptyDelegate(response)); + } catch (ErrorException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getEmptyDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return new ServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/models/Error.java b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/models/Error.java new file mode 100644 index 0000000000000..73232cf4ed434 --- /dev/null +++ b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/models/Error.java @@ -0,0 +1,64 @@ +/** + * 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. + */ + +package fixtures.custombaseurimoreoptions.models; + + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + private Integer status; + + /** + * The message property. + */ + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer getStatus() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + */ + public void setStatus(Integer status) { + this.status = status; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String getMessage() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + */ + public void setMessage(String message) { + this.message = message; + } + +} diff --git a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/models/ErrorException.java b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/models/ErrorException.java new file mode 100644 index 0000000000000..0c4458e200dac --- /dev/null +++ b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/models/ErrorException.java @@ -0,0 +1,89 @@ +/** + * 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. + */ + +package fixtures.custombaseurimoreoptions.models; + +import com.microsoft.rest.AutoRestException; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends AutoRestException { + /** + * Information about the associated HTTP response. + */ + private Response response; + /** + * The actual response body. + */ + private Error body; + /** + * Initializes a new instance of the ErrorException class. + */ + public ErrorException() { } + /** + * Initializes a new instance of the ErrorException class. + * + * @param message The exception message. + */ + public ErrorException(final String message) { + super(message); + } + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message + * @param cause exception that caused this exception to occur + */ + public ErrorException(final String message, final Throwable cause) { + super(message, cause); + } + /** + * Initializes a new instance of the ErrorException class. + * + * @param cause exception that caused this exception to occur + */ + public ErrorException(final Throwable cause) { + super(cause); + } + /** + * Gets information about the associated HTTP response. + * + * @return the HTTP response + */ + public Response getResponse() { + return response; + } + /** + * Gets the HTTP response body. + * + * @return the response body + */ + public Error getBody() { + return body; + } + /** + * Sets the HTTP response. + * + * @param response the HTTP response + */ + public void setResponse(Response response) { + this.response = response; + } + /** + * Sets the HTTP response body. + * + * @param body the response body + */ + public void setBody(Error body) { + this.body = body; + } +} diff --git a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/models/package-info.java b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/models/package-info.java new file mode 100644 index 0000000000000..b5c9a91ec97d8 --- /dev/null +++ b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/models/package-info.java @@ -0,0 +1,13 @@ +// 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. + +/** + * This package contains the model classes for AutoRestParameterizedCustomHostTestClient. + * Test Infrastructure for AutoRest. + */ +package fixtures.custombaseurimoreoptions.models; diff --git a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/package-info.java b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/package-info.java new file mode 100644 index 0000000000000..a6434083eb1c5 --- /dev/null +++ b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/custombaseurimoreoptions/package-info.java @@ -0,0 +1,13 @@ +// 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. + +/** + * This package contains the classes for AutoRestParameterizedCustomHostTestClient. + * Test Infrastructure for AutoRest. + */ +package fixtures.custombaseurimoreoptions; diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/AcceptanceTests/acceptanceTests.ts b/AutoRest/Generators/NodeJS/NodeJS.Tests/AcceptanceTests/acceptanceTests.ts index c7404da84e360..0a81b3420068b 100644 --- a/AutoRest/Generators/NodeJS/NodeJS.Tests/AcceptanceTests/acceptanceTests.ts +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/AcceptanceTests/acceptanceTests.ts @@ -32,7 +32,7 @@ import dictionaryModels = require('../Expected/AcceptanceTests/BodyDictionary/mo import httpClient = require('../Expected/AcceptanceTests/Http/autoRestHttpInfrastructureTestService'); import formDataClient = require('../Expected/AcceptanceTests/BodyFormData/autoRestSwaggerBATFormDataService'); import customBaseUriClient = require('../Expected/AcceptanceTests/CustomBaseUri/autoRestParameterizedHostTestClient'); - +import customBaseUriClientMoreOptions = require('../Expected/AcceptanceTests/CustomBaseUriMoreOptions/autoRestParameterizedCustomHostTestClient'); var dummyToken = 'dummy12321343423'; var credentials = new msRest.TokenCredentials(dummyToken); @@ -94,6 +94,19 @@ describe('nodejs', function () { }); }); }); + describe('Custom BaseUri Client with more options', function () { + var customOptions = { + dnsSuffix: 'host:3000' + }; + var testClient = new customBaseUriClientMoreOptions('test12', customOptions); + it('should return 200', function (done) { + testClient.paths.getEmpty('http://lo','cal', 'key1', function (error, result, request, response) { + should.not.exist(error); + response.statusCode.should.equal(200); + done(); + }); + }); + }); describe('Bool Client', function () { var testClient = new boolClient(baseUri, clientOptions); it('should get valid boolean values', function (done) { diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autoRestParameterizedCustomHostTestClient.d.ts b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autoRestParameterizedCustomHostTestClient.d.ts new file mode 100644 index 0000000000000..98c22ab85f4de --- /dev/null +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autoRestParameterizedCustomHostTestClient.d.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +import { ServiceClientOptions, RequestOptions, ServiceCallback } from 'ms-rest'; +import * as operations from "./operations"; + +declare class AutoRestParameterizedCustomHostTestClient { + /** + * @class + * Initializes a new instance of the AutoRestParameterizedCustomHostTestClient class. + * @constructor + * + * @param {string} subscriptionId - The subscription id with value 'test12'. + * + * @param {object} [options] - The parameter options + * + * @param {Array} [options.filters] - Filters to be added to the request pipeline + * + * @param {object} [options.requestOptions] - Options for the underlying request object + * {@link https://github.com/request/request#requestoptions-callback Options doc} + * + * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy + * + * @param {string} [options.dnsSuffix] - A string value that is used as a global part of the parameterized host. Default value 'host'. + * + */ + constructor(subscriptionId: string, options: ServiceClientOptions); + + subscriptionId: string; + + dnsSuffix: string; + + // Operation groups + paths: operations.Paths; + } + +export = AutoRestParameterizedCustomHostTestClient; diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autoRestParameterizedCustomHostTestClient.js b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autoRestParameterizedCustomHostTestClient.js new file mode 100644 index 0000000000000..391f7b50deb38 --- /dev/null +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autoRestParameterizedCustomHostTestClient.js @@ -0,0 +1,65 @@ +/* + * 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. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +var util = require('util'); +var msRest = require('ms-rest'); +var ServiceClient = msRest.ServiceClient; + +var models = require('./models'); +var operations = require('./operations'); + +/** + * @class + * Initializes a new instance of the AutoRestParameterizedCustomHostTestClient class. + * @constructor + * + * @param {string} subscriptionId - The subscription id with value 'test12'. + * + * @param {object} [options] - The parameter options + * + * @param {Array} [options.filters] - Filters to be added to the request pipeline + * + * @param {object} [options.requestOptions] - Options for the underlying request object + * {@link https://github.com/request/request#requestoptions-callback Options doc} + * + * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy + * + * @param {string} [options.dnsSuffix] - A string value that is used as a global part of the parameterized host. Default value 'host'. + * + */ +function AutoRestParameterizedCustomHostTestClient(subscriptionId, options) { + this.dnsSuffix = 'host'; + if (subscriptionId === null || subscriptionId === undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) options = {}; + + AutoRestParameterizedCustomHostTestClient['super_'].call(this, null, options); + this.baseUri = '{vault}{secret}{dnsSuffix}'; + this.subscriptionId = subscriptionId; + + if(options.dnsSuffix !== null && options.dnsSuffix !== undefined) { + this.dnsSuffix = options.dnsSuffix; + } + this.paths = new operations.Paths(this); + this.models = models; + msRest.addSerializationMixin(this); +} + +util.inherits(AutoRestParameterizedCustomHostTestClient, ServiceClient); + +module.exports = AutoRestParameterizedCustomHostTestClient; diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/models/errorModel.js b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/models/errorModel.js new file mode 100644 index 0000000000000..663be0f4aaa8c --- /dev/null +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/models/errorModel.js @@ -0,0 +1,58 @@ +/* + * 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. + */ + +'use strict'; + +/** + * @class + * Initializes a new instance of the ErrorModel class. + * @constructor + * @member {number} [status] + * + * @member {string} [message] + * + */ +function ErrorModel() { +} + +/** + * Defines the metadata of ErrorModel + * + * @returns {object} metadata of ErrorModel + * + */ +ErrorModel.prototype.mapper = function () { + return { + required: false, + serializedName: 'Error', + type: { + name: 'Composite', + className: 'ErrorModel', + modelProperties: { + status: { + required: false, + serializedName: 'status', + type: { + name: 'Number' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; +}; + +module.exports = ErrorModel; diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/models/index.d.ts b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/models/index.d.ts new file mode 100644 index 0000000000000..5405a199a0755 --- /dev/null +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/models/index.d.ts @@ -0,0 +1,24 @@ +/* + * 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. + */ + + +/** + * @class + * Initializes a new instance of the ErrorModel class. + * @constructor + * @member {number} [status] + * + * @member {string} [message] + * + */ +export interface ErrorModel { + status?: number; + message?: string; +} diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/models/index.js b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/models/index.js new file mode 100644 index 0000000000000..3430295d8bd86 --- /dev/null +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/models/index.js @@ -0,0 +1,17 @@ +/* + * 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. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +exports.ErrorModel = require('./errorModel'); diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/operations/index.d.ts b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/operations/index.d.ts new file mode 100644 index 0000000000000..3fa4ea5d9bf14 --- /dev/null +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/operations/index.d.ts @@ -0,0 +1,44 @@ +/* + * 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. +*/ + +import { ServiceClientOptions, RequestOptions, ServiceCallback } from 'ms-rest'; +import * as models from '../models'; + + +/** + * @class + * Paths + * __NOTE__: An instance of this class is automatically created for an + * instance of the AutoRestParameterizedCustomHostTestClient. + */ +export interface Paths { + + /** + * Get a 200 to test a valid base uri + * + * @param {string} vault The vault name, e.g. https://myvault + * + * @param {string} secret Secret value. + * + * @param {string} keyName The key name with value 'key1'. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.keyVersion] The key version. Default value 'v1'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getEmpty(vault: string, secret: string, keyName: string, options: { keyVersion? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getEmpty(vault: string, secret: string, keyName: string, callback: ServiceCallback): void; +} diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/operations/index.js b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/operations/index.js new file mode 100644 index 0000000000000..412d88e67668a --- /dev/null +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/operations/index.js @@ -0,0 +1,17 @@ +/* + * 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. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +exports.Paths = require('./paths'); diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/operations/paths.js b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/operations/paths.js new file mode 100644 index 0000000000000..dc2c66f05c60e --- /dev/null +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/operations/paths.js @@ -0,0 +1,167 @@ +/* + * 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. + */ + +'use strict'; + +var util = require('util'); +var msRest = require('ms-rest'); +var WebResource = msRest.WebResource; + +/** + * @class + * Paths + * __NOTE__: An instance of this class is automatically created for an + * instance of the AutoRestParameterizedCustomHostTestClient. + * Initializes a new instance of the Paths class. + * @constructor + * + * @param {AutoRestParameterizedCustomHostTestClient} client Reference to the service client. + */ +function Paths(client) { + this.client = client; +} + +/** + * Get a 200 to test a valid base uri + * + * @param {string} vault The vault name, e.g. https://myvault + * + * @param {string} secret Secret value. + * + * @param {string} keyName The key name with value 'key1'. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.keyVersion] The key version. Default value 'v1'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +Paths.prototype.getEmpty = function (vault, secret, keyName, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + var keyVersion = (options && options.keyVersion !== undefined) ? options.keyVersion : 'v1'; + // Validate + try { + if (vault === null || vault === undefined || typeof vault.valueOf() !== 'string') { + throw new Error('vault cannot be null or undefined and it must be of type string.'); + } + if (secret === null || secret === undefined || typeof secret.valueOf() !== 'string') { + throw new Error('secret cannot be null or undefined and it must be of type string.'); + } + if (this.client.dnsSuffix === null || this.client.dnsSuffix === undefined || typeof this.client.dnsSuffix.valueOf() !== 'string') { + throw new Error('this.client.dnsSuffix cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (keyVersion !== null && keyVersion !== undefined && typeof keyVersion.valueOf() !== 'string') { + throw new Error('keyVersion must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.client.baseUri + + '//customuri/{subscriptionId}/{keyName}'; + requestUrl = requestUrl.replace('{vault}', vault); + requestUrl = requestUrl.replace('{secret}', secret); + requestUrl = requestUrl.replace('{dnsSuffix}', this.client.dnsSuffix); + requestUrl = requestUrl.replace('{keyName}', encodeURIComponent(keyName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + var queryParameters = []; + if (keyVersion !== null && keyVersion !== undefined) { + queryParameters.push('keyVersion=' + encodeURIComponent(keyVersion)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['ErrorModel']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +}; + + +module.exports = Paths; diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/__init__.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/__init__.py new file mode 100644 index 0000000000000..6711cf5b14df9 --- /dev/null +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/__init__.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +from .auto_rest_parameterized_custom_host_test_client import AutoRestParameterizedCustomHostTestClient, AutoRestParameterizedCustomHostTestClientConfiguration +from .version import VERSION + +__all__ = [ + 'AutoRestParameterizedCustomHostTestClient', + 'AutoRestParameterizedCustomHostTestClientConfiguration' +] + +__version__ = VERSION + diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/auto_rest_parameterized_custom_host_test_client.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/auto_rest_parameterized_custom_host_test_client.py new file mode 100644 index 0000000000000..1e9140c3e5f70 --- /dev/null +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/auto_rest_parameterized_custom_host_test_client.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +from msrest.service_client import ServiceClient +from msrest import Configuration, Serializer, Deserializer +from .version import VERSION +from .operations.paths import Paths +from . import models + + +class AutoRestParameterizedCustomHostTestClientConfiguration(Configuration): + """Configuration for AutoRestParameterizedCustomHostTestClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param subscription_id: The subscription id with value 'test12'. + :type subscription_id: str + :param dns_suffix: A string value that is used as a global part of the + parameterized host. Default value 'host'. + :type dns_suffix: str + :param str filepath: Existing config + """ + + def __init__( + self, subscription_id, dns_suffix, filepath=None): + + if subscription_id is None: + raise ValueError('subscription_id must not be None.') + if dns_suffix is None: + raise ValueError('dns_suffix must not be None.') + base_url = '{vault}{secret}{dnsSuffix}' + + super(AutoRestParameterizedCustomHostTestClientConfiguration, self).__init__(base_url, filepath) + + self.add_user_agent('autorestparameterizedcustomhosttestclient/{}'.format(VERSION)) + + self.subscription_id = subscription_id + self.dns_suffix = dns_suffix + + +class AutoRestParameterizedCustomHostTestClient(object): + """Test Infrastructure for AutoRest + + :param config: Configuration for client. + :type config: AutoRestParameterizedCustomHostTestClientConfiguration + + :ivar paths: Paths operations + :vartype paths: .operations.Paths + """ + + def __init__(self, config): + + self._client = ServiceClient(None, config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer() + self._deserialize = Deserializer(client_models) + + self.config = config + self.paths = Paths( + self._client, self.config, self._serialize, self._deserialize) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/credentials.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/credentials.py new file mode 100644 index 0000000000000..0d097b4f2a6cf --- /dev/null +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/credentials.py @@ -0,0 +1,15 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +from msrest.authentication import ( + BasicAuthentication, + BasicTokenAuthentication, + OAuthTokenAuthentication) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/exceptions.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/exceptions.py new file mode 100644 index 0000000000000..c3cc00226060c --- /dev/null +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/exceptions.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +from msrest.exceptions import ( + ClientException, + SerializationError, + DeserializationError, + TokenExpiredError, + ClientRequestError, + AuthenticationError, + HttpOperationError, + ValidationError, +) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/models/__init__.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/models/__init__.py new file mode 100644 index 0000000000000..fd6d517a47113 --- /dev/null +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/models/__init__.py @@ -0,0 +1,16 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +from .error import Error, ErrorException + +__all__ = [ + 'Error', 'ErrorException', +] diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/models/error.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/models/error.py new file mode 100644 index 0000000000000..c2d19e377e004 --- /dev/null +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/models/error.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class Error(Model): + """Error + + :param status: + :type status: int + :param message: + :type message: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'int'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, status=None, message=None): + self.status = status + self.message = message + + +class ErrorException(HttpOperationError): + """Server responsed with exception of type: 'Error'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorException, self).__init__(deserialize, response, 'Error', *args) diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/operations/__init__.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/operations/__init__.py new file mode 100644 index 0000000000000..fa4a82a28df55 --- /dev/null +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/operations/__init__.py @@ -0,0 +1,16 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +from .paths import Paths + +__all__ = [ + 'Paths', +] diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/operations/paths.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/operations/paths.py new file mode 100644 index 0000000000000..2c43f455f742d --- /dev/null +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/operations/paths.py @@ -0,0 +1,87 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class Paths(object): + """Paths operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec model deserializer. + """ + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + def get_empty( + self, vault, secret, key_name, key_version="v1", custom_headers={}, raw=False, **operation_config): + """ + Get a 200 to test a valid base uri + + :param vault: The vault name, e.g. https://myvault + :type vault: str + :param secret: Secret value. + :type secret: str + :param key_name: The key name with value 'key1'. + :type key_name: str + :param key_version: The key version. Default value 'v1'. + :type key_version: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: None + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/customuri/{subscriptionId}/{keyName}' + path_format_arguments = { + 'vault': self._serialize.url("vault", vault, 'str', skip_quote=True), + 'secret': self._serialize.url("secret", secret, 'str', skip_quote=True), + 'dnsSuffix': self._serialize.url("self.config.dns_suffix", self.config.dns_suffix, 'str', skip_quote=True), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if key_version is not None: + query_parameters['keyVersion'] = self._serialize.query("key_version", key_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/version.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/version.py new file mode 100644 index 0000000000000..a39916c162cec --- /dev/null +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/autorestparameterizedcustomhosttestclient/version.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0" + diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/setup.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/setup.py new file mode 100644 index 0000000000000..3521fb6abef92 --- /dev/null +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/setup.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# coding: utf-8 + +from setuptools import setup, find_packages + +NAME = "autorestparameterizedcustomhosttestclient" +VERSION = "1.0.0" + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = ["msrest>=0.2.0"] + +setup( + name=NAME, + version=VERSION, + description="AutoRestParameterizedCustomHostTestClient", + author_email="", + url="", + keywords=["Swagger", "AutoRestParameterizedCustomHostTestClient"], + install_requires=REQUIRES, + packages=find_packages(), + include_package_data=True, + long_description="""\ + Test Infrastructure for AutoRest + """ +) diff --git a/AutoRest/Generators/Python/Python.Tests/Python.Tests.pyproj b/AutoRest/Generators/Python/Python.Tests/Python.Tests.pyproj index 551692fe3e198..b6cfb6ea96c3e 100644 --- a/AutoRest/Generators/Python/Python.Tests/Python.Tests.pyproj +++ b/AutoRest/Generators/Python/Python.Tests/Python.Tests.pyproj @@ -125,6 +125,10 @@ + + + + diff --git a/AutoRest/TestServer/server/app.js b/AutoRest/TestServer/server/app.js index f0da0d60682c8..8bb3b105ba765 100644 --- a/AutoRest/TestServer/server/app.js +++ b/AutoRest/TestServer/server/app.js @@ -428,6 +428,8 @@ var coverage = { "ConstantsInPath": 0, "ConstantsInBody": 0, "CustomBaseUri": 0, + //Once all the languages implement this test, the scenario counter should be reset to zero. It is currently implemented in C# and node.js + "CustomBaseUriMoreOptions": 1, 'getModelFlattenArray': 0, 'putModelFlattenArray': 0, 'getModelFlattenDictionary': 0, diff --git a/AutoRest/TestServer/server/routes/customUri.js b/AutoRest/TestServer/server/routes/customUri.js index 2eee79cadfc33..85d074cdeceb2 100644 --- a/AutoRest/TestServer/server/routes/customUri.js +++ b/AutoRest/TestServer/server/routes/customUri.js @@ -9,6 +9,17 @@ var specials = function (coverage) { coverage['CustomBaseUri']++; res.status(200).end(); }); + + router.get('/:subscriptionId/:keyName', function (req, res, next) { + if (req.params.subscriptionId === 'test12' && req.params.keyName === 'key1' + && Object.keys(req.query).length == 1 && req.query.keyVersion === 'v1') { + coverage['CustomBaseUriMoreOptions']++; + res.status(200).end(); + } else { + utils.send400(res, next, 'Either one of the path parameters (subscriptionId=test12, keyName=key1) or query parameter (keyVersion=v1) did not match. ' + + 'Received parameters are: subscriptionId ' + subscriptionId + ', keyName ' + keyName + ', keyVersion ' + keyVersion); + } + }); } specials.prototype.router = router; diff --git a/AutoRest/TestServer/swagger/custom-baseUrl-more-options.json b/AutoRest/TestServer/swagger/custom-baseUrl-more-options.json new file mode 100644 index 0000000000000..875759e680fd7 --- /dev/null +++ b/AutoRest/TestServer/swagger/custom-baseUrl-more-options.json @@ -0,0 +1,109 @@ +{ + "swagger": "2.0", + "info": { + "title": "AutoRest Parameterized Custom Host Test Client", + "description": "Test Infrastructure for AutoRest", + "version": "1.0.0" + }, + "x-ms-parameterized-host": { + "hostTemplate": "{vault}{secret}{dnsSuffix}", + "useSchemePrefix": false, + "positionInOperation": "first", + "parameters": [ + { + "name": "vault", + "description": "The vault name, e.g. https://myvault", + "required": true, + "type": "string", + "in": "path", + "x-ms-skip-url-encoding": true + }, + { + "name": "secret", + "description": "Secret value.", + "required": true, + "type": "string", + "in": "path", + "x-ms-skip-url-encoding": true + }, + { + "$ref": "#/parameters/dnsSuffix" + } + ] + }, + "produces": [ "application/json" ], + "consumes": [ "application/json" ], + "paths": { + "/customuri/{subscriptionId}/{keyName}": { + "get": { + "operationId": "paths_getEmpty", + "description": "Get a 200 to test a valid base uri", + "tags": [ + "Path Operations" + ], + "parameters": [ + { + "name": "keyName", + "in": "path", + "required": true, + "type": "string", + "description": "The key name with value 'key1'." + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "name": "keyVersion", + "in": "query", + "required": false, + "type": "string", + "default": "v1", + "description": "The key version. Default value 'v1'." + } + ], + "responses": { + "200": { + "description": "Successfully received a 200 response" + }, + "default": { + "description": "Unexpected error", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "The subscription id with value 'test12'." + }, + "dnsSuffix": { + "name": "dnsSuffix", + "description": "A string value that is used as a global part of the parameterized host. Default value 'host'.", + "type": "string", + "required": false, + "default": "host", + "in": "path", + "x-ms-skip-url-encoding": true + } + }, + "definitions": { + "Error": { + "properties": { + "status": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + } + } +} diff --git a/Documentation/swagger-extensions.md b/Documentation/swagger-extensions.md index cb3bed17ab585..dba70ead920b7 100644 --- a/Documentation/swagger-extensions.md +++ b/Documentation/swagger-extensions.md @@ -389,6 +389,8 @@ When used, replaces the standard Swagger "host" attribute with a host that conta Field Name | Type | Description ---|:---:|--- hostTemplate | `string` | **Required**. Specifies the parameterized template for the host. +useSchemePrefix | `boolean` | **Optional, Default: true**. Specifes whether to prepend the default scheme a.k.a protocol to the base uri of client. +positionInOperation | `string` | **Optional, Default: last**. Specifies whether the list of parameters will appear in the beginning or in the end, in the method signature for every operation. The order within the parameters provided in the below mentioned array will be preserved. Either the array of parameters will be prepended or appended, based on the value provided over here. Valid values are **"first", "last"**. parameters | [Array of Parameter Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#parameterObject) | The list of parameters that are used within the hostTemplate. This can include both reference parameters as well as explicit parameters. Note that "in" is **required** and **must be** set to "path" **Example**: diff --git a/gulpfile.js b/gulpfile.js index 942ac3a898b84..e7bc6be0adf4a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -63,7 +63,8 @@ var defaultMappings = { 'AcceptanceTests/Url': '../../../TestServer/swagger/url.json', 'AcceptanceTests/Validation': '../../../TestServer/swagger/validation.json', 'AcceptanceTests/CustomBaseUri': '../../../TestServer/swagger/custom-baseUrl.json', - 'AcceptanceTests/ModelFlattening': '../../../TestServer/swagger/model-flattening.json', + 'AcceptanceTests/CustomBaseUriMoreOptions': '../../../TestServer/swagger/custom-baseUrl-more-options.json', + 'AcceptanceTests/ModelFlattening': '../../../TestServer/swagger/model-flattening.json' }; var rubyMappings = { diff --git a/schema/swagger-extensions.json b/schema/swagger-extensions.json index 199078f32eee3..8b93156a83634 100644 --- a/schema/swagger-extensions.json +++ b/schema/swagger-extensions.json @@ -1540,6 +1540,15 @@ "hostTemplate": { "type": "string" }, + "useSchemePrefix": { + "type": "boolean", + "default": true + }, + "positionInOperation": { + "type": "string", + "default": "end", + "pattern": "^(fir|la)st$" + }, "parameters": { "$ref": "#/definitions/xmsHostParametersList" } From d8110cffea020031b48f5c85c2e61493144c5328 Mon Sep 17 00:00:00 2001 From: Amar Zavery Date: Sat, 9 Apr 2016 12:14:03 -0700 Subject: [PATCH 02/27] positionInOperation defaults to first --- AutoRest/Generators/Extensions/Extensions/Extensions.cs | 2 +- AutoRest/TestServer/swagger/custom-baseUrl-more-options.json | 1 - AutoRest/TestServer/swagger/custom-baseUrl.json | 1 + Documentation/swagger-extensions.md | 4 ++-- schema/swagger-extensions.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/AutoRest/Generators/Extensions/Extensions/Extensions.cs b/AutoRest/Generators/Extensions/Extensions/Extensions.cs index b80820b8c0c58..620a2d594c83e 100644 --- a/AutoRest/Generators/Extensions/Extensions/Extensions.cs +++ b/AutoRest/Generators/Extensions/Extensions/Extensions.cs @@ -77,7 +77,7 @@ public static void ProcessParameterizedHost(ServiceClient serviceClient, Setting useSchemePrefix = bool.Parse(hostExtension[UseSchemePrefix].ToString()); } - var position = "last"; + var position = "first"; if (hostExtension[PositionInOperation] != null) { diff --git a/AutoRest/TestServer/swagger/custom-baseUrl-more-options.json b/AutoRest/TestServer/swagger/custom-baseUrl-more-options.json index 875759e680fd7..75ef7453976ee 100644 --- a/AutoRest/TestServer/swagger/custom-baseUrl-more-options.json +++ b/AutoRest/TestServer/swagger/custom-baseUrl-more-options.json @@ -8,7 +8,6 @@ "x-ms-parameterized-host": { "hostTemplate": "{vault}{secret}{dnsSuffix}", "useSchemePrefix": false, - "positionInOperation": "first", "parameters": [ { "name": "vault", diff --git a/AutoRest/TestServer/swagger/custom-baseUrl.json b/AutoRest/TestServer/swagger/custom-baseUrl.json index 5ca07d1627a06..aaa0309f4b94a 100644 --- a/AutoRest/TestServer/swagger/custom-baseUrl.json +++ b/AutoRest/TestServer/swagger/custom-baseUrl.json @@ -8,6 +8,7 @@ "host": "badhost", "x-ms-parameterized-host": { "hostTemplate": "{accountName}{host}", + "positionInOperation": "last", "parameters": [ { "name": "accountName", diff --git a/Documentation/swagger-extensions.md b/Documentation/swagger-extensions.md index dba70ead920b7..f606ac335567d 100644 --- a/Documentation/swagger-extensions.md +++ b/Documentation/swagger-extensions.md @@ -390,8 +390,8 @@ Field Name | Type | Description ---|:---:|--- hostTemplate | `string` | **Required**. Specifies the parameterized template for the host. useSchemePrefix | `boolean` | **Optional, Default: true**. Specifes whether to prepend the default scheme a.k.a protocol to the base uri of client. -positionInOperation | `string` | **Optional, Default: last**. Specifies whether the list of parameters will appear in the beginning or in the end, in the method signature for every operation. The order within the parameters provided in the below mentioned array will be preserved. Either the array of parameters will be prepended or appended, based on the value provided over here. Valid values are **"first", "last"**. -parameters | [Array of Parameter Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#parameterObject) | The list of parameters that are used within the hostTemplate. This can include both reference parameters as well as explicit parameters. Note that "in" is **required** and **must be** set to "path" +positionInOperation | `string` | **Optional, Default: first**. Specifies whether the list of parameters will appear in the beginning or in the end, in the method signature for every operation. The order within the parameters provided in the below mentioned array will be preserved. Either the array of parameters will be prepended or appended, based on the value provided over here. Valid values are **"first", "last"**. Every method/operation in any programming language has parameters categorized into two buckets **"required"** and **"optional"**. It is natural for optional paramaters to appear in the end in a method signature. **This aspect will be preserved, while prepending(first) or appending(last) hostTemplate parameters .** +parameters | [Array of Parameter Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#parameterObject) | The list of parameters that are used within the hostTemplate. This can include both reference parameters as well as explicit parameters. Note that "in" is **required** and **must be** set to **"path"**. The reference parameters will be treated as **global parameters** and will end up as property of the client. **Example**: Using both explicit and reference parameters diff --git a/schema/swagger-extensions.json b/schema/swagger-extensions.json index 8b93156a83634..6e6476c56dbf0 100644 --- a/schema/swagger-extensions.json +++ b/schema/swagger-extensions.json @@ -1546,7 +1546,7 @@ }, "positionInOperation": { "type": "string", - "default": "end", + "default": "first", "pattern": "^(fir|la)st$" }, "parameters": { From 77502840467ecb898f2a665ed040be9f7885a40b Mon Sep 17 00:00:00 2001 From: Amar Zavery Date: Thu, 28 Apr 2016 12:35:26 -0700 Subject: [PATCH 03/27] fixed setting default value for a complex object containing constant properties. --- .../AcceptanceTests/Lro/operations/index.d.ts | 46 ++ .../AcceptanceTests/Lro/operations/lROSADs.js | 249 ++++++++++ .../BodyInteger/operations/index.d.ts | 58 +++ .../BodyInteger/operations/intModel.js | 463 ++++++++++++++++++ .../operations/index.d.ts | 58 +++ .../operations/intModel.js | 463 ++++++++++++++++++ .../ModelFlattening/models/simpleProduct.js | 1 - .../AcceptanceTests/Url/operations/index.d.ts | 16 + .../AcceptanceTests/Url/operations/paths.js | 102 ++++ .../Validation/models/childProduct.js | 1 - .../Validation/models/constantProduct.js | 1 - .../Validation/models/product.js | 1 - .../NodeJS/NodeJS/ClientModelExtensions.cs | 16 +- 13 files changed, 1464 insertions(+), 11 deletions(-) diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Lro/operations/index.d.ts b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Lro/operations/index.d.ts index ec051455be3e0..01c453943187e 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Lro/operations/index.d.ts +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Lro/operations/index.d.ts @@ -1908,6 +1908,52 @@ export interface LROSADs { beginPutNonRetry201Creating400(options: { product? : models.Product, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; beginPutNonRetry201Creating400(callback: ServiceCallback): void; + /** + * Long running put request, service returns a Product with + * 'ProvisioningState' = 'Creating' and 201 response code + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.product] Product to put + * + * @param {string} [options.product.provisioningState] + * + * @param {object} [options.product.tags] + * + * @param {string} [options.product.location] Resource Location + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + putNonRetry201Creating400InvalidJson(options: { product? : models.Product, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + putNonRetry201Creating400InvalidJson(callback: ServiceCallback): void; + + /** + * Long running put request, service returns a Product with + * 'ProvisioningState' = 'Creating' and 201 response code + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.product] Product to put + * + * @param {string} [options.product.provisioningState] + * + * @param {object} [options.product.tags] + * + * @param {string} [options.product.location] Resource Location + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + beginPutNonRetry201Creating400InvalidJson(options: { product? : models.Product, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginPutNonRetry201Creating400InvalidJson(callback: ServiceCallback): void; + /** * Long running put request, service returns a 200 with * ProvisioningState=’Creating’. Poll the endpoint indicated in the diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Lro/operations/lROSADs.js b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Lro/operations/lROSADs.js index 33fff6078369c..b82dd78f09140 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Lro/operations/lROSADs.js +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Lro/operations/lROSADs.js @@ -525,6 +525,255 @@ LROSADs.prototype.beginPutNonRetry201Creating400 = function (options, callback) }); }; +/** + * + * Long running put request, service returns a Product with + * 'ProvisioningState' = 'Creating' and 201 response code + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.product] Product to put + * + * @param {string} [options.product.provisioningState] + * + * @param {object} [options.product.tags] + * + * @param {string} [options.product.location] Resource Location + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link Product} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +LROSADs.prototype.putNonRetry201Creating400InvalidJson = function (options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginPutNonRetry201Creating400InvalidJson(options, function (err, parsedResult, httpRequest, response){ + if (err) return callback(err); + + var initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + if (err) return callback(err); + + // Create Result + var result = null; + httpRequest = pollingResult.request; + response = pollingResult.response; + var responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['Product']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +}; + +/** + * Long running put request, service returns a Product with + * 'ProvisioningState' = 'Creating' and 201 response code + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.product] Product to put + * + * @param {string} [options.product.provisioningState] + * + * @param {object} [options.product.tags] + * + * @param {string} [options.product.location] Resource Location + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link Product} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +LROSADs.prototype.beginPutNonRetry201Creating400InvalidJson = function (options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + var product = (options && options.product !== undefined) ? options.product : undefined; + // Validate + try { + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.client.baseUri + + '//lro/nonretryerror/put/201/creating/400/invalidjson'; + var queryParameters = []; + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (product !== null && product !== undefined) { + var requestModelMapper = new client.models['Product']().mapper(); + requestModel = client.serialize(requestModelMapper, product, 'product'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(product, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['Product']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['Product']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError1 = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + /** * * Long running put request, service returns a 200 with diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/BodyInteger/operations/index.d.ts b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/BodyInteger/operations/index.d.ts index 26ce14eb339ea..1b00b43d81429 100644 --- a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/BodyInteger/operations/index.d.ts +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/BodyInteger/operations/index.d.ts @@ -167,4 +167,62 @@ export interface IntModel { */ putMin64(intBody: number, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; putMin64(intBody: number, callback: ServiceCallback): void; + + /** + * Get datetime encoded as Unix time value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getUnixTime(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getUnixTime(callback: ServiceCallback): void; + + /** + * Put datetime encoded as Unix time + * + * @param {number} intBody + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + putUnixTimeDate(intBody: number, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + putUnixTimeDate(intBody: number, callback: ServiceCallback): void; + + /** + * Get invalid Unix time value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getInvalidUnixTime(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getInvalidUnixTime(callback: ServiceCallback): void; + + /** + * Get null Unix time value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getNullUnixTime(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getNullUnixTime(callback: ServiceCallback): void; } diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/BodyInteger/operations/intModel.js b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/BodyInteger/operations/intModel.js index 81595128f8a57..b1ed3fbf470cf 100644 --- a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/BodyInteger/operations/intModel.js +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/BodyInteger/operations/intModel.js @@ -1196,5 +1196,468 @@ IntModel.prototype.putMin64 = function (intBody, options, callback) { }); }; +/** + * Get datetime encoded as Unix time value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {number} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +IntModel.prototype.getUnixTime = function (options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Construct URL + var requestUrl = this.client.baseUri + + '//int/unixtime'; + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['ErrorModel']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Number' + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Put datetime encoded as Unix time + * + * @param {number} intBody + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +IntModel.prototype.putUnixTimeDate = function (intBody, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (intBody === null || intBody === undefined || typeof intBody !== 'number') { + throw new Error('intBody cannot be null or undefined and it must be of type number.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.client.baseUri + + '//int/unixtime'; + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (intBody !== null && intBody !== undefined) { + var requestModelMapper = { + required: true, + serializedName: 'intBody', + type: { + name: 'Number' + } + }; + requestModel = client.serialize(requestModelMapper, intBody, 'intBody'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(intBody, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['ErrorModel']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Get invalid Unix time value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {number} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +IntModel.prototype.getInvalidUnixTime = function (options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Construct URL + var requestUrl = this.client.baseUri + + '//int/invalidunixtime'; + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['ErrorModel']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Number' + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Get null Unix time value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {number} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +IntModel.prototype.getNullUnixTime = function (options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Construct URL + var requestUrl = this.client.baseUri + + '//int/nullunixtime'; + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['ErrorModel']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Number' + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + module.exports = IntModel; diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CompositeBoolIntClient/operations/index.d.ts b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CompositeBoolIntClient/operations/index.d.ts index 8238ac41b5170..ac60442293ccf 100644 --- a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CompositeBoolIntClient/operations/index.d.ts +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CompositeBoolIntClient/operations/index.d.ts @@ -264,4 +264,62 @@ export interface IntModel { */ putMin64(intBody: number, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; putMin64(intBody: number, callback: ServiceCallback): void; + + /** + * Get datetime encoded as Unix time value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getUnixTime(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getUnixTime(callback: ServiceCallback): void; + + /** + * Put datetime encoded as Unix time + * + * @param {number} intBody + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + putUnixTimeDate(intBody: number, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + putUnixTimeDate(intBody: number, callback: ServiceCallback): void; + + /** + * Get invalid Unix time value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getInvalidUnixTime(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getInvalidUnixTime(callback: ServiceCallback): void; + + /** + * Get null Unix time value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getNullUnixTime(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getNullUnixTime(callback: ServiceCallback): void; } diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CompositeBoolIntClient/operations/intModel.js b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CompositeBoolIntClient/operations/intModel.js index e7c05cfad0073..42f1d72ab3f7f 100644 --- a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CompositeBoolIntClient/operations/intModel.js +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CompositeBoolIntClient/operations/intModel.js @@ -1196,5 +1196,468 @@ IntModel.prototype.putMin64 = function (intBody, options, callback) { }); }; +/** + * Get datetime encoded as Unix time value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {number} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +IntModel.prototype.getUnixTime = function (options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Construct URL + var requestUrl = this.client.baseUri + + '//int/unixtime'; + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['ErrorModel']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Number' + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Put datetime encoded as Unix time + * + * @param {number} intBody + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +IntModel.prototype.putUnixTimeDate = function (intBody, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (intBody === null || intBody === undefined || typeof intBody !== 'number') { + throw new Error('intBody cannot be null or undefined and it must be of type number.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.client.baseUri + + '//int/unixtime'; + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (intBody !== null && intBody !== undefined) { + var requestModelMapper = { + required: true, + serializedName: 'intBody', + type: { + name: 'Number' + } + }; + requestModel = client.serialize(requestModelMapper, intBody, 'intBody'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(intBody, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['ErrorModel']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Get invalid Unix time value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {number} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +IntModel.prototype.getInvalidUnixTime = function (options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Construct URL + var requestUrl = this.client.baseUri + + '//int/invalidunixtime'; + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['ErrorModel']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Number' + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Get null Unix time value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {number} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +IntModel.prototype.getNullUnixTime = function (options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Construct URL + var requestUrl = this.client.baseUri + + '//int/nullunixtime'; + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['ErrorModel']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Number' + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + module.exports = IntModel; diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/ModelFlattening/models/simpleProduct.js b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/ModelFlattening/models/simpleProduct.js index 3e66a747ff5a0..cca28edbd8eda 100644 --- a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/ModelFlattening/models/simpleProduct.js +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/ModelFlattening/models/simpleProduct.js @@ -42,7 +42,6 @@ SimpleProduct.prototype.mapper = function () { return { required: false, serializedName: 'SimpleProduct', - defaultValue: {}, type: { name: 'Composite', className: 'SimpleProduct', diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Url/operations/index.d.ts b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Url/operations/index.d.ts index 3d9f5f55e7f91..3f5e24643883c 100644 --- a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Url/operations/index.d.ts +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Url/operations/index.d.ts @@ -394,6 +394,22 @@ export interface Paths { */ arrayCsvInPath(arrayPath: string[], options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; arrayCsvInPath(arrayPath: string[], callback: ServiceCallback): void; + + /** + * Get the date 2016-04-13 encoded value as '1460505600' (Unix time) + * + * @param {number} unixTimeUrlPath Unix time encoded value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + unixTimeUrl(unixTimeUrlPath: number, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + unixTimeUrl(unixTimeUrlPath: number, callback: ServiceCallback): void; } /** diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Url/operations/paths.js b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Url/operations/paths.js index ac14e44e195cb..4039b0ce9664a 100644 --- a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Url/operations/paths.js +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Url/operations/paths.js @@ -2458,5 +2458,107 @@ Paths.prototype.arrayCsvInPath = function (arrayPath, options, callback) { }); }; +/** + * Get the date 2016-04-13 encoded value as '1460505600' (Unix time) + * + * @param {number} unixTimeUrlPath Unix time encoded value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +Paths.prototype.unixTimeUrl = function (unixTimeUrlPath, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (unixTimeUrlPath === null || unixTimeUrlPath === undefined || typeof unixTimeUrlPath !== 'number') { + throw new Error('unixTimeUrlPath cannot be null or undefined and it must be of type number.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.client.baseUri + + '//paths/int/1460505600/{unixTimeUrlPath}'; + requestUrl = requestUrl.replace('{unixTimeUrlPath}', encodeURIComponent(unixTimeUrlPath.toString())); + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['ErrorModel']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +}; + module.exports = Paths; diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Validation/models/childProduct.js b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Validation/models/childProduct.js index 212a2c646ec44..14cb8cf926118 100644 --- a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Validation/models/childProduct.js +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Validation/models/childProduct.js @@ -31,7 +31,6 @@ ChildProduct.prototype.mapper = function () { return { required: false, serializedName: 'ChildProduct', - defaultValue: {}, type: { name: 'Composite', className: 'ChildProduct', diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Validation/models/constantProduct.js b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Validation/models/constantProduct.js index e79e409278475..cd97a2c9285e5 100644 --- a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Validation/models/constantProduct.js +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Validation/models/constantProduct.js @@ -29,7 +29,6 @@ ConstantProduct.prototype.mapper = function () { return { required: false, serializedName: 'ConstantProduct', - defaultValue: {}, type: { name: 'Composite', className: 'ConstantProduct', diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Validation/models/product.js b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Validation/models/product.js index 6af3595ad51bb..ee09ede6f6cac 100644 --- a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Validation/models/product.js +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Validation/models/product.js @@ -47,7 +47,6 @@ Product.prototype.mapper = function () { return { required: false, serializedName: 'Product', - defaultValue: {}, type: { name: 'Composite', className: 'Product', diff --git a/AutoRest/Generators/NodeJS/NodeJS/ClientModelExtensions.cs b/AutoRest/Generators/NodeJS/NodeJS/ClientModelExtensions.cs index c842b28b3280b..8f36adeec8742 100644 --- a/AutoRest/Generators/NodeJS/NodeJS/ClientModelExtensions.cs +++ b/AutoRest/Generators/NodeJS/NodeJS/ClientModelExtensions.cs @@ -195,7 +195,8 @@ private static string ValidatePrimaryType(this PrimaryType primary, IScopeProvid primary.Type == KnownPrimaryType.Decimal || primary.Type == KnownPrimaryType.Int || primary.Type == KnownPrimaryType.Long || - primary.Type == KnownPrimaryType.Object) + primary.Type == KnownPrimaryType.Object || + primary.Type == KnownPrimaryType.UnixTime) { if (isRequired) { @@ -302,7 +303,7 @@ private static string PrimaryTSType(this PrimaryType primary) if (primary.Type == KnownPrimaryType.Boolean) return "boolean"; - else if (primary.Type == KnownPrimaryType.Double || primary.Type == KnownPrimaryType.Decimal || primary.Type == KnownPrimaryType.Int || primary.Type == KnownPrimaryType.Long) + else if (primary.Type == KnownPrimaryType.Double || primary.Type == KnownPrimaryType.Decimal || primary.Type == KnownPrimaryType.Int || primary.Type == KnownPrimaryType.Long || primary.Type == KnownPrimaryType.UnixTime) return "number"; else if (primary.Type == KnownPrimaryType.String || primary.Type == KnownPrimaryType.Uuid) return "string"; @@ -666,9 +667,9 @@ public static IndentedStringBuilder AppendConstraintValidations(this IType type, public static string ConstructMapper(this IType type, string serializedName, IParameter parameter, bool isPageable, bool expandComposite) { var builder = new IndentedStringBuilder(" "); - string defaultValue = null; - bool isRequired = false; - bool isConstant = false; + string defaultValue = null; + bool isRequired = false; + bool isConstant = false; bool isReadOnly = false; Dictionary constraints = null; var property = parameter as Property; @@ -684,7 +685,7 @@ public static string ConstructMapper(this IType type, string serializedName, IPa isReadOnly = property.IsReadOnly; } CompositeType composite = type as CompositeType; - if (composite != null && composite.ContainsConstantProperties) + if (composite != null && composite.ContainsConstantProperties && (parameter != null && parameter.IsRequired)) { defaultValue = "{}"; } @@ -746,7 +747,8 @@ public static string ConstructMapper(this IType type, string serializedName, IPa { builder.AppendLine("type: {").Indent().AppendLine("name: 'Boolean'").Outdent().AppendLine("}"); } - else if(primary.Type == KnownPrimaryType.Int || primary.Type == KnownPrimaryType.Long || primary.Type == KnownPrimaryType.Decimal || primary.Type == KnownPrimaryType.Double) + else if(primary.Type == KnownPrimaryType.Int || primary.Type == KnownPrimaryType.Long || primary.Type == KnownPrimaryType.Decimal || + primary.Type == KnownPrimaryType.Double || primary.Type == KnownPrimaryType.UnixTime) { builder.AppendLine("type: {").Indent().AppendLine("name: 'Number'").Outdent().AppendLine("}"); } From 845fc5b0356d30706926fae6624365c2efa955f9 Mon Sep 17 00:00:00 2001 From: Amar Zavery Date: Thu, 28 Apr 2016 12:36:58 -0700 Subject: [PATCH 04/27] result of executing gulp regenerate:expected --- .../java/fixtures/lro/LROSADsOperations.java | 76 +++++++ .../fixtures/lro/LROSADsOperationsImpl.java | 181 +++++++++++++++ .../fixtures/bodyinteger/IntOperations.java | 75 +++++++ .../bodyinteger/IntOperationsImpl.java | 206 ++++++++++++++++++ .../java/fixtures/url/PathsOperations.java | 21 ++ .../fixtures/url/PathsOperationsImpl.java | 59 +++++ .../operations/lrosa_ds_operations.py | 86 ++++++++ .../operations/int_model.py | 175 +++++++++++++++ .../operations/paths.py | 43 ++++ 9 files changed, 922 insertions(+) diff --git a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/lro/LROSADsOperations.java b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/lro/LROSADsOperations.java index 67695190d0b37..7fdc2cc170dd2 100644 --- a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/lro/LROSADsOperations.java +++ b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/lro/LROSADsOperations.java @@ -195,6 +195,82 @@ public interface LROSADsOperations { */ ServiceCall beginPutNonRetry201Creating400Async(Product product, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the Product object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse putNonRetry201Creating400InvalidJson() throws CloudException, IOException, InterruptedException; + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall putNonRetry201Creating400InvalidJsonAsync(final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the Product object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse putNonRetry201Creating400InvalidJson(Product product) throws CloudException, IOException, InterruptedException; + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall putNonRetry201Creating400InvalidJsonAsync(Product product, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @return the Product object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse beginPutNonRetry201Creating400InvalidJson() throws CloudException, IOException; + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall beginPutNonRetry201Creating400InvalidJsonAsync(final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @return the Product object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse beginPutNonRetry201Creating400InvalidJson(Product product) throws CloudException, IOException; + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall beginPutNonRetry201Creating400InvalidJsonAsync(Product product, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. * diff --git a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/lro/LROSADsOperationsImpl.java b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/lro/LROSADsOperationsImpl.java index a00b4293ab132..2f3623d834f8d 100644 --- a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/lro/LROSADsOperationsImpl.java +++ b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/lro/LROSADsOperationsImpl.java @@ -95,6 +95,14 @@ interface LROSADsService { @PUT("lro/nonretryerror/put/201/creating/400") Call beginPutNonRetry201Creating400(@Body Product product, @Header("accept-language") String acceptLanguage); + @Headers("Content-Type: application/json; charset=utf-8") + @PUT("lro/nonretryerror/put/201/creating/400/invalidjson") + Call putNonRetry201Creating400InvalidJson(@Body Product product, @Header("accept-language") String acceptLanguage); + + @Headers("Content-Type: application/json; charset=utf-8") + @PUT("lro/nonretryerror/put/201/creating/400/invalidjson") + Call beginPutNonRetry201Creating400InvalidJson(@Body Product product, @Header("accept-language") String acceptLanguage); + @Headers("Content-Type: application/json; charset=utf-8") @PUT("lro/nonretryerror/putasync/retry/400") Call putAsyncRelativeRetry400(@Body Product product, @Header("accept-language") String acceptLanguage); @@ -627,6 +635,179 @@ private ServiceResponse beginPutNonRetry201Creating400Delegate(Response .build(response); } + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the Product object wrapped in ServiceResponse if successful. + */ + public ServiceResponse putNonRetry201Creating400InvalidJson() throws CloudException, IOException, InterruptedException { + final Product product = null; + Response result = service.putNonRetry201Creating400InvalidJson(product, this.client.getAcceptLanguage()).execute(); + return client.getAzureClient().getPutOrPatchResult(result, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + public ServiceCall putNonRetry201Creating400InvalidJsonAsync(final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + final Product product = null; + Call call = service.putNonRetry201Creating400InvalidJson(product, this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, Throwable t) { + serviceCallback.failure(t); + } + @Override + public void onResponse(Call call, Response response) { + client.getAzureClient().getPutOrPatchResultAsync(response, new TypeToken() { }.getType(), serviceCall, serviceCallback); + } + }); + return serviceCall; + } + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws InterruptedException exception thrown when long running operation is interrupted + * @return the Product object wrapped in ServiceResponse if successful. + */ + public ServiceResponse putNonRetry201Creating400InvalidJson(Product product) throws CloudException, IOException, InterruptedException { + Validator.validate(product); + Response result = service.putNonRetry201Creating400InvalidJson(product, this.client.getAcceptLanguage()).execute(); + return client.getAzureClient().getPutOrPatchResult(result, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + public ServiceCall putNonRetry201Creating400InvalidJsonAsync(Product product, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + Validator.validate(product, serviceCallback); + Call call = service.putNonRetry201Creating400InvalidJson(product, this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, Throwable t) { + serviceCallback.failure(t); + } + @Override + public void onResponse(Call call, Response response) { + client.getAzureClient().getPutOrPatchResultAsync(response, new TypeToken() { }.getType(), serviceCall, serviceCallback); + } + }); + return serviceCall; + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @return the Product object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse beginPutNonRetry201Creating400InvalidJson() throws CloudException, IOException { + final Product product = null; + Call call = service.beginPutNonRetry201Creating400InvalidJson(product, this.client.getAcceptLanguage()); + return beginPutNonRetry201Creating400InvalidJsonDelegate(call.execute()); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall beginPutNonRetry201Creating400InvalidJsonAsync(final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + final Product product = null; + Call call = service.beginPutNonRetry201Creating400InvalidJson(product, this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(beginPutNonRetry201Creating400InvalidJsonDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws CloudException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @return the Product object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse beginPutNonRetry201Creating400InvalidJson(Product product) throws CloudException, IOException { + Validator.validate(product); + Call call = service.beginPutNonRetry201Creating400InvalidJson(product, this.client.getAcceptLanguage()); + return beginPutNonRetry201Creating400InvalidJsonDelegate(call.execute()); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall beginPutNonRetry201Creating400InvalidJsonAsync(Product product, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + Validator.validate(product, serviceCallback); + Call call = service.beginPutNonRetry201Creating400InvalidJson(product, this.client.getAcceptLanguage()); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(beginPutNonRetry201Creating400InvalidJsonDelegate(response)); + } catch (CloudException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse beginPutNonRetry201Creating400InvalidJsonDelegate(Response response) throws CloudException, IOException { + return new AzureServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. * diff --git a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodyinteger/IntOperations.java b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodyinteger/IntOperations.java index 2f705c55d8129..06d2cb2eb7f6c 100644 --- a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodyinteger/IntOperations.java +++ b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodyinteger/IntOperations.java @@ -209,4 +209,79 @@ public interface IntOperations { */ ServiceCall putMin64Async(long intBody, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Get datetime encoded as Unix time value. + * + * @throws ErrorException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @return the long object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getUnixTime() throws ErrorException, IOException; + + /** + * Get datetime encoded as Unix time value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getUnixTimeAsync(final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Put datetime encoded as Unix time. + * + * @param intBody the long value + * @throws ErrorException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse putUnixTimeDate(long intBody) throws ErrorException, IOException, IllegalArgumentException; + + /** + * Put datetime encoded as Unix time. + * + * @param intBody the long value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall putUnixTimeDateAsync(long intBody, final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Get invalid Unix time value. + * + * @throws ErrorException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @return the long object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getInvalidUnixTime() throws ErrorException, IOException; + + /** + * Get invalid Unix time value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getInvalidUnixTimeAsync(final ServiceCallback serviceCallback) throws IllegalArgumentException; + + /** + * Get null Unix time value. + * + * @throws ErrorException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @return the long object wrapped in {@link ServiceResponse} if successful. + */ + ServiceResponse getNullUnixTime() throws ErrorException, IOException; + + /** + * Get null Unix time value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall getNullUnixTimeAsync(final ServiceCallback serviceCallback) throws IllegalArgumentException; + } diff --git a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodyinteger/IntOperationsImpl.java b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodyinteger/IntOperationsImpl.java index 8e9325c0caf42..58cd455e4da17 100644 --- a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodyinteger/IntOperationsImpl.java +++ b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodyinteger/IntOperationsImpl.java @@ -93,6 +93,22 @@ interface IntService { @PUT("int/min/64") Call putMin64(@Body long intBody); + @Headers("Content-Type: application/json; charset=utf-8") + @GET("int/unixtime") + Call getUnixTime(); + + @Headers("Content-Type: application/json; charset=utf-8") + @PUT("int/unixtime") + Call putUnixTimeDate(@Body long intBody); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("int/invalidunixtime") + Call getInvalidUnixTime(); + + @Headers("Content-Type: application/json; charset=utf-8") + @GET("int/nullunixtime") + Call getNullUnixTime(); + } /** @@ -553,4 +569,194 @@ private ServiceResponse putMin64Delegate(Response response) .build(response); } + /** + * Get datetime encoded as Unix time value. + * + * @throws ErrorException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @return the long object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getUnixTime() throws ErrorException, IOException { + Call call = service.getUnixTime(); + return getUnixTimeDelegate(call.execute()); + } + + /** + * Get datetime encoded as Unix time value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getUnixTimeAsync(final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + Call call = service.getUnixTime(); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getUnixTimeDelegate(response)); + } catch (ErrorException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getUnixTimeDelegate(Response response) throws ErrorException, IOException { + return new ServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put datetime encoded as Unix time. + * + * @param intBody the long value + * @throws ErrorException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse putUnixTimeDate(long intBody) throws ErrorException, IOException, IllegalArgumentException { + if (intBody == null) { + throw new IllegalArgumentException("Parameter intBody is required and cannot be null."); + } + Call call = service.putUnixTimeDate(intBody); + return putUnixTimeDateDelegate(call.execute()); + } + + /** + * Put datetime encoded as Unix time. + * + * @param intBody the long value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall putUnixTimeDateAsync(long intBody, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (intBody == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter intBody is required and cannot be null.")); + return null; + } + Call call = service.putUnixTimeDate(intBody); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(putUnixTimeDateDelegate(response)); + } catch (ErrorException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse putUnixTimeDateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return new ServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get invalid Unix time value. + * + * @throws ErrorException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @return the long object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getInvalidUnixTime() throws ErrorException, IOException { + Call call = service.getInvalidUnixTime(); + return getInvalidUnixTimeDelegate(call.execute()); + } + + /** + * Get invalid Unix time value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getInvalidUnixTimeAsync(final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + Call call = service.getInvalidUnixTime(); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getInvalidUnixTimeDelegate(response)); + } catch (ErrorException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getInvalidUnixTimeDelegate(Response response) throws ErrorException, IOException { + return new ServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get null Unix time value. + * + * @throws ErrorException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @return the long object wrapped in {@link ServiceResponse} if successful. + */ + public ServiceResponse getNullUnixTime() throws ErrorException, IOException { + Call call = service.getNullUnixTime(); + return getNullUnixTimeDelegate(call.execute()); + } + + /** + * Get null Unix time value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall getNullUnixTimeAsync(final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + Call call = service.getNullUnixTime(); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(getNullUnixTimeDelegate(response)); + } catch (ErrorException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse getNullUnixTimeDelegate(Response response) throws ErrorException, IOException { + return new ServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + } diff --git a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/url/PathsOperations.java b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/url/PathsOperations.java index f7676a65a59a3..6f820294073ca 100644 --- a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/url/PathsOperations.java +++ b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/url/PathsOperations.java @@ -502,4 +502,25 @@ public interface PathsOperations { */ ServiceCall arrayCsvInPathAsync(List arrayPath, final ServiceCallback serviceCallback) throws IllegalArgumentException; + /** + * Get the date 2016-04-13 encoded value as '1460505600' (Unix time). + * + * @param unixTimeUrlPath Unix time encoded value + * @throws ErrorException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + ServiceResponse unixTimeUrl(long unixTimeUrlPath) throws ErrorException, IOException, IllegalArgumentException; + + /** + * Get the date 2016-04-13 encoded value as '1460505600' (Unix time). + * + * @param unixTimeUrlPath Unix time encoded value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link ServiceCall} object + */ + ServiceCall unixTimeUrlAsync(long unixTimeUrlPath, final ServiceCallback serviceCallback) throws IllegalArgumentException; + } diff --git a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/url/PathsOperationsImpl.java b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/url/PathsOperationsImpl.java index b32c2fcbd2471..60f4ea1452807 100644 --- a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/url/PathsOperationsImpl.java +++ b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/url/PathsOperationsImpl.java @@ -159,6 +159,10 @@ interface PathsService { @GET("paths/array/ArrayPath1%2cbegin%21%2A%27%28%29%3B%3A%40%20%26%3D%2B%24%2C%2F%3F%23%5B%5Dend%2c%2c/{arrayPath:commaSeparated}") Call arrayCsvInPath(@Path("arrayPath") String arrayPath); + @Headers("Content-Type: application/json; charset=utf-8") + @GET("paths/int/1460505600/{unixTimeUrlPath}") + Call unixTimeUrl(@Path("unixTimeUrlPath") long unixTimeUrlPath); + } /** @@ -1418,4 +1422,59 @@ private ServiceResponse arrayCsvInPathDelegate(Response resp .build(response); } + /** + * Get the date 2016-04-13 encoded value as '1460505600' (Unix time). + * + * @param unixTimeUrlPath Unix time encoded value + * @throws ErrorException exception thrown from REST call + * @throws IOException exception thrown from serialization/deserialization + * @throws IllegalArgumentException exception thrown from invalid parameters + * @return the {@link ServiceResponse} object if successful. + */ + public ServiceResponse unixTimeUrl(long unixTimeUrlPath) throws ErrorException, IOException, IllegalArgumentException { + if (unixTimeUrlPath == null) { + throw new IllegalArgumentException("Parameter unixTimeUrlPath is required and cannot be null."); + } + Call call = service.unixTimeUrl(unixTimeUrlPath); + return unixTimeUrlDelegate(call.execute()); + } + + /** + * Get the date 2016-04-13 encoded value as '1460505600' (Unix time). + * + * @param unixTimeUrlPath Unix time encoded value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if callback is null + * @return the {@link Call} object + */ + public ServiceCall unixTimeUrlAsync(long unixTimeUrlPath, final ServiceCallback serviceCallback) throws IllegalArgumentException { + if (serviceCallback == null) { + throw new IllegalArgumentException("ServiceCallback is required for async calls."); + } + if (unixTimeUrlPath == null) { + serviceCallback.failure(new IllegalArgumentException("Parameter unixTimeUrlPath is required and cannot be null.")); + return null; + } + Call call = service.unixTimeUrl(unixTimeUrlPath); + final ServiceCall serviceCall = new ServiceCall(call); + call.enqueue(new ServiceResponseCallback(serviceCallback) { + @Override + public void onResponse(Call call, Response response) { + try { + serviceCallback.success(unixTimeUrlDelegate(response)); + } catch (ErrorException | IOException exception) { + serviceCallback.failure(exception); + } + } + }); + return serviceCall; + } + + private ServiceResponse unixTimeUrlDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return new ServiceResponseBuilder(this.client.getMapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + } diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/operations/lrosa_ds_operations.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/operations/lrosa_ds_operations.py index f4bb777cedec5..a211b6975e70d 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/operations/lrosa_ds_operations.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/autorestlongrunningoperationtestservice/operations/lrosa_ds_operations.py @@ -205,6 +205,92 @@ def get_long_running_output(response): long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) + def put_non_retry201_creating400_invalid_json( + self, product=None, custom_headers={}, raw=False, **operation_config): + """ + Long running put request, service returns a Product with + 'ProvisioningState' = 'Creating' and 201 response code + + :param product: Product to put + :type product: :class:`Product + ` + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :rtype: + :class:`AzureOperationPoller` + instance that returns :class:`Product + ` + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/lro/nonretryerror/put/201/creating/400/invalidjson' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if product is not None: + body_content = self._serialize.body(product, 'Product') + else: + body_content = None + + # Construct and send request + def long_running_send(): + + request = self._client.put(url, query_parameters) + return self._client.send( + request, header_parameters, body_content, **operation_config) + + def get_long_running_status(status_link, headers={}): + + request = self._client.get(status_link) + request.headers.update(headers) + return self._client.send( + request, header_parameters, **operation_config) + + def get_long_running_output(response): + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Product', response) + if response.status_code == 201: + deserialized = self._deserialize('Product', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + if raw: + response = long_running_send() + return get_long_running_output(response) + + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + def put_async_relative_retry400( self, product=None, custom_headers={}, raw=False, **operation_config): """ diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/operations/int_model.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/operations/int_model.py index 45d9ed146e114..a2b06061ed5cb 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/operations/int_model.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyInteger/autorestintegertestservice/operations/int_model.py @@ -466,3 +466,178 @@ def put_min64( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + + def get_unix_time( + self, custom_headers={}, raw=False, **operation_config): + """ + Get datetime encoded as Unix time value + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: long + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/int/unixtime' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('long', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def put_unix_time_date( + self, int_body, custom_headers={}, raw=False, **operation_config): + """ + Put datetime encoded as Unix time + + :param int_body: + :type int_body: long + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: None + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/int/unixtime' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct body + body_content = self._serialize.body(int_body, 'long') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def get_invalid_unix_time( + self, custom_headers={}, raw=False, **operation_config): + """ + Get invalid Unix time value + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: long + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/int/invalidunixtime' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('long', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_null_unix_time( + self, custom_headers={}, raw=False, **operation_config): + """ + Get null Unix time value + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: long + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/int/nullunixtime' + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('long', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/paths.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/paths.py index 97cd8878c0e6a..c419d607826a2 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/paths.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Url/autoresturltestservice/operations/paths.py @@ -1114,3 +1114,46 @@ def array_csv_in_path( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + + def unix_time_url( + self, unix_time_url_path, custom_headers={}, raw=False, **operation_config): + """ + Get the date 2016-04-13 encoded value as '1460505600' (Unix time) + + :param unix_time_url_path: Unix time encoded value + :type unix_time_url_path: long + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: None + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/paths/int/1460505600/{unixTimeUrlPath}' + path_format_arguments = { + 'unixTimeUrlPath': self._serialize.url("unix_time_url_path", unix_time_url_path, 'long') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response From f0dff3dcde4aa85705bc0b12d38d8981bfb17274 Mon Sep 17 00:00:00 2001 From: Amar Zavery Date: Thu, 28 Apr 2016 12:48:43 -0700 Subject: [PATCH 05/27] Fixed fxcop warnings --- AutoRest/Generators/NodeJS/NodeJS/GlobalSuppressions.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/AutoRest/Generators/NodeJS/NodeJS/GlobalSuppressions.cs b/AutoRest/Generators/NodeJS/NodeJS/GlobalSuppressions.cs index dd0050ebae502..a0c9b570f4d8c 100644 --- a/AutoRest/Generators/NodeJS/NodeJS/GlobalSuppressions.cs +++ b/AutoRest/Generators/NodeJS/NodeJS/GlobalSuppressions.cs @@ -191,4 +191,6 @@ [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "Microsoft.Rest.Generator.NodeJS.TemplateModels.ClientModelExtensions.#ConstructMapper(Microsoft.Rest.Generator.ClientModel.IType,System.String,Microsoft.Rest.Generator.ClientModel.IParameter,System.Boolean,System.Boolean)")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "Microsoft.Rest.Generator.NodeJS.NodeJsCodeNamer.#EscapeDefaultValue(System.String,Microsoft.Rest.Generator.ClientModel.IType)")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "readOnly", Scope = "member", Target = "Microsoft.Rest.Generator.NodeJS.TemplateModels.ClientModelExtensions.#ConstructMapper(Microsoft.Rest.Generator.ClientModel.IType,System.String,Microsoft.Rest.Generator.ClientModel.IParameter,System.Boolean,System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "Microsoft.Rest.Generator.NodeJS.TemplateModels.ClientModelExtensions.#ValidatePrimaryType(Microsoft.Rest.Generator.ClientModel.PrimaryType,Microsoft.Rest.Generator.Utilities.IScopeProvider,System.String,System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "Microsoft.Rest.Generator.NodeJS.TemplateModels.ClientModelExtensions.#ConstructMapper(Microsoft.Rest.Generator.ClientModel.IType,System.String,Microsoft.Rest.Generator.ClientModel.IParameter,System.Boolean,System.Boolean)")] From 5a032ae79273334be30794b4aef8a1e1bfd10d58 Mon Sep 17 00:00:00 2001 From: Amar Zavery Date: Thu, 28 Apr 2016 13:38:18 -0700 Subject: [PATCH 06/27] remove null check validation for unixtime as they are treated as long in java --- .../java/fixtures/bodyinteger/IntOperations.java | 3 +-- .../java/fixtures/bodyinteger/IntOperationsImpl.java | 12 ++---------- .../src/main/java/fixtures/url/PathsOperations.java | 3 +-- .../main/java/fixtures/url/PathsOperationsImpl.java | 12 ++---------- .../Java/Java/TemplateModels/MethodTemplateModel.cs | 1 + 5 files changed, 7 insertions(+), 24 deletions(-) diff --git a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodyinteger/IntOperations.java b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodyinteger/IntOperations.java index 06d2cb2eb7f6c..9710c80eabe31 100644 --- a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodyinteger/IntOperations.java +++ b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodyinteger/IntOperations.java @@ -233,10 +233,9 @@ public interface IntOperations { * @param intBody the long value * @throws ErrorException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization - * @throws IllegalArgumentException exception thrown from invalid parameters * @return the {@link ServiceResponse} object if successful. */ - ServiceResponse putUnixTimeDate(long intBody) throws ErrorException, IOException, IllegalArgumentException; + ServiceResponse putUnixTimeDate(long intBody) throws ErrorException, IOException; /** * Put datetime encoded as Unix time. diff --git a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodyinteger/IntOperationsImpl.java b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodyinteger/IntOperationsImpl.java index 58cd455e4da17..134ce02e57ae8 100644 --- a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodyinteger/IntOperationsImpl.java +++ b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodyinteger/IntOperationsImpl.java @@ -620,13 +620,9 @@ private ServiceResponse getUnixTimeDelegate(Response respons * @param intBody the long value * @throws ErrorException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization - * @throws IllegalArgumentException exception thrown from invalid parameters * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse putUnixTimeDate(long intBody) throws ErrorException, IOException, IllegalArgumentException { - if (intBody == null) { - throw new IllegalArgumentException("Parameter intBody is required and cannot be null."); - } + public ServiceResponse putUnixTimeDate(long intBody) throws ErrorException, IOException { Call call = service.putUnixTimeDate(intBody); return putUnixTimeDateDelegate(call.execute()); } @@ -643,10 +639,6 @@ public ServiceCall putUnixTimeDateAsync(long intBody, final ServiceCallback call = service.putUnixTimeDate(intBody); final ServiceCall serviceCall = new ServiceCall(call); call.enqueue(new ServiceResponseCallback(serviceCallback) { @@ -662,7 +654,7 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse putUnixTimeDateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + private ServiceResponse putUnixTimeDateDelegate(Response response) throws ErrorException, IOException { return new ServiceResponseBuilder(this.client.getMapperAdapter()) .register(200, new TypeToken() { }.getType()) .registerError(ErrorException.class) diff --git a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/url/PathsOperations.java b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/url/PathsOperations.java index 6f820294073ca..1ccd08f952b57 100644 --- a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/url/PathsOperations.java +++ b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/url/PathsOperations.java @@ -508,10 +508,9 @@ public interface PathsOperations { * @param unixTimeUrlPath Unix time encoded value * @throws ErrorException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization - * @throws IllegalArgumentException exception thrown from invalid parameters * @return the {@link ServiceResponse} object if successful. */ - ServiceResponse unixTimeUrl(long unixTimeUrlPath) throws ErrorException, IOException, IllegalArgumentException; + ServiceResponse unixTimeUrl(long unixTimeUrlPath) throws ErrorException, IOException; /** * Get the date 2016-04-13 encoded value as '1460505600' (Unix time). diff --git a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/url/PathsOperationsImpl.java b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/url/PathsOperationsImpl.java index 60f4ea1452807..31942e3ce28cb 100644 --- a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/url/PathsOperationsImpl.java +++ b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/url/PathsOperationsImpl.java @@ -1428,13 +1428,9 @@ private ServiceResponse arrayCsvInPathDelegate(Response resp * @param unixTimeUrlPath Unix time encoded value * @throws ErrorException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization - * @throws IllegalArgumentException exception thrown from invalid parameters * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse unixTimeUrl(long unixTimeUrlPath) throws ErrorException, IOException, IllegalArgumentException { - if (unixTimeUrlPath == null) { - throw new IllegalArgumentException("Parameter unixTimeUrlPath is required and cannot be null."); - } + public ServiceResponse unixTimeUrl(long unixTimeUrlPath) throws ErrorException, IOException { Call call = service.unixTimeUrl(unixTimeUrlPath); return unixTimeUrlDelegate(call.execute()); } @@ -1451,10 +1447,6 @@ public ServiceCall unixTimeUrlAsync(long unixTimeUrlPath, final ServiceCallback< if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } - if (unixTimeUrlPath == null) { - serviceCallback.failure(new IllegalArgumentException("Parameter unixTimeUrlPath is required and cannot be null.")); - return null; - } Call call = service.unixTimeUrl(unixTimeUrlPath); final ServiceCall serviceCall = new ServiceCall(call); call.enqueue(new ServiceResponseCallback(serviceCallback) { @@ -1470,7 +1462,7 @@ public void onResponse(Call call, Response response) return serviceCall; } - private ServiceResponse unixTimeUrlDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + private ServiceResponse unixTimeUrlDelegate(Response response) throws ErrorException, IOException { return new ServiceResponseBuilder(this.client.getMapperAdapter()) .register(200, new TypeToken() { }.getType()) .registerError(ErrorException.class) diff --git a/AutoRest/Generators/Java/Java/TemplateModels/MethodTemplateModel.cs b/AutoRest/Generators/Java/Java/TemplateModels/MethodTemplateModel.cs index c9f8bc6faf9fa..7b9afbb821d68 100644 --- a/AutoRest/Generators/Java/Java/TemplateModels/MethodTemplateModel.cs +++ b/AutoRest/Generators/Java/Java/TemplateModels/MethodTemplateModel.cs @@ -363,6 +363,7 @@ public IEnumerable RequiredNullableParameters !param.Type.IsPrimaryType(KnownPrimaryType.Double) && !param.Type.IsPrimaryType(KnownPrimaryType.Boolean) && !param.Type.IsPrimaryType(KnownPrimaryType.Long) && + !param.Type.IsPrimaryType(KnownPrimaryType.UnixTime) && !param.IsConstant && param.IsRequired) { yield return param; From 2f82af17924d40452618af256f909142a26de76f Mon Sep 17 00:00:00 2001 From: Amar Zavery Date: Thu, 28 Apr 2016 22:18:43 -0700 Subject: [PATCH 07/27] unixTime in node.js --- .../AcceptanceTests/acceptanceTests.ts | 30 +++++++++++++++++ .../BodyInteger/operations/index.d.ts | 18 +++++------ .../BodyInteger/operations/intModel.js | 23 ++++++------- .../operations/index.d.ts | 18 +++++------ .../operations/intModel.js | 23 ++++++------- .../AcceptanceTests/Url/operations/index.d.ts | 6 ++-- .../AcceptanceTests/Url/operations/paths.js | 11 ++++--- .../NodeJS/NodeJS/ClientModelExtensions.cs | 26 +++++++++++---- .../NodeJS/NodeJS/NodeJsCodeNamer.cs | 8 ++--- .../NodeJS/ms-rest/lib/serialization.js | 32 +++++++++++++++++-- 10 files changed, 134 insertions(+), 61 deletions(-) diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/AcceptanceTests/acceptanceTests.ts b/AutoRest/Generators/NodeJS/NodeJS.Tests/AcceptanceTests/acceptanceTests.ts index 0a81b3420068b..53e027b7e9a65 100644 --- a/AutoRest/Generators/NodeJS/NodeJS.Tests/AcceptanceTests/acceptanceTests.ts +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/AcceptanceTests/acceptanceTests.ts @@ -199,6 +199,29 @@ describe('nodejs', function () { }); }); }); + + it('should put and get UnixTime date correctly', function (done) { + var d = new Date(2016, 3, 12, 17, 0, 0); + testClient.intModel.putUnixTimeDate(d, function (error, result) { + should.not.exist(error); + testClient.intModel.getUnixTime(function (error, result) { + should.not.exist(error); + assert.deepEqual(result, d); + done(); + }); + }); + }); + + it('should throw an error for invalid UnixTime date anf get null value for UnixTime', function (done) { + testClient.intModel.getInvalidUnixTime(function (error, result) { + should.exist(error); + testClient.intModel.getNullUnixTime(function (error, result) { + should.not.exist(error); + should.not.exist(result); + done(); + }); + }); + }); }); describe('CompositeBoolInt Client', function () { @@ -1891,6 +1914,13 @@ describe('nodejs', function () { }); }); + it('should work when path has a paramaeter in UnixTime format', function (done) { + testClient.paths.unixTimeUrl(new Date(2016, 3, 12, 17, 0, 0), function (error, result) { + should.not.exist(error); + done(); + }); + }); + it('should work when path has datetime', function (done) { testClient.paths.dateTimeValid(new Date('2012-01-01T01:01:01Z'), function (error, result) { should.not.exist(error); diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/BodyInteger/operations/index.d.ts b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/BodyInteger/operations/index.d.ts index 1b00b43d81429..6fddcb9d06757 100644 --- a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/BodyInteger/operations/index.d.ts +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/BodyInteger/operations/index.d.ts @@ -179,13 +179,13 @@ export interface IntModel { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - getUnixTime(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - getUnixTime(callback: ServiceCallback): void; + getUnixTime(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getUnixTime(callback: ServiceCallback): void; /** * Put datetime encoded as Unix time * - * @param {number} intBody + * @param {date} intBody * * @param {object} [options] Optional Parameters. * @@ -195,8 +195,8 @@ export interface IntModel { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - putUnixTimeDate(intBody: number, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - putUnixTimeDate(intBody: number, callback: ServiceCallback): void; + putUnixTimeDate(intBody: Date, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + putUnixTimeDate(intBody: Date, callback: ServiceCallback): void; /** * Get invalid Unix time value @@ -209,8 +209,8 @@ export interface IntModel { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - getInvalidUnixTime(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - getInvalidUnixTime(callback: ServiceCallback): void; + getInvalidUnixTime(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getInvalidUnixTime(callback: ServiceCallback): void; /** * Get null Unix time value @@ -223,6 +223,6 @@ export interface IntModel { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - getNullUnixTime(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - getNullUnixTime(callback: ServiceCallback): void; + getNullUnixTime(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getNullUnixTime(callback: ServiceCallback): void; } diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/BodyInteger/operations/intModel.js b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/BodyInteger/operations/intModel.js index b1ed3fbf470cf..290a93e9b35ef 100644 --- a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/BodyInteger/operations/intModel.js +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/BodyInteger/operations/intModel.js @@ -1210,7 +1210,7 @@ IntModel.prototype.putMin64 = function (intBody, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {number} [result] - The deserialized result object. + * {date} [result] - The deserialized result object. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1293,7 +1293,7 @@ IntModel.prototype.getUnixTime = function (options, callback) { required: false, serializedName: 'parsedResponse', type: { - name: 'Number' + name: 'UnixTime' } }; result = client.deserialize(resultMapper, parsedResponse, 'result'); @@ -1313,7 +1313,7 @@ IntModel.prototype.getUnixTime = function (options, callback) { /** * Put datetime encoded as Unix time * - * @param {number} intBody + * @param {date} intBody * * @param {object} [options] Optional Parameters. * @@ -1343,9 +1343,10 @@ IntModel.prototype.putUnixTimeDate = function (intBody, options, callback) { } // Validate try { - if (intBody === null || intBody === undefined || typeof intBody !== 'number') { - throw new Error('intBody cannot be null or undefined and it must be of type number.'); - } + if(!intBody || !(intBody instanceof Date || + (typeof intBody.valueOf() === 'string' && !isNaN(Date.parse(intBody))))) { + throw new Error('intBody cannot be null or undefined and it must be of type date.'); + } } catch (error) { return callback(error); } @@ -1380,7 +1381,7 @@ IntModel.prototype.putUnixTimeDate = function (intBody, options, callback) { required: true, serializedName: 'intBody', type: { - name: 'Number' + name: 'UnixTime' } }; requestModel = client.serialize(requestModelMapper, intBody, 'intBody'); @@ -1445,7 +1446,7 @@ IntModel.prototype.putUnixTimeDate = function (intBody, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {number} [result] - The deserialized result object. + * {date} [result] - The deserialized result object. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1528,7 +1529,7 @@ IntModel.prototype.getInvalidUnixTime = function (options, callback) { required: false, serializedName: 'parsedResponse', type: { - name: 'Number' + name: 'UnixTime' } }; result = client.deserialize(resultMapper, parsedResponse, 'result'); @@ -1559,7 +1560,7 @@ IntModel.prototype.getInvalidUnixTime = function (options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {number} [result] - The deserialized result object. + * {date} [result] - The deserialized result object. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1642,7 +1643,7 @@ IntModel.prototype.getNullUnixTime = function (options, callback) { required: false, serializedName: 'parsedResponse', type: { - name: 'Number' + name: 'UnixTime' } }; result = client.deserialize(resultMapper, parsedResponse, 'result'); diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CompositeBoolIntClient/operations/index.d.ts b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CompositeBoolIntClient/operations/index.d.ts index ac60442293ccf..507488a58f3f6 100644 --- a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CompositeBoolIntClient/operations/index.d.ts +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CompositeBoolIntClient/operations/index.d.ts @@ -276,13 +276,13 @@ export interface IntModel { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - getUnixTime(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - getUnixTime(callback: ServiceCallback): void; + getUnixTime(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getUnixTime(callback: ServiceCallback): void; /** * Put datetime encoded as Unix time * - * @param {number} intBody + * @param {date} intBody * * @param {object} [options] Optional Parameters. * @@ -292,8 +292,8 @@ export interface IntModel { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - putUnixTimeDate(intBody: number, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - putUnixTimeDate(intBody: number, callback: ServiceCallback): void; + putUnixTimeDate(intBody: Date, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + putUnixTimeDate(intBody: Date, callback: ServiceCallback): void; /** * Get invalid Unix time value @@ -306,8 +306,8 @@ export interface IntModel { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - getInvalidUnixTime(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - getInvalidUnixTime(callback: ServiceCallback): void; + getInvalidUnixTime(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getInvalidUnixTime(callback: ServiceCallback): void; /** * Get null Unix time value @@ -320,6 +320,6 @@ export interface IntModel { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - getNullUnixTime(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - getNullUnixTime(callback: ServiceCallback): void; + getNullUnixTime(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getNullUnixTime(callback: ServiceCallback): void; } diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CompositeBoolIntClient/operations/intModel.js b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CompositeBoolIntClient/operations/intModel.js index 42f1d72ab3f7f..d00f8cb625a0c 100644 --- a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CompositeBoolIntClient/operations/intModel.js +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/CompositeBoolIntClient/operations/intModel.js @@ -1210,7 +1210,7 @@ IntModel.prototype.putMin64 = function (intBody, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {number} [result] - The deserialized result object. + * {date} [result] - The deserialized result object. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1293,7 +1293,7 @@ IntModel.prototype.getUnixTime = function (options, callback) { required: false, serializedName: 'parsedResponse', type: { - name: 'Number' + name: 'UnixTime' } }; result = client.deserialize(resultMapper, parsedResponse, 'result'); @@ -1313,7 +1313,7 @@ IntModel.prototype.getUnixTime = function (options, callback) { /** * Put datetime encoded as Unix time * - * @param {number} intBody + * @param {date} intBody * * @param {object} [options] Optional Parameters. * @@ -1343,9 +1343,10 @@ IntModel.prototype.putUnixTimeDate = function (intBody, options, callback) { } // Validate try { - if (intBody === null || intBody === undefined || typeof intBody !== 'number') { - throw new Error('intBody cannot be null or undefined and it must be of type number.'); - } + if(!intBody || !(intBody instanceof Date || + (typeof intBody.valueOf() === 'string' && !isNaN(Date.parse(intBody))))) { + throw new Error('intBody cannot be null or undefined and it must be of type date.'); + } } catch (error) { return callback(error); } @@ -1380,7 +1381,7 @@ IntModel.prototype.putUnixTimeDate = function (intBody, options, callback) { required: true, serializedName: 'intBody', type: { - name: 'Number' + name: 'UnixTime' } }; requestModel = client.serialize(requestModelMapper, intBody, 'intBody'); @@ -1445,7 +1446,7 @@ IntModel.prototype.putUnixTimeDate = function (intBody, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {number} [result] - The deserialized result object. + * {date} [result] - The deserialized result object. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1528,7 +1529,7 @@ IntModel.prototype.getInvalidUnixTime = function (options, callback) { required: false, serializedName: 'parsedResponse', type: { - name: 'Number' + name: 'UnixTime' } }; result = client.deserialize(resultMapper, parsedResponse, 'result'); @@ -1559,7 +1560,7 @@ IntModel.prototype.getInvalidUnixTime = function (options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {number} [result] - The deserialized result object. + * {date} [result] - The deserialized result object. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1642,7 +1643,7 @@ IntModel.prototype.getNullUnixTime = function (options, callback) { required: false, serializedName: 'parsedResponse', type: { - name: 'Number' + name: 'UnixTime' } }; result = client.deserialize(resultMapper, parsedResponse, 'result'); diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Url/operations/index.d.ts b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Url/operations/index.d.ts index 3f5e24643883c..36fd5ba34f312 100644 --- a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Url/operations/index.d.ts +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Url/operations/index.d.ts @@ -398,7 +398,7 @@ export interface Paths { /** * Get the date 2016-04-13 encoded value as '1460505600' (Unix time) * - * @param {number} unixTimeUrlPath Unix time encoded value + * @param {date} unixTimeUrlPath Unix time encoded value * * @param {object} [options] Optional Parameters. * @@ -408,8 +408,8 @@ export interface Paths { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - unixTimeUrl(unixTimeUrlPath: number, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - unixTimeUrl(unixTimeUrlPath: number, callback: ServiceCallback): void; + unixTimeUrl(unixTimeUrlPath: Date, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + unixTimeUrl(unixTimeUrlPath: Date, callback: ServiceCallback): void; } /** diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Url/operations/paths.js b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Url/operations/paths.js index 4039b0ce9664a..2b5ff16d6bf66 100644 --- a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Url/operations/paths.js +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/Url/operations/paths.js @@ -2461,7 +2461,7 @@ Paths.prototype.arrayCsvInPath = function (arrayPath, options, callback) { /** * Get the date 2016-04-13 encoded value as '1460505600' (Unix time) * - * @param {number} unixTimeUrlPath Unix time encoded value + * @param {date} unixTimeUrlPath Unix time encoded value * * @param {object} [options] Optional Parameters. * @@ -2491,9 +2491,10 @@ Paths.prototype.unixTimeUrl = function (unixTimeUrlPath, options, callback) { } // Validate try { - if (unixTimeUrlPath === null || unixTimeUrlPath === undefined || typeof unixTimeUrlPath !== 'number') { - throw new Error('unixTimeUrlPath cannot be null or undefined and it must be of type number.'); - } + if(!unixTimeUrlPath || !(unixTimeUrlPath instanceof Date || + (typeof unixTimeUrlPath.valueOf() === 'string' && !isNaN(Date.parse(unixTimeUrlPath))))) { + throw new Error('unixTimeUrlPath cannot be null or undefined and it must be of type date.'); + } } catch (error) { return callback(error); } @@ -2501,7 +2502,7 @@ Paths.prototype.unixTimeUrl = function (unixTimeUrlPath, options, callback) { // Construct URL var requestUrl = this.client.baseUri + '//paths/int/1460505600/{unixTimeUrlPath}'; - requestUrl = requestUrl.replace('{unixTimeUrlPath}', encodeURIComponent(unixTimeUrlPath.toString())); + requestUrl = requestUrl.replace('{unixTimeUrlPath}', encodeURIComponent(client.serialize({required: true, serializedName: 'unixTimeUrlPath', type: {name: 'UnixTime'}}, unixTimeUrlPath, 'unixTimeUrlPath'))); // trim all duplicate forward slashes in the url var regex = /([^:]\/)\/+/gi; requestUrl = requestUrl.replace(regex, '$1'); diff --git a/AutoRest/Generators/NodeJS/NodeJS/ClientModelExtensions.cs b/AutoRest/Generators/NodeJS/NodeJS/ClientModelExtensions.cs index 8f36adeec8742..ba3a24c17bf8f 100644 --- a/AutoRest/Generators/NodeJS/NodeJS/ClientModelExtensions.cs +++ b/AutoRest/Generators/NodeJS/NodeJS/ClientModelExtensions.cs @@ -131,6 +131,12 @@ public static string ToString(this IType type, string reference) return string.Format(CultureInfo.InvariantCulture, "client.serialize({{required: true, serializedName: '{0}', type: {{name: 'Base64Url'}}}}, {0}, '{0}')", reference); } + + if (known.Type == KnownPrimaryType.UnixTime) + { + return string.Format(CultureInfo.InvariantCulture, + "client.serialize({{required: true, serializedName: '{0}', type: {{name: 'UnixTime'}}}}, {0}, '{0}')", reference); + } } return string.Format(CultureInfo.InvariantCulture, "{0}.toString()", reference); @@ -195,8 +201,7 @@ private static string ValidatePrimaryType(this PrimaryType primary, IScopeProvid primary.Type == KnownPrimaryType.Decimal || primary.Type == KnownPrimaryType.Int || primary.Type == KnownPrimaryType.Long || - primary.Type == KnownPrimaryType.Object || - primary.Type == KnownPrimaryType.UnixTime) + primary.Type == KnownPrimaryType.Object) { if (isRequired) { @@ -254,7 +259,8 @@ private static string ValidatePrimaryType(this PrimaryType primary, IScopeProvid builder.AppendLine("if ({0} && !Buffer.isBuffer({0})) {{", valueReference, lowercaseTypeName); return ConstructValidationCheck(builder, typeErrorMessage, valueReference, primary.Name).ToString(); } - else if (primary.Type == KnownPrimaryType.DateTime || primary.Type == KnownPrimaryType.Date || primary.Type == KnownPrimaryType.DateTimeRfc1123) + else if (primary.Type == KnownPrimaryType.DateTime || primary.Type == KnownPrimaryType.Date || + primary.Type == KnownPrimaryType.DateTimeRfc1123 || primary.Type == KnownPrimaryType.UnixTime) { if (isRequired) { @@ -303,11 +309,13 @@ private static string PrimaryTSType(this PrimaryType primary) if (primary.Type == KnownPrimaryType.Boolean) return "boolean"; - else if (primary.Type == KnownPrimaryType.Double || primary.Type == KnownPrimaryType.Decimal || primary.Type == KnownPrimaryType.Int || primary.Type == KnownPrimaryType.Long || primary.Type == KnownPrimaryType.UnixTime) + else if (primary.Type == KnownPrimaryType.Double || primary.Type == KnownPrimaryType.Decimal || + primary.Type == KnownPrimaryType.Int || primary.Type == KnownPrimaryType.Long) return "number"; else if (primary.Type == KnownPrimaryType.String || primary.Type == KnownPrimaryType.Uuid) return "string"; - else if (primary.Type == KnownPrimaryType.Date || primary.Type == KnownPrimaryType.DateTime || primary.Type == KnownPrimaryType.DateTimeRfc1123) + else if (primary.Type == KnownPrimaryType.Date || primary.Type == KnownPrimaryType.DateTime || + primary.Type == KnownPrimaryType.DateTimeRfc1123 || primary.Type == KnownPrimaryType.UnixTime) return "Date"; else if (primary.Type == KnownPrimaryType.Object) return "any"; // TODO: test this @@ -747,8 +755,8 @@ public static string ConstructMapper(this IType type, string serializedName, IPa { builder.AppendLine("type: {").Indent().AppendLine("name: 'Boolean'").Outdent().AppendLine("}"); } - else if(primary.Type == KnownPrimaryType.Int || primary.Type == KnownPrimaryType.Long || primary.Type == KnownPrimaryType.Decimal || - primary.Type == KnownPrimaryType.Double || primary.Type == KnownPrimaryType.UnixTime) + else if (primary.Type == KnownPrimaryType.Int || primary.Type == KnownPrimaryType.Long || + primary.Type == KnownPrimaryType.Decimal || primary.Type == KnownPrimaryType.Double) { builder.AppendLine("type: {").Indent().AppendLine("name: 'Number'").Outdent().AppendLine("}"); } @@ -784,6 +792,10 @@ public static string ConstructMapper(this IType type, string serializedName, IPa { builder.AppendLine("type: {").Indent().AppendLine("name: 'TimeSpan'").Outdent().AppendLine("}"); } + else if (primary.Type == KnownPrimaryType.UnixTime) + { + builder.AppendLine("type: {").Indent().AppendLine("name: 'UnixTime'").Outdent().AppendLine("}"); + } else if (primary.Type == KnownPrimaryType.Object) { builder.AppendLine("type: {").Indent().AppendLine("name: 'Object'").Outdent().AppendLine("}"); diff --git a/AutoRest/Generators/NodeJS/NodeJS/NodeJsCodeNamer.cs b/AutoRest/Generators/NodeJS/NodeJS/NodeJsCodeNamer.cs index d2f43a402f589..2dc7c2f0edd6a 100644 --- a/AutoRest/Generators/NodeJS/NodeJS/NodeJsCodeNamer.cs +++ b/AutoRest/Generators/NodeJS/NodeJS/NodeJsCodeNamer.cs @@ -365,6 +365,10 @@ private static IType NormalizePrimaryType(PrimaryType primaryType) { primaryType.Name = "Date"; } + else if (primaryType.Type == KnownPrimaryType.UnixTime) + { + primaryType.Name = "Date"; + } else if (primaryType.Type == KnownPrimaryType.Double) { primaryType.Name = "Number"; @@ -393,10 +397,6 @@ private static IType NormalizePrimaryType(PrimaryType primaryType) { primaryType.Name = "moment.duration"; } - else if (primaryType.Type == KnownPrimaryType.UnixTime) - { - primaryType.Name = "Number"; - } else if (primaryType.Type == KnownPrimaryType.Uuid) { primaryType.Name = "Uuid"; diff --git a/ClientRuntimes/NodeJS/ms-rest/lib/serialization.js b/ClientRuntimes/NodeJS/ms-rest/lib/serialization.js index de8d0778efd92..f802dd43841f4 100644 --- a/ClientRuntimes/NodeJS/ms-rest/lib/serialization.js +++ b/ClientRuntimes/NodeJS/ms-rest/lib/serialization.js @@ -74,7 +74,7 @@ exports.serialize = function (mapper, object, objectName) { payload = serializeBasicTypes.call(this, mapperType, objectName, object); } else if (mapperType.match(/^Enum$/ig) !== null) { payload = serializeEnumType.call(this, objectName, mapper.type.allowedValues, object); - } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123)$/ig) !== null) { + } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/ig) !== null) { payload = serializeDateTypes.call(this, mapperType, object, objectName); } else if (mapperType.match(/^ByteArray$/ig) !== null) { payload = serializeBufferType.call(this, objectName, object); @@ -370,6 +370,13 @@ function serializeDateTypes(typeName, value, objectName) { throw new Error(util.format('%s must be an instanceof Date or a string in RFC-1123 format.', objectName)); } value = (value instanceof Date) ? value.toUTCString() : new Date(value).toUTCString(); + } else if (typeName.match(/^UnixTime$/ig) !== null) { + if (!(value instanceof Date || + (typeof value.valueOf() === 'string' && !isNaN(Date.parse(value))))) { + throw new Error(util.format('%s must be an instanceof Date or a string in RFC-1123/ISO8601 format ' + + 'for it to be serialized in UnixTime/Epoch format.', objectName)); + } + value = dateToUnixTime(value); } else if (typeName.match(/^TimeSpan$/ig) !== null) { if (!moment.isDuration(value)) { throw new Error(util.format('%s must be a TimeSpan/Duration.', objectName)); @@ -402,8 +409,10 @@ exports.deserialize = function (mapper, responseBody, objectName) { payload = responseBody; } else if (mapperType.match(/^(Date|DateTime|DateTimeRfc1123)$/ig) !== null) { payload = new Date(responseBody); - } else if (mapperType.match(/^(TimeSpan)$/ig) !== null) { + } else if (mapperType.match(/^TimeSpan$/ig) !== null) { payload = moment.duration(responseBody); + } else if (mapperType.match(/^UnixTime$/ig) !== null) { + payload = unixTimeToDate(responseBody); } else if (mapperType.match(/^ByteArray$/ig) !== null) { payload = new Buffer(responseBody, 'base64'); } else if (mapperType.match(/^Base64Url$/ig) !== null) { @@ -595,4 +604,23 @@ function base64UrlToBuffer(str) { return new Buffer(str, 'base64'); } +function dateToUnixTime(d) { + if (!d) { + return null; + } + // A Date can be converted to string in JSON-clone operations, so let's tolerate. + if (typeof d.valueOf() === 'string') { + d = new Date(d); + } + var foo = parseInt(d.getTime() / 1000); + return foo; +} + +function unixTimeToDate(n) { + if (!n) { + return null; + } + return new Date(n*1000); +} + exports = module.exports; \ No newline at end of file From 54cfaac98f0c4a3b41f3e7ab856aa6d2cfbce6e4 Mon Sep 17 00:00:00 2001 From: Amar Zavery Date: Thu, 28 Apr 2016 22:23:27 -0700 Subject: [PATCH 08/27] modification --- ClientRuntimes/NodeJS/ms-rest/lib/serialization.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ClientRuntimes/NodeJS/ms-rest/lib/serialization.js b/ClientRuntimes/NodeJS/ms-rest/lib/serialization.js index f802dd43841f4..d71e1ab54a1e4 100644 --- a/ClientRuntimes/NodeJS/ms-rest/lib/serialization.js +++ b/ClientRuntimes/NodeJS/ms-rest/lib/serialization.js @@ -612,8 +612,7 @@ function dateToUnixTime(d) { if (typeof d.valueOf() === 'string') { d = new Date(d); } - var foo = parseInt(d.getTime() / 1000); - return foo; + return parseInt(d.getTime() / 1000); } function unixTimeToDate(n) { From 63fee4f2752daef93d42ce1778d2d886c75e9b66 Mon Sep 17 00:00:00 2001 From: Amar Zavery Date: Fri, 29 Apr 2016 14:00:49 -0700 Subject: [PATCH 09/27] UnixTime tests --- .../NodeJS/NodeJS.Tests/AcceptanceTests/acceptanceTests.ts | 4 ++-- ClientRuntimes/NodeJS/ms-rest/README.md | 3 ++- ClientRuntimes/NodeJS/ms-rest/lib/serialization.js | 1 - ClientRuntimes/NodeJS/ms-rest/test/serializationTests.js | 6 ++++++ 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/AcceptanceTests/acceptanceTests.ts b/AutoRest/Generators/NodeJS/NodeJS.Tests/AcceptanceTests/acceptanceTests.ts index 53e027b7e9a65..db5042f716ed3 100644 --- a/AutoRest/Generators/NodeJS/NodeJS.Tests/AcceptanceTests/acceptanceTests.ts +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/AcceptanceTests/acceptanceTests.ts @@ -201,7 +201,7 @@ describe('nodejs', function () { }); it('should put and get UnixTime date correctly', function (done) { - var d = new Date(2016, 3, 12, 17, 0, 0); + var d = new Date('2016-04-13T00:00:00.000Z'); testClient.intModel.putUnixTimeDate(d, function (error, result) { should.not.exist(error); testClient.intModel.getUnixTime(function (error, result) { @@ -1915,7 +1915,7 @@ describe('nodejs', function () { }); it('should work when path has a paramaeter in UnixTime format', function (done) { - testClient.paths.unixTimeUrl(new Date(2016, 3, 12, 17, 0, 0), function (error, result) { + testClient.paths.unixTimeUrl(new Date('2016-04-13T00:00:00.000Z'), function (error, result) { should.not.exist(error); done(); }); diff --git a/ClientRuntimes/NodeJS/ms-rest/README.md b/ClientRuntimes/NodeJS/ms-rest/README.md index cb4aca73ab405..1da52bff1ac92 100644 --- a/ClientRuntimes/NodeJS/ms-rest/README.md +++ b/ClientRuntimes/NodeJS/ms-rest/README.md @@ -18,7 +18,7 @@ var msrest = require('ms-rest'); ## Serialization/Deserialization Features - Type checking - - (String, Number, Boolean, ByteArray, Date, DateTime, Enum, TimeSpan, DateTimeRfc1123, Object, Stream, Sequence, Dictionary, Composite, Uuid(as a string)) + - (String, Number, Boolean, ByteArray, Base64Url, Date, DateTime, Enum, TimeSpan, DateTimeRfc1123, UnixTime, Object, Stream, Sequence, Dictionary, Composite, Uuid(as a string)) - Validation of specified constraints - ExclusiveMaximum, ExclusiveMinimum, InclusiveMaximum, InclusiveMinimum, MaxItems, MaxLength, MinItems, MinLength, MultipleOf, Pattern, UniqueItems - Flattening/Unflattening properties @@ -26,6 +26,7 @@ Features - 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) +- Serializing Constant values - serialize an array of dictionary of primitive values ```javascript diff --git a/ClientRuntimes/NodeJS/ms-rest/lib/serialization.js b/ClientRuntimes/NodeJS/ms-rest/lib/serialization.js index d71e1ab54a1e4..671292b9f43ba 100644 --- a/ClientRuntimes/NodeJS/ms-rest/lib/serialization.js +++ b/ClientRuntimes/NodeJS/ms-rest/lib/serialization.js @@ -608,7 +608,6 @@ function dateToUnixTime(d) { if (!d) { return null; } - // A Date can be converted to string in JSON-clone operations, so let's tolerate. if (typeof d.valueOf() === 'string') { d = new Date(d); } diff --git a/ClientRuntimes/NodeJS/ms-rest/test/serializationTests.js b/ClientRuntimes/NodeJS/ms-rest/test/serializationTests.js index d9be4bd39fba9..32c89671d37cf 100644 --- a/ClientRuntimes/NodeJS/ms-rest/test/serializationTests.js +++ b/ClientRuntimes/NodeJS/ms-rest/test/serializationTests.js @@ -195,6 +195,12 @@ describe('msrest', function () { serializedDateString.should.equal('+010000-01-01T11:59:59.000Z'); done(); }); + it('should correctly serialize a Date object with max value and format UnixTime', function (done) { + mapper = { type : { name: 'UnixTime' } }; + var serializedDate = msRest.serialize(mapper, new Date('9999-12-31T23:59:59-12:00'), 'dateTimeObj'); + serializedDate.should.equal(253402343999); + done(); + }); it('should correctly serialize a string in DateTimeRfc1123', function (done) { mapper = { type : { name: 'DateTimeRfc1123' } }; var rfc = new Date('Mon, 01 Jan 0001 00:00:00 GMT'); From 5e85f673eb71c37159748fdbac16a92f6435d5fd Mon Sep 17 00:00:00 2001 From: Amar Zavery Date: Fri, 29 Apr 2016 16:35:21 -0700 Subject: [PATCH 10/27] FxCop warnings --- AutoRest/Generators/NodeJS/NodeJS/GlobalSuppressions.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/AutoRest/Generators/NodeJS/NodeJS/GlobalSuppressions.cs b/AutoRest/Generators/NodeJS/NodeJS/GlobalSuppressions.cs index a0c9b570f4d8c..9fecaab118c8e 100644 --- a/AutoRest/Generators/NodeJS/NodeJS/GlobalSuppressions.cs +++ b/AutoRest/Generators/NodeJS/NodeJS/GlobalSuppressions.cs @@ -193,4 +193,5 @@ [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "readOnly", Scope = "member", Target = "Microsoft.Rest.Generator.NodeJS.TemplateModels.ClientModelExtensions.#ConstructMapper(Microsoft.Rest.Generator.ClientModel.IType,System.String,Microsoft.Rest.Generator.ClientModel.IParameter,System.Boolean,System.Boolean)")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "Microsoft.Rest.Generator.NodeJS.TemplateModels.ClientModelExtensions.#ValidatePrimaryType(Microsoft.Rest.Generator.ClientModel.PrimaryType,Microsoft.Rest.Generator.Utilities.IScopeProvider,System.String,System.Boolean)")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Scope = "member", Target = "Microsoft.Rest.Generator.NodeJS.TemplateModels.ClientModelExtensions.#ConstructMapper(Microsoft.Rest.Generator.ClientModel.IType,System.String,Microsoft.Rest.Generator.ClientModel.IParameter,System.Boolean,System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "UnixTime", Scope = "member", Target = "Microsoft.Rest.Generator.NodeJS.TemplateModels.ClientModelExtensions.#ConstructMapper(Microsoft.Rest.Generator.ClientModel.IType,System.String,Microsoft.Rest.Generator.ClientModel.IParameter,System.Boolean,System.Boolean)")] From 55af5bef12e7924ec900e423a337bb54d91da8b8 Mon Sep 17 00:00:00 2001 From: Amar Zavery Date: Mon, 2 May 2016 20:25:35 -0700 Subject: [PATCH 11/27] Redesigned the structure of AzureEnvironment and updated the environments with more values. --- .../ms-rest-azure/lib/azureEnvironment.js | 176 ++++++++++--- .../applicationTokenCredentials.js | 4 +- .../lib/credentials/userTokenCredentials.js | 4 +- .../NodeJS/ms-rest-azure/lib/index.d.ts | 234 ++++++++++++------ .../test/azureEnvironmentTests.js | 91 +++++++ .../NodeJS/ms-rest-azure/test/testlist.txt | 3 +- 6 files changed, 399 insertions(+), 113 deletions(-) create mode 100644 ClientRuntimes/NodeJS/ms-rest-azure/test/azureEnvironmentTests.js diff --git a/ClientRuntimes/NodeJS/ms-rest-azure/lib/azureEnvironment.js b/ClientRuntimes/NodeJS/ms-rest-azure/lib/azureEnvironment.js index 9aa5e6fb2a48d..e902c471c5d30 100644 --- a/ClientRuntimes/NodeJS/ms-rest-azure/lib/azureEnvironment.js +++ b/ClientRuntimes/NodeJS/ms-rest-azure/lib/azureEnvironment.js @@ -2,48 +2,158 @@ // Licensed under the MIT License. See License.txt in the project root for license information. 'use strict'; - -var _ = require('underscore'); - +var util = require('util'); /** * @class * Initializes a new instance of the AzureEnvironment class. * @constructor - * @param {string} authenticationEndpoint - ActiveDirectory Endpoint for the Azure Environment. - * @param {string} tokenAudience - Token audience for an endpoint. - * @param {bool} [validateAuthority] - Determines whether the authentication endpoint should + * @param {string} parameters.name - The Environment name + * @param {string} parameters.portalUrl - the management portal URL + * @param {string} parameters.managementEndpointUrl - the management service endpoint + * @param {string} parameters.resourceManagerEndpointUrl - the resource management endpoint + * @param {string} parameters.activeDirectoryEndpointUrl - the Active Directory login endpoint + * @param {string} parameters.activeDirectoryResourceId - The resource ID to obtain AD tokens for + * @param {string} [parameters.publishingProfileUrl] - the publish settings file URL + * @param {string} [parameters.sqlManagementEndpointUrl] - the sql server management endpoint for mobile commands + * @param {string} [parameters.sqlServerHostnameSuffix] - the dns suffix for sql servers + * @param {string} [parameters.galleryEndpointUrl] - the template gallery endpoint + * @param {string} [parameters.activeDirectoryGraphResourceId] - the Active Directory resource ID + * @param {string} [parameters.activeDirectoryGraphApiVersion] - the Active Directory api version + * @param {string} [parameters.storageEndpointSuffix] - the endpoint suffix for storage accounts + * @param {string} [parameters.keyVaultDnsSuffix] - the keyvault service dns suffix + * @param {string} [parameters.azureDataLakeStoreFileSystemEndpointSuffix] - the data lake store filesystem service dns suffix + * @param {string} [parameters.azureDataLakeAnalyticsCatalogAndJobEndpointSuffix] - the data lake analytics job and catalog service dns suffix + * @param {bool} [parameters.validateAuthority] - Determines whether the authentication endpoint should * be validated with Azure AD. Default value is true. */ -function AzureEnvironment(authenticationEndpoint, tokenAudience, validateAuthority) { - this.authenticationEndpoint = authenticationEndpoint; - this.tokenAudience = tokenAudience; - this.validateAuthority = validateAuthority; -} +function AzureEnvironment(parameters) { + //Set defaults. + this.validateAuthority = true; -/** - * Provides the settings for authentication with Azure - */ -var Azure = new AzureEnvironment('https://login.microsoftonline.com/', - 'https://management.core.windows.net/', - true); + if (parameters) { + //Validate required parameters + var requiredParams = [ 'name', 'portalUrl', 'managementEndpointUrl', 'resourceManagerEndpointUrl', + 'activeDirectoryEndpointUrl', 'activeDirectoryResourceId']; + requiredParams.forEach(function (param) { + if (!parameters[param] || typeof parameters[param].valueOf() !== 'string') { + throw new Error(util.format('Please provide "%s" for the environment and it must be of type "string".', param)); + } + }); + //Assign provided parameters + for (var prop in parameters) { + this[prop] = parameters[prop]; + } + } +} +var supportedEnvironments = { + Azure: { + name: 'Azure', + portalUrl: 'http://go.microsoft.com/fwlink/?LinkId=254433', + publishingProfileUrl: 'http://go.microsoft.com/fwlink/?LinkId=254432', + managementEndpointUrl: 'https://management.core.windows.net', + resourceManagerEndpointUrl: 'https://management.azure.com/', + sqlManagementEndpointUrl: 'https://management.core.windows.net:8443/', + sqlServerHostnameSuffix: '.database.windows.net', + galleryEndpointUrl: 'https://gallery.azure.com/', + activeDirectoryEndpointUrl: 'https://login.microsoftonline.com', + activeDirectoryResourceId: 'https://management.core.windows.net/', + activeDirectoryGraphResourceId: 'https://graph.windows.net/', + activeDirectoryGraphApiVersion: '2013-04-05', + storageEndpointSuffix: '.core.windows.net', + keyVaultDnsSuffix: '.vault.azure.net', + azureDataLakeStoreFileSystemEndpointSuffix: 'azuredatalakestore.net', + azureDataLakeAnalyticsCatalogAndJobEndpointSuffix: 'azuredatalakeanalytics.net' + }, + AzureChina: { + name: 'AzureChina', + portalUrl: 'http://go.microsoft.com/fwlink/?LinkId=301902', + publishingProfileUrl: 'http://go.microsoft.com/fwlink/?LinkID=301774', + managementEndpointUrl: 'https://management.core.chinacloudapi.cn', + resourceManagerEndpointUrl: 'https://management.chinacloudapi.cn', + sqlManagementEndpointUrl: 'https://management.core.chinacloudapi.cn:8443/', + sqlServerHostnameSuffix: '.database.chinacloudapi.cn', + galleryEndpointUrl: 'https://gallery.chinacloudapi.cn/', + activeDirectoryEndpointUrl: 'https://login.chinacloudapi.cn', + activeDirectoryResourceId: 'https://management.core.chinacloudapi.cn/', + activeDirectoryGraphResourceId: 'https://graph.chinacloudapi.cn/', + activeDirectoryGraphApiVersion: '2013-04-05', + storageEndpointSuffix: '.core.chinacloudapi.cn', + keyVaultDnsSuffix: '.vault.azure.cn', + // TODO: add dns suffixes for the china cloud for datalake store and datalake analytics once they are defined. + azureDataLakeStoreFileSystemEndpointSuffix: 'N/A', + azureDataLakeAnalyticsCatalogAndJobEndpointSuffix: 'N/A' + }, + AzureUSGovernment: { + name: 'AzureUSGovernment', + portalUrl: 'https://manage.windowsazure.us', + publishingProfileUrl: 'https://manage.windowsazure.us/publishsettings/index', + managementEndpointUrl: 'https://management.core.usgovcloudapi.net', + resourceManagerEndpointUrl: 'https://management.usgovcloudapi.net', + sqlManagementEndpointUrl: 'https://management.core.usgovcloudapi.net:8443/', + sqlServerHostnameSuffix: '.database.usgovcloudapi.net', + galleryEndpointUrl: 'https://gallery.usgovcloudapi.net/', + activeDirectoryEndpointUrl: 'https://login.microsoftonline.com', + activeDirectoryResourceId: 'https://management.core.usgovcloudapi.net/', + activeDirectoryGraphResourceId: 'https://graph.windows.net/', + activeDirectoryGraphApiVersion: '2013-04-05', + storageEndpointSuffix: '.core.usgovcloudapi.net', + keyVaultDnsSuffix: '.vault.usgovcloudapi.net', + // TODO: add dns suffixes for the US government for datalake store and datalake analytics once they are defined. + azureDataLakeStoreFileSystemEndpointSuffix: 'N/A', + azureDataLakeAnalyticsCatalogAndJobEndpointSuffix: 'N/A' + }, + AzureGermanCloud: { + name: 'AzureGermanCloud', + portalUrl: 'http://portal.microsoftazure.de/', + publishingProfileUrl: 'https://manage.microsoftazure.de/publishsettings/index', + managementEndpointUrl: 'https://management.core.cloudapi.de', + resourceManagerEndpointUrl: 'https://management.microsoftazure.de', + sqlManagementEndpointUrl: 'https://management.core.cloudapi.de:8443/', + sqlServerHostnameSuffix: '.database.cloudapi.de', + galleryEndpointUrl: 'https://gallery.cloudapi.de/', + activeDirectoryEndpointUrl: 'https://login.microsoftonline.de', + activeDirectoryResourceId: 'https://management.core.cloudapi.de/', + activeDirectoryGraphResourceId: 'https://graph.cloudapi.de/', + activeDirectoryGraphApiVersion: '2013-04-05', + storageEndpointSuffix: '.core.cloudapi.de', + keyVaultDnsSuffix: '.vault.microsoftazure.de', + // TODO: add dns suffixes for the US government for datalake store and datalake analytics once they are defined. + azureDataLakeStoreFileSystemEndpointSuffix: 'N/A', + azureDataLakeAnalyticsCatalogAndJobEndpointSuffix: 'N/A' + } +}; /** - * Provides the settings for authentication with Azure China + * Adds a new instance of the AzureEnvironment to the prototype. + * @param {string} parameters.name - The Environment name + * @param {string} parameters.portalUrl - the management portal URL + * @param {string} parameters.managementEndpointUrl - the management service endpoint + * @param {string} parameters.resourceManagerEndpointUrl - the resource management endpoint + * @param {string} parameters.activeDirectoryEndpointUrl - the Active Directory login endpoint + * @param {string} parameters.activeDirectoryResourceId - The resource ID to obtain AD tokens for + * @param {string} [parameters.publishingProfileUrl] - the publish settings file URL + * @param {string} [parameters.sqlManagementEndpointUrl] - the sql server management endpoint for mobile commands + * @param {string} [parameters.sqlServerHostnameSuffix] - the dns suffix for sql servers + * @param {string} [parameters.galleryEndpointUrl] - the template gallery endpoint + * @param {string} [parameters.activeDirectoryGraphResourceId] - the Active Directory resource ID + * @param {string} [parameters.activeDirectoryGraphApiVersion] - the Active Directory api version + * @param {string} [parameters.storageEndpointSuffix] - the endpoint suffix for storage accounts + * @param {string} [parameters.keyVaultDnsSuffix] - the keyvault service dns suffix + * @param {string} [parameters.azureDataLakeStoreFileSystemEndpointSuffix] - the data lake store filesystem service dns suffix + * @param {string} [parameters.azureDataLakeAnalyticsCatalogAndJobEndpointSuffix] - the data lake analytics job and catalog service dns suffix + * @param {bool} [parameters.validateAuthority] - Determines whether the authentication endpoint should + * be validated with Azure AD. Default value is true. + * @return {AzureEnvironment} - Reference to the newly added Environment */ -var AzureChina = new AzureEnvironment('https://login.chinacloudapi.cn/', - 'https://management.core.chinacloudapi.cn/', - true); +AzureEnvironment.prototype.add = function(parameters) { + var _environment = new AzureEnvironment(parameters); + AzureEnvironment.prototype[_environment.name] = _environment; + return _environment; +}; -/** - * Provides the settings for authentication with Azure US Government - */ -var AzureUSGovernment = new AzureEnvironment('https://login.microsoftonline.com/', - 'https://management.core.usgovcloudapi.net/', - true); +//Adding the supported environments +for(var key in supportedEnvironments) { + AzureEnvironment.prototype.add(supportedEnvironments[key]); +} -_.extend(module.exports, { - Azure: Azure, - AzureChina: AzureChina, - AzureEnvironment: AzureEnvironment, - AzureUSGovernment: AzureUSGovernment -}); +module.exports = new AzureEnvironment(); \ No newline at end of file diff --git a/ClientRuntimes/NodeJS/ms-rest-azure/lib/credentials/applicationTokenCredentials.js b/ClientRuntimes/NodeJS/ms-rest-azure/lib/credentials/applicationTokenCredentials.js index 0c4fe85033edf..e096edbff2049 100644 --- a/ClientRuntimes/NodeJS/ms-rest-azure/lib/credentials/applicationTokenCredentials.js +++ b/ClientRuntimes/NodeJS/ms-rest-azure/lib/credentials/applicationTokenCredentials.js @@ -65,10 +65,10 @@ function ApplicationTokenCredentials(clientId, domain, secret, options) { */ ApplicationTokenCredentials.prototype.signRequest = function (webResource, callback) { var self = this; - var authorityUrl = self.environment.authenticationEndpoint + self.domain; + var authorityUrl = self.environment.activeDirectoryEndpointUrl + self.domain; var context = new adal.AuthenticationContext(authorityUrl, self.environment.validateAuthority, self.tokenCache); - context.acquireTokenWithClientCredentials(self.environment.tokenAudience, self.clientId, self.secret, function (err, result) { + context.acquireTokenWithClientCredentials(self.environment.activeDirectoryResourceId, self.clientId, self.secret, function (err, result) { if (err) { return callback(new Error('Failed to acquire token for application. \n' + err)); } diff --git a/ClientRuntimes/NodeJS/ms-rest-azure/lib/credentials/userTokenCredentials.js b/ClientRuntimes/NodeJS/ms-rest-azure/lib/credentials/userTokenCredentials.js index ea25138765cd9..7b4f02cf720bf 100644 --- a/ClientRuntimes/NodeJS/ms-rest-azure/lib/credentials/userTokenCredentials.js +++ b/ClientRuntimes/NodeJS/ms-rest-azure/lib/credentials/userTokenCredentials.js @@ -78,10 +78,10 @@ function UserTokenCredentials(clientId, domain, username, password, clientRedire */ UserTokenCredentials.prototype.signRequest = function (webResource, callback) { var self = this; - var authorityUrl = self.environment.authenticationEndpoint + self.domain; + var authorityUrl = self.environment.activeDirectoryEndpointUrl + self.domain; var context = new adal.AuthenticationContext(authorityUrl, self.environment.validateAuthority, self.tokenCache); - context.acquireTokenWithUsernamePassword(self.environment.tokenAudience, self.username, self.password, self.clientId, function (err, result) { + context.acquireTokenWithUsernamePassword(self.environment.activeDirectoryResourceId, self.username, self.password, self.clientId, function (err, result) { if (err) { return callback(new Error('Failed to acquire token. \n' + err)); } diff --git a/ClientRuntimes/NodeJS/ms-rest-azure/lib/index.d.ts b/ClientRuntimes/NodeJS/ms-rest-azure/lib/index.d.ts index 818d584985ec7..ef4378cff4e40 100644 --- a/ClientRuntimes/NodeJS/ms-rest-azure/lib/index.d.ts +++ b/ClientRuntimes/NodeJS/ms-rest-azure/lib/index.d.ts @@ -1,22 +1,22 @@ import * as msRest from 'ms-rest'; export interface AzureServiceClientOptions extends msRest.ServiceClientOptions { - // TODO: Make this property have right type - // * @param {Array} [options.longRunningOperationRetryTimeout] - Retry timeout - longRunningOperationRetryTimeout?: any; + // TODO: Make this property have right type + // * @param {Array} [options.longRunningOperationRetryTimeout] - Retry timeout + longRunningOperationRetryTimeout?: any; } export class AzureServiceClient extends msRest.ServiceClient { - /** - * @class - * Initializes a new instance of the AzureServiceClient class. - * @constructor - * @param {ServiceClientCredentials} credentials - ApplicationTokenCredentials or - * UserTokenCredentials object used for authentication. - * - * @param {object} options - The parameter options used by ServiceClient - * - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + /** + * @class + * Initializes a new instance of the AzureServiceClient class. + * @constructor + * @param {ServiceClientCredentials} credentials - ApplicationTokenCredentials or + * UserTokenCredentials object used for authentication. + * + * @param {object} options - The parameter options used by ServiceClient + * + * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. * Default value is: 'en-US'. * * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value @@ -24,81 +24,165 @@ export class AzureServiceClient extends msRest.ServiceClient { * * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for * Long Running Operations. Default value is 30. - */ - constructor(credentials: msRest.ServiceClientCredentials, options: AzureServiceClientOptions) + */ + constructor(credentials: msRest.ServiceClientCredentials, options: AzureServiceClientOptions) } export class AzureEnvironment { - /** - * Initializes a new instance of the AzureEnvironment class. - * @param {string} authenticationEndpoint - ActiveDirectory Endpoint for the Azure Environment. - * @param {string} tokenAudience - Token audience for an endpoint. - * @param {bool} [validateAuthority] - Determines whether the authentication endpoint should - * be validated with Azure AD. Default value is true. - */ - constructor(authenticationEndpoint: string, tokenAudience: string, validateAuthority: boolean); - - /** - * ActiveDirectory Endpoint for the Azure Environment - */ - authenticationEndpoint: string; - - /** - * Token audience for an endpoint. - */ - tokenAudience: string; - - /** - * Determines whether the authentication endpoint should be validated with Azure AD. Default value is true. - */ - validateAuthority: boolean; + /** + * Initializes a new instance of the AzureEnvironment class. + * @param {string} parameters.name - The Environment name + * @param {string} parameters.portalUrl - The management portal URL + * @param {string} parameters.managementEndpointUrl - The management service endpoint + * @param {string} parameters.resourceManagerEndpointUrl - The resource management endpoint + * @param {string} parameters.activeDirectoryEndpointUrl - The Active Directory login endpoint + * @param {string} parameters.activeDirectoryResourceId - The resource ID to obtain AD tokens for (token audience) + * @param {string} [parameters.publishingProfileUrl] - The publish settings file URL + * @param {string} [parameters.sqlManagementEndpointUrl] - The sql server management endpoint for mobile commands + * @param {string} [parameters.sqlServerHostnameSuffix] - The dns suffix for sql servers + * @param {string} [parameters.galleryEndpointUrl] - The template gallery endpoint + * @param {string} [parameters.activeDirectoryGraphResourceId] - The Active Directory resource ID + * @param {string} [parameters.activeDirectoryGraphApiVersion] - The Active Directory api version + * @param {string} [parameters.storageEndpointSuffix] - The endpoint suffix for storage accounts + * @param {string} [parameters.keyVaultDnsSuffix] - The keyvault service dns suffix + * @param {string} [parameters.azureDataLakeStoreFileSystemEndpointSuffix] - The data lake store filesystem service dns suffix + * @param {string} [parameters.azureDataLakeAnalyticsCatalogAndJobEndpointSuffix] - The data lake analytics job and catalog service dns suffix + * @param {bool} [parameters.validateAuthority] - Determines whether the authentication endpoint should + * be validated with Azure AD. Default value is true. + */ + constructor(parameters: any); + + /** + * The Environment name. + */ + name: string; + + /** + * The management portal URL. + */ + portalUrl: string; + + /** + * The management service endpoint. + */ + managementEndpointUrl: string; + + /** + * The resource management endpoint. + */ + resourceManagerEndpointUrl: string; + + /** + * The Active Directory login endpoint. + */ + activeDirectoryEndpointUrl: string; + + /** + * The resource ID to obtain AD tokens for (token audience). + */ + activeDirectoryResourceId: string; + + /** + * The publish settings file URL. + */ + publishingProfileUrl: string; + + /** + * The sql server management endpoint for mobile commands. + */ + sqlManagementEndpointUrl: string; + + /** + * The dns suffix for sql servers. + */ + sqlServerHostnameSuffix: string; + + /** + * The template gallery endpoint. + */ + galleryEndpointUrl: string; + + /** + * The Active Directory resource ID. + */ + activeDirectoryGraphResourceId: string; + + /** + * The Active Directory api version. + */ + activeDirectoryGraphApiVersion: string; + + /** + * The endpoint suffix for storage accounts. + */ + storageEndpointSuffix: string; + + /** + * The keyvault service dns suffix. + */ + keyVaultDnsSuffix: string; + + /** + * The data lake store filesystem service dns suffix. + */ + azureDataLakeStoreFileSystemEndpointSuffix: string; + + /** + * The data lake analytics job and catalog service dns suffix. + */ + azureDataLakeAnalyticsCatalogAndJobEndpointSuffix: string; + + /** + * Determines whether the authentication endpoint should be validated with Azure AD. Default value is true. + */ + validateAuthority: boolean; } export interface AzureTokenCredentialsOptions { - /** - * The Azure environment to authenticate with. - */ - environment?: AzureEnvironment; - - /** - * The authorization scheme. Default value is 'Bearer'. - */ - authorizationScheme?: string; - - // TODO: What type should this really have? How is it used? - /** - * The token cache. Default value is null. - */ - tokenCache?: any; + /** + * The Azure environment to authenticate with. + */ + environment?: AzureEnvironment; + + /** + * The authorization scheme. Default value is 'Bearer'. + */ + authorizationScheme?: string; + + // TODO: What type should this really have? How is it used? + /** + * The token cache. Default value is null. + */ + tokenCache?: any; } export class ApplicationTokenCredentials extends msRest.ServiceClientCredentials { - /** - * Creates a new ApplicationTokenCredentials object. - * See {@link https://azure.microsoft.com/en-us/documentation/articles/active-directory-devquickstarts-dotnet/ Active Directory Quickstart for .Net} - * for detailed instructions on creating an Azure Active Directory application. - * @param {string} clientId The active directory application client id. - * @param {string} domain The domain or tenant id containing this application. - * @param {string} secret The authentication secret for the application. - * @param {AzureTokenCredentialsOptions} options Object representing optional parameters. - */ - constructor(clientId: string, domain: string, secret: string, options?: AzureTokenCredentialsOptions); + /** + * Creates a new ApplicationTokenCredentials object. + * See {@link https://azure.microsoft.com/en-us/documentation/articles/active-directory-devquickstarts-dotnet/ Active Directory Quickstart for .Net} + * for detailed instructions on creating an Azure Active Directory application. + * @param {string} clientId The active directory application client id. + * @param {string} domain The domain or tenant id containing this application. + * @param {string} secret The authentication secret for the application. + * @param {AzureTokenCredentialsOptions} options Object representing optional parameters. + */ + constructor(clientId: string, domain: string, secret: string, options?: AzureTokenCredentialsOptions); } export class UserTokenCredentials extends msRest.ServiceClientCredentials { - /** - * Creates a new UserTokenCredentials object. - * See {@link https://azure.microsoft.com/en-us/documentation/articles/active-directory-devquickstarts-dotnet/ Active Directory Quickstart for .Net} - * for an example. - * @param {string} clientId The active directory application client id. - * @param {string} domain The domain or tenant id containing this application. - * @param {string} username The user name for the Organization Id account. - * @param {string} password The password for the Organization Id account. - * @param {string} clientRedirectUri The Uri where the user will be redirected after authenticating with AD. - * @param {AzureTokenCredentialsOptions} options Object representing optional parameters. - */ - constructor(clientId: string, domain: string, username: string, password: string, clientRedirectUri: string, options?: AzureTokenCredentialsOptions); + /** + * Creates a new UserTokenCredentials object. + * See {@link https://azure.microsoft.com/en-us/documentation/articles/active-directory-devquickstarts-dotnet/ Active Directory Quickstart for .Net} + * for an example. + * @param {string} clientId The active directory application client id. + * @param {string} domain The domain or tenant id containing this application. + * @param {string} username The user name for the Organization Id account. + * @param {string} password The password for the Organization Id account. + * @param {string} clientRedirectUri The Uri where the user will be redirected after authenticating with AD. + * @param {AzureTokenCredentialsOptions} options Object representing optional parameters. + */ + constructor(clientId: string, domain: string, username: string, password: string, clientRedirectUri: string, options?: AzureTokenCredentialsOptions); } // TODO: WHAT SHOULD WE EXPOSE HERE? diff --git a/ClientRuntimes/NodeJS/ms-rest-azure/test/azureEnvironmentTests.js b/ClientRuntimes/NodeJS/ms-rest-azure/test/azureEnvironmentTests.js new file mode 100644 index 0000000000000..01b6fbfd81708 --- /dev/null +++ b/ClientRuntimes/NodeJS/ms-rest-azure/test/azureEnvironmentTests.js @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +var should = require('should'); +var msRestAzure = require('../lib/msRestAzure'); + +describe('AzureEnvironment', function() { + it('can be properly required', function(done) { + var tempEnv = msRestAzure.AzureEnvironment; + tempEnv.validateAuthority.should.equal(true); + done(); + }); + + it('should show the details of Azure Production environment correctly', function(done) { + var tempEnv = msRestAzure.AzureEnvironment.Azure; + tempEnv.name.should.equal('Azure'); + tempEnv.activeDirectoryEndpointUrl.should.equal('https://login.microsoftonline.com'); + tempEnv.activeDirectoryResourceId.should.equal('https://management.core.windows.net/'); + tempEnv.managementEndpointUrl.should.equal('https://management.core.windows.net'); + tempEnv.resourceManagerEndpointUrl.should.equal('https://management.azure.com/'); + tempEnv.portalUrl.should.equal('http://go.microsoft.com/fwlink/?LinkId=254433'); + tempEnv.validateAuthority.should.equal(true); + done(); + }); + + it('should show the details of Azure China environment correctly', function(done) { + var tempEnv = msRestAzure.AzureEnvironment.AzureChina; + tempEnv.name.should.equal('AzureChina'); + tempEnv.activeDirectoryEndpointUrl.should.equal('https://login.chinacloudapi.cn'); + tempEnv.activeDirectoryResourceId.should.equal('https://management.core.chinacloudapi.cn/'); + tempEnv.managementEndpointUrl.should.equal('https://management.core.chinacloudapi.cn'); + tempEnv.resourceManagerEndpointUrl.should.equal('https://management.chinacloudapi.cn'); + tempEnv.portalUrl.should.equal('http://go.microsoft.com/fwlink/?LinkId=301902'); + tempEnv.validateAuthority.should.equal(true); + done(); + }); + + it('should show the details of Azure USGovernment environment correctly', function(done) { + var tempEnv = msRestAzure.AzureEnvironment.AzureUSGovernment; + tempEnv.name.should.equal('AzureUSGovernment'); + tempEnv.activeDirectoryEndpointUrl.should.equal('https://login.microsoftonline.com'); + tempEnv.activeDirectoryResourceId.should.equal('https://management.core.usgovcloudapi.net/'); + tempEnv.managementEndpointUrl.should.equal('https://management.core.usgovcloudapi.net'); + tempEnv.resourceManagerEndpointUrl.should.equal('https://management.usgovcloudapi.net'); + tempEnv.portalUrl.should.equal('https://manage.windowsazure.us'); + tempEnv.validateAuthority.should.equal(true); + done(); + }); + + it('should show the details of Azure GermanCloud environment correctly', function(done) { + var tempEnv = msRestAzure.AzureEnvironment.AzureGermanCloud; + tempEnv.name.should.equal('AzureGermanCloud'); + tempEnv.activeDirectoryEndpointUrl.should.equal('https://login.microsoftonline.de'); + tempEnv.activeDirectoryResourceId.should.equal('https://management.core.cloudapi.de/'); + tempEnv.managementEndpointUrl.should.equal('https://management.core.cloudapi.de'); + tempEnv.resourceManagerEndpointUrl.should.equal('https://management.microsoftazure.de'); + tempEnv.portalUrl.should.equal('http://portal.microsoftazure.de/'); + tempEnv.validateAuthority.should.equal(true); + done(); + }); + + it('should be able to add a new environment', function(done) { + var df = { + name: 'Dogfood', + portalUrl: 'http://go.microsoft.com/fwlink/?LinkId=254433', + managementEndpointUrl: 'https://management.core.windows.net', + resourceManagerEndpointUrl: 'https://management.azure.com/', + activeDirectoryEndpointUrl: 'https://login.microsoftonline.com', + activeDirectoryResourceId: 'https://management.core.windows.net/' + }; + var tempEnv = msRestAzure.AzureEnvironment; + var dfood = tempEnv.add(df); + dfood.name.should.equal('Dogfood'); + dfood.activeDirectoryEndpointUrl.should.equal('https://login.microsoftonline.com'); + dfood.activeDirectoryResourceId.should.equal('https://management.core.windows.net/'); + dfood.managementEndpointUrl.should.equal('https://management.core.windows.net'); + dfood.resourceManagerEndpointUrl.should.equal('https://management.azure.com/'); + dfood.portalUrl.should.equal('http://go.microsoft.com/fwlink/?LinkId=254433'); + dfood.validateAuthority.should.equal(true); + + //Verify that the environment properly got added to the prototype + tempEnv.Dogfood.name.should.equal('Dogfood'); + tempEnv.Dogfood.activeDirectoryEndpointUrl.should.equal('https://login.microsoftonline.com'); + tempEnv.Dogfood.activeDirectoryResourceId.should.equal('https://management.core.windows.net/'); + tempEnv.Dogfood.managementEndpointUrl.should.equal('https://management.core.windows.net'); + tempEnv.Dogfood.resourceManagerEndpointUrl.should.equal('https://management.azure.com/'); + tempEnv.Dogfood.portalUrl.should.equal('http://go.microsoft.com/fwlink/?LinkId=254433'); + tempEnv.Dogfood.validateAuthority.should.equal(true); + done(); + }); +}); \ No newline at end of file diff --git a/ClientRuntimes/NodeJS/ms-rest-azure/test/testlist.txt b/ClientRuntimes/NodeJS/ms-rest-azure/test/testlist.txt index 611875592179e..83a9769333bf7 100644 --- a/ClientRuntimes/NodeJS/ms-rest-azure/test/testlist.txt +++ b/ClientRuntimes/NodeJS/ms-rest-azure/test/testlist.txt @@ -1 +1,2 @@ -azureServiceClientTests.js \ No newline at end of file +azureServiceClientTests.js +azureEnvironmentTests.js \ No newline at end of file From 88e367946e73545c92aa7d716ca97b4acfb10ec6 Mon Sep 17 00:00:00 2001 From: Amar Zavery Date: Mon, 2 May 2016 20:31:22 -0700 Subject: [PATCH 12/27] getting rid of underscore.js as a dependency from ms-rest-azure --- ClientRuntimes/NodeJS/ms-rest-azure/package.json | 1 - ClientRuntimes/NodeJS/ms-rest-azure/test/package.json | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/ClientRuntimes/NodeJS/ms-rest-azure/package.json b/ClientRuntimes/NodeJS/ms-rest-azure/package.json index 0cb2731447104..9ca0985902e48 100644 --- a/ClientRuntimes/NodeJS/ms-rest-azure/package.json +++ b/ClientRuntimes/NodeJS/ms-rest-azure/package.json @@ -24,7 +24,6 @@ "uuid": "2.0.1", "adal-node": "0.1.17", "ms-rest": "^1.12.0", - "underscore": "^1.4.0", "moment": "^2.6.0" }, "devDependencies": { diff --git a/ClientRuntimes/NodeJS/ms-rest-azure/test/package.json b/ClientRuntimes/NodeJS/ms-rest-azure/test/package.json index a4970d007d2f2..248a41a8851c5 100644 --- a/ClientRuntimes/NodeJS/ms-rest-azure/test/package.json +++ b/ClientRuntimes/NodeJS/ms-rest-azure/test/package.json @@ -31,8 +31,7 @@ "xunit-file": "0.0.5", "mocha": "2.2.5", "should": "5.2.0", - "moment": "*", - "underscore": "*" + "moment": "*" }, "homepage": "https://github.com/Azure/AutoRest", "repository": { From 19cb26d62f3c3c77411ea5e01d87adcc7db96023 Mon Sep 17 00:00:00 2001 From: Hovsep Mkrtchyan Date: Fri, 6 May 2016 10:50:54 -0700 Subject: [PATCH 13/27] Fixed typos in comments --- .../Microsoft.Rest.ClientRuntime/ServiceClientTracing.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ClientRuntimes/CSharp/Microsoft.Rest.ClientRuntime/ServiceClientTracing.cs b/ClientRuntimes/CSharp/Microsoft.Rest.ClientRuntime/ServiceClientTracing.cs index a9df767f21494..1343b5edcf0b0 100644 --- a/ClientRuntimes/CSharp/Microsoft.Rest.ClientRuntime/ServiceClientTracing.cs +++ b/ClientRuntimes/CSharp/Microsoft.Rest.ClientRuntime/ServiceClientTracing.cs @@ -10,7 +10,7 @@ namespace Microsoft.Rest { /// - /// Provides a set of methods and properties that help you trace the serviceclient. + /// Provides a set of methods and properties that help you trace the service client. /// public static class ServiceClientTracing { @@ -119,7 +119,7 @@ public static bool RemoveTracingInterceptor(IServiceClientTracingInterceptor int /// /// Write the informational tracing message. /// - /// The msessage to trace. + /// The message to trace. /// An object array containing zero or more objects to format public static void Information(string message, params object[] parameters) { From 95622832a5c2b1acb2cf727d917701572eaa7a95 Mon Sep 17 00:00:00 2001 From: Kirthi Krishnamraju Date: Mon, 9 May 2016 11:47:13 -0700 Subject: [PATCH 14/27] Fix for #967: C# generator generates code that contains compiler warnings --- .../AzureBodyDuration/DurationOperations.cs | 9 +- .../ParameterGroupingOperations.cs | 9 +- .../AcceptanceTests/BodyBoolean/BoolModel.cs | 18 ++-- .../Expected/AcceptanceTests/BodyDate/Date.cs | 18 ++-- .../AcceptanceTests/BodyDateTime/Datetime.cs | 54 ++++------- .../BodyDateTimeRfc1123/Datetimerfc1123.cs | 18 ++-- .../AcceptanceTests/BodyDuration/Duration.cs | 9 +- .../AcceptanceTests/BodyInteger/IntModel.cs | 45 ++++------ .../AcceptanceTests/BodyNumber/Number.cs | 90 +++++++------------ .../AcceptanceTests/BodyString/EnumModel.cs | 9 +- .../CompositeBoolIntClient/BoolModel.cs | 18 ++-- .../CompositeBoolIntClient/IntModel.cs | 45 ++++------ .../RequiredOptional/ExplicitModel.cs | 9 +- .../CSharp/Templates/MethodTemplate.cshtml | 15 +++- 14 files changed, 129 insertions(+), 237 deletions(-) diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDuration/DurationOperations.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDuration/DurationOperations.cs index 1bb297f05c5be..0a81d725f40a0 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDuration/DurationOperations.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDuration/DurationOperations.cs @@ -262,12 +262,9 @@ internal DurationOperations(AutoRestDurationTestService client) // Serialize Request string _requestContent = null; - if(durationBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(durationBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(durationBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Set Credentials if (this.Client.Credentials != null) { diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/ParameterGroupingOperations.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/ParameterGroupingOperations.cs index 7fe382cfcdee6..9a2bf74564bac 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/ParameterGroupingOperations.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/ParameterGroupingOperations.cs @@ -161,12 +161,9 @@ internal ParameterGroupingOperations(AutoRestParameterGroupingTestService client // Serialize Request string _requestContent = null; - if(body != null) - { - _requestContent = SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Set Credentials if (this.Client.Credentials != null) { diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyBoolean/BoolModel.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyBoolean/BoolModel.cs index d78403311ec8c..d287e6188c543 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyBoolean/BoolModel.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyBoolean/BoolModel.cs @@ -217,12 +217,9 @@ public BoolModel(AutoRestBoolTestService client) // Serialize Request string _requestContent = null; - if(boolBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(boolBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(boolBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { @@ -446,12 +443,9 @@ public BoolModel(AutoRestBoolTestService client) // Serialize Request string _requestContent = null; - if(boolBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(boolBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(boolBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDate/Date.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDate/Date.cs index 0a4c07170740d..509781fe382c5 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDate/Date.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDate/Date.cs @@ -574,12 +574,9 @@ public Date(AutoRestDateTestService client) // Serialize Request string _requestContent = null; - if(dateBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(dateBody, new DateJsonConverter()); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(dateBody, new DateJsonConverter()); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { @@ -803,12 +800,9 @@ public Date(AutoRestDateTestService client) // Serialize Request string _requestContent = null; - if(dateBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(dateBody, new DateJsonConverter()); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(dateBody, new DateJsonConverter()); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDateTime/Datetime.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDateTime/Datetime.cs index 2248d4263b000..a46a03a8ae9b4 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDateTime/Datetime.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDateTime/Datetime.cs @@ -574,12 +574,9 @@ public Datetime(AutoRestDateTimeTestService client) // Serialize Request string _requestContent = null; - if(datetimeBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(datetimeBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(datetimeBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { @@ -923,12 +920,9 @@ public Datetime(AutoRestDateTimeTestService client) // Serialize Request string _requestContent = null; - if(datetimeBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(datetimeBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(datetimeBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { @@ -1274,12 +1268,9 @@ public Datetime(AutoRestDateTimeTestService client) // Serialize Request string _requestContent = null; - if(datetimeBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(datetimeBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(datetimeBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { @@ -1624,12 +1615,9 @@ public Datetime(AutoRestDateTimeTestService client) // Serialize Request string _requestContent = null; - if(datetimeBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(datetimeBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(datetimeBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { @@ -1853,12 +1841,9 @@ public Datetime(AutoRestDateTimeTestService client) // Serialize Request string _requestContent = null; - if(datetimeBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(datetimeBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(datetimeBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { @@ -2082,12 +2067,9 @@ public Datetime(AutoRestDateTimeTestService client) // Serialize Request string _requestContent = null; - if(datetimeBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(datetimeBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(datetimeBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/Datetimerfc1123.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/Datetimerfc1123.cs index 068aced56df75..2506c533d5633 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/Datetimerfc1123.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/Datetimerfc1123.cs @@ -574,12 +574,9 @@ public Datetimerfc1123(AutoRestRFC1123DateTimeTestService client) // Serialize Request string _requestContent = null; - if(datetimeBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(datetimeBody, new DateTimeRfc1123JsonConverter()); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(datetimeBody, new DateTimeRfc1123JsonConverter()); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { @@ -922,12 +919,9 @@ public Datetimerfc1123(AutoRestRFC1123DateTimeTestService client) // Serialize Request string _requestContent = null; - if(datetimeBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(datetimeBody, new DateTimeRfc1123JsonConverter()); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(datetimeBody, new DateTimeRfc1123JsonConverter()); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDuration/Duration.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDuration/Duration.cs index 42b50edf64d33..7893ed1ee8506 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDuration/Duration.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyDuration/Duration.cs @@ -217,12 +217,9 @@ public Duration(AutoRestDurationTestService client) // Serialize Request string _requestContent = null; - if(durationBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(durationBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(durationBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyInteger/IntModel.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyInteger/IntModel.cs index 9c9b57ebbb2a4..03b6a56c686c0 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyInteger/IntModel.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyInteger/IntModel.cs @@ -812,12 +812,9 @@ public IntModel(AutoRestIntegerTestService client) // Serialize Request string _requestContent = null; - if(intBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(intBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(intBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { @@ -922,12 +919,9 @@ public IntModel(AutoRestIntegerTestService client) // Serialize Request string _requestContent = null; - if(intBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(intBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(intBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { @@ -1032,12 +1026,9 @@ public IntModel(AutoRestIntegerTestService client) // Serialize Request string _requestContent = null; - if(intBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(intBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(intBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { @@ -1142,12 +1133,9 @@ public IntModel(AutoRestIntegerTestService client) // Serialize Request string _requestContent = null; - if(intBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(intBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(intBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { @@ -1371,12 +1359,9 @@ public IntModel(AutoRestIntegerTestService client) // Serialize Request string _requestContent = null; - if(intBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(intBody, new UnixTimeJsonConverter()); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(intBody, new UnixTimeJsonConverter()); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyNumber/Number.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyNumber/Number.cs index 4b60b5582025a..dc98d33d86449 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyNumber/Number.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyNumber/Number.cs @@ -574,12 +574,9 @@ public Number(AutoRestNumberTestService client) // Serialize Request string _requestContent = null; - if(numberBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(numberBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(numberBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { @@ -803,12 +800,9 @@ public Number(AutoRestNumberTestService client) // Serialize Request string _requestContent = null; - if(numberBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(numberBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(numberBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { @@ -1032,12 +1026,9 @@ public Number(AutoRestNumberTestService client) // Serialize Request string _requestContent = null; - if(numberBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(numberBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(numberBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { @@ -1261,12 +1252,9 @@ public Number(AutoRestNumberTestService client) // Serialize Request string _requestContent = null; - if(numberBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(numberBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(numberBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { @@ -1490,12 +1478,9 @@ public Number(AutoRestNumberTestService client) // Serialize Request string _requestContent = null; - if(numberBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(numberBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(numberBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { @@ -1719,12 +1704,9 @@ public Number(AutoRestNumberTestService client) // Serialize Request string _requestContent = null; - if(numberBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(numberBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(numberBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { @@ -1948,12 +1930,9 @@ public Number(AutoRestNumberTestService client) // Serialize Request string _requestContent = null; - if(numberBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(numberBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(numberBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { @@ -2177,12 +2156,9 @@ public Number(AutoRestNumberTestService client) // Serialize Request string _requestContent = null; - if(numberBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(numberBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(numberBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { @@ -2406,12 +2382,9 @@ public Number(AutoRestNumberTestService client) // Serialize Request string _requestContent = null; - if(numberBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(numberBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(numberBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { @@ -2635,12 +2608,9 @@ public Number(AutoRestNumberTestService client) // Serialize Request string _requestContent = null; - if(numberBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(numberBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(numberBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyString/EnumModel.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyString/EnumModel.cs index 8861a350c04b9..c1701bfb31ad1 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyString/EnumModel.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyString/EnumModel.cs @@ -220,12 +220,9 @@ public EnumModel(AutoRestSwaggerBATService client) // Serialize Request string _requestContent = null; - if(stringBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(stringBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(stringBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CompositeBoolIntClient/BoolModel.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CompositeBoolIntClient/BoolModel.cs index 22ff99e128385..9c761510fc304 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CompositeBoolIntClient/BoolModel.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CompositeBoolIntClient/BoolModel.cs @@ -217,12 +217,9 @@ public BoolModel(CompositeBoolInt client) // Serialize Request string _requestContent = null; - if(boolBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(boolBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(boolBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { @@ -446,12 +443,9 @@ public BoolModel(CompositeBoolInt client) // Serialize Request string _requestContent = null; - if(boolBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(boolBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(boolBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CompositeBoolIntClient/IntModel.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CompositeBoolIntClient/IntModel.cs index 2047fd860871e..c730d55f15474 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CompositeBoolIntClient/IntModel.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CompositeBoolIntClient/IntModel.cs @@ -812,12 +812,9 @@ public IntModel(CompositeBoolInt client) // Serialize Request string _requestContent = null; - if(intBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(intBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(intBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { @@ -922,12 +919,9 @@ public IntModel(CompositeBoolInt client) // Serialize Request string _requestContent = null; - if(intBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(intBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(intBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { @@ -1032,12 +1026,9 @@ public IntModel(CompositeBoolInt client) // Serialize Request string _requestContent = null; - if(intBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(intBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(intBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { @@ -1142,12 +1133,9 @@ public IntModel(CompositeBoolInt client) // Serialize Request string _requestContent = null; - if(intBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(intBody, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(intBody, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { @@ -1371,12 +1359,9 @@ public IntModel(CompositeBoolInt client) // Serialize Request string _requestContent = null; - if(intBody != null) - { - _requestContent = SafeJsonConvert.SerializeObject(intBody, new UnixTimeJsonConverter()); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(intBody, new UnixTimeJsonConverter()); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/RequiredOptional/ExplicitModel.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/RequiredOptional/ExplicitModel.cs index f0e42c1bf7fc9..117742e60f654 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/RequiredOptional/ExplicitModel.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/RequiredOptional/ExplicitModel.cs @@ -99,12 +99,9 @@ public ExplicitModel(AutoRestRequiredOptionalTestService client) // Serialize Request string _requestContent = null; - if(bodyParameter != null) - { - _requestContent = SafeJsonConvert.SerializeObject(bodyParameter, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } + _requestContent = SafeJsonConvert.SerializeObject(bodyParameter, this.Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); // Send Request if (_shouldTrace) { diff --git a/AutoRest/Generators/CSharp/CSharp/Templates/MethodTemplate.cshtml b/AutoRest/Generators/CSharp/CSharp/Templates/MethodTemplate.cshtml index df038116b29cb..96077aaee3c81 100644 --- a/AutoRest/Generators/CSharp/CSharp/Templates/MethodTemplate.cshtml +++ b/AutoRest/Generators/CSharp/CSharp/Templates/MethodTemplate.cshtml @@ -161,12 +161,21 @@ else } else { + if (!Model.RequestBody.CanBeNull()) + { + @:_requestContent = SafeJsonConvert.SerializeObject(@(Model.RequestBody.Name), @(Model.GetSerializationSettingsReference(Model.RequestBody.Type))); + @:_httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + @:_httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("@(Model.RequestContentType)"); + } + else + { @:if(@(Model.RequestBody.Name) != null) @:{ - @:_requestContent = SafeJsonConvert.SerializeObject(@(Model.RequestBody.Name), @(Model.GetSerializationSettingsReference(Model.RequestBody.Type))); - @:_httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - @:_httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("@(Model.RequestContentType)"); + @: _requestContent = SafeJsonConvert.SerializeObject(@(Model.RequestBody.Name), @(Model.GetSerializationSettingsReference(Model.RequestBody.Type))); + @: _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); + @: _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("@(Model.RequestContentType)"); @:} + } } } else if (Model.LogicalParameters.Where(p => p.Location == ParameterLocation.FormData).Any()) From 4f7dc492a4c1d707e7c47859c2c8ac9843280b31 Mon Sep 17 00:00:00 2001 From: Amar Zavery Date: Wed, 11 May 2016 12:17:11 -0700 Subject: [PATCH 15/27] updated node.js clientruntime version to 1.13.0 & 1.3.1 for ms-rest-azure and ms-rest resp. --- .../Azure.NodeJS/AzureNodeJSCodeGenerator.cs | 2 +- .../NodeJS/NodeJS/NodeJSCodeGenerator.cs | 2 +- ClientRuntimes/NodeJS/ms-rest-azure/LICENSE | 22 +++++++++++++++++++ .../NodeJS/ms-rest-azure/package.json | 13 ++++------- ClientRuntimes/NodeJS/ms-rest/LICENSE | 22 +++++++++++++++++++ ClientRuntimes/NodeJS/ms-rest/package.json | 11 +++------- 6 files changed, 53 insertions(+), 19 deletions(-) create mode 100644 ClientRuntimes/NodeJS/ms-rest-azure/LICENSE create mode 100644 ClientRuntimes/NodeJS/ms-rest/LICENSE diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS/AzureNodeJSCodeGenerator.cs b/AutoRest/Generators/NodeJS/Azure.NodeJS/AzureNodeJSCodeGenerator.cs index ac8eea6fb028a..06bdbd84874fc 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.12.0"; + private const string ClientRuntimePackage = "ms-rest-azure version 1.13.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 04bacdaeb59b0..2e59314d876df 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.12.0"; + private const string ClientRuntimePackage = "ms-rest version 1.13.1"; public NodeJsCodeNamer Namer { get; private set; } diff --git a/ClientRuntimes/NodeJS/ms-rest-azure/LICENSE b/ClientRuntimes/NodeJS/ms-rest-azure/LICENSE new file mode 100644 index 0000000000000..b8b569d7746d9 --- /dev/null +++ b/ClientRuntimes/NodeJS/ms-rest-azure/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/ClientRuntimes/NodeJS/ms-rest-azure/package.json b/ClientRuntimes/NodeJS/ms-rest-azure/package.json index 9ca0985902e48..1002e12f3eaa6 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.12.0", + "version": "1.13.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" ], @@ -13,23 +13,18 @@ "engines": { "node": ">= 0.10.0" }, - "licenses": [ - { - "type": "MIT", - "url": "https://raw.githubusercontent.com/Microsoft/dotnet/master/LICENSE" - } - ], + "license": "MIT", "dependencies": { "async": "0.2.7", "uuid": "2.0.1", "adal-node": "0.1.17", - "ms-rest": "^1.12.0", + "ms-rest": "^1.13.1", "moment": "^2.6.0" }, "devDependencies": { "jshint": "2.6.3", "xunit-file": "0.0.5", - "mocha": "2.2.5", + "mocha": "2.4.5", "should": "5.2.0" }, "homepage": "https://github.com/Azure/AutoRest", diff --git a/ClientRuntimes/NodeJS/ms-rest/LICENSE b/ClientRuntimes/NodeJS/ms-rest/LICENSE new file mode 100644 index 0000000000000..b8b569d7746d9 --- /dev/null +++ b/ClientRuntimes/NodeJS/ms-rest/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/ClientRuntimes/NodeJS/ms-rest/package.json b/ClientRuntimes/NodeJS/ms-rest/package.json index b21efcee2df2c..656299783e9f9 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.12.0", + "version": "1.13.1", "description": "Client Runtime for Node.js client libraries generated using AutoRest", "tags": ["node", "microsoft", "autorest", "clientruntime"], "keywords": ["node", "microsoft", "autorest", "clientruntime"], @@ -14,12 +14,7 @@ "engines": { "node": ">= 0.10.0" }, - "licenses": [ - { - "type": "MIT", - "url": "https://raw.githubusercontent.com/Microsoft/dotnet/master/LICENSE" - } - ], + "license": "MIT", "dependencies": { "underscore": "^1.4.0", "tunnel": "~0.0.2", @@ -31,7 +26,7 @@ "devDependencies": { "jshint": "2.6.3", "xunit-file": "0.0.5", - "mocha": "2.2.5", + "mocha": "2.4.5", "should": "5.2.0", "node-uuid": "*" }, From 7f90ee0402fa280afa1871ef1db21620a15b1e3c Mon Sep 17 00:00:00 2001 From: Thomas Bombach Date: Wed, 11 May 2016 15:41:03 -0700 Subject: [PATCH 16/27] Adding release notes for 0.16.0 release --- ChangeLog.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index c4affb34a9f94..3bb5f63273058 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,15 @@ -## VNext (not released yet) -* Fix ruby require module_definition if namespace is specified. See [#831](https://github.com/Azure/autorest/issues/831) +##2016.05.11 Version 0.16.0 +* Fixed ruby require module_definition if namespace is specified. See [#831](https://github.com/Azure/autorest/issues/831) +* Added an exit code for AutoRest.exe to indicate success or error +* Added support for Unix time formatted dates with the `'unix-time'` format (#909) + * Serializing/deserializing Unix time formatted dates in C# and NodeJS to DateTime (C#) and Date (NodeJS) +* Added support for Base64Url formatted values with the `'base64url'` format (#805) + * Serializing/deserializing Base64Url formatted values in C# and NodeJS to byte\[\] (C#) and Buffer (NodeJS) +* Fixed issue where the contents of the output file for SingleFileGeneration are appended instead of replaced (#667) +* Made generated parameter group documentation more accurate for `'x-ms-parameter-grouping'` extension (#634) +* UserAgent header in ServiceClient now includes more detailed information (#583) +* Added the ability to specify a name in generated code for query parameters, entity headers, etc. with the [`'x-ms-client-name'`](https://github.com/Azure/autorest/blob/master/Documentation/swagger-extensions.md#x-ms-client-name) +* Bug fixes in all code generators (#722, #742, #745, #746, #819, #820, #824, #825, #889, #896, #897, #900, #915, #923, #934, #944, #943) ##2016.03.04 Version 0.15.0 * Added Java code generator! From ca68a08ac8b96b02c5e0ca458577a8812bef72dc Mon Sep 17 00:00:00 2001 From: Amar Zavery Date: Wed, 11 May 2016 15:53:26 -0700 Subject: [PATCH 17/27] updated activeDirectoryEndpointUrl with slashes --- .../NodeJS/Azure.NodeJS/AzureNodeJSCodeGenerator.cs | 2 +- .../NodeJS/ms-rest-azure/lib/azureEnvironment.js | 8 ++++---- ClientRuntimes/NodeJS/ms-rest-azure/package.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS/AzureNodeJSCodeGenerator.cs b/AutoRest/Generators/NodeJS/Azure.NodeJS/AzureNodeJSCodeGenerator.cs index 06bdbd84874fc..e68eb4727a6dc 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.13.0"; + private const string ClientRuntimePackage = "ms-rest-azure version 1.13.1"; // List of models with paging extensions. private IList pageModels; diff --git a/ClientRuntimes/NodeJS/ms-rest-azure/lib/azureEnvironment.js b/ClientRuntimes/NodeJS/ms-rest-azure/lib/azureEnvironment.js index e902c471c5d30..bc8e1a961dc48 100644 --- a/ClientRuntimes/NodeJS/ms-rest-azure/lib/azureEnvironment.js +++ b/ClientRuntimes/NodeJS/ms-rest-azure/lib/azureEnvironment.js @@ -55,7 +55,7 @@ var supportedEnvironments = { sqlManagementEndpointUrl: 'https://management.core.windows.net:8443/', sqlServerHostnameSuffix: '.database.windows.net', galleryEndpointUrl: 'https://gallery.azure.com/', - activeDirectoryEndpointUrl: 'https://login.microsoftonline.com', + activeDirectoryEndpointUrl: 'https://login.microsoftonline.com/', activeDirectoryResourceId: 'https://management.core.windows.net/', activeDirectoryGraphResourceId: 'https://graph.windows.net/', activeDirectoryGraphApiVersion: '2013-04-05', @@ -73,7 +73,7 @@ var supportedEnvironments = { sqlManagementEndpointUrl: 'https://management.core.chinacloudapi.cn:8443/', sqlServerHostnameSuffix: '.database.chinacloudapi.cn', galleryEndpointUrl: 'https://gallery.chinacloudapi.cn/', - activeDirectoryEndpointUrl: 'https://login.chinacloudapi.cn', + activeDirectoryEndpointUrl: 'https://login.chinacloudapi.cn/', activeDirectoryResourceId: 'https://management.core.chinacloudapi.cn/', activeDirectoryGraphResourceId: 'https://graph.chinacloudapi.cn/', activeDirectoryGraphApiVersion: '2013-04-05', @@ -92,7 +92,7 @@ var supportedEnvironments = { sqlManagementEndpointUrl: 'https://management.core.usgovcloudapi.net:8443/', sqlServerHostnameSuffix: '.database.usgovcloudapi.net', galleryEndpointUrl: 'https://gallery.usgovcloudapi.net/', - activeDirectoryEndpointUrl: 'https://login.microsoftonline.com', + activeDirectoryEndpointUrl: 'https://login.microsoftonline.com/', activeDirectoryResourceId: 'https://management.core.usgovcloudapi.net/', activeDirectoryGraphResourceId: 'https://graph.windows.net/', activeDirectoryGraphApiVersion: '2013-04-05', @@ -111,7 +111,7 @@ var supportedEnvironments = { sqlManagementEndpointUrl: 'https://management.core.cloudapi.de:8443/', sqlServerHostnameSuffix: '.database.cloudapi.de', galleryEndpointUrl: 'https://gallery.cloudapi.de/', - activeDirectoryEndpointUrl: 'https://login.microsoftonline.de', + activeDirectoryEndpointUrl: 'https://login.microsoftonline.de/', activeDirectoryResourceId: 'https://management.core.cloudapi.de/', activeDirectoryGraphResourceId: 'https://graph.cloudapi.de/', activeDirectoryGraphApiVersion: '2013-04-05', diff --git a/ClientRuntimes/NodeJS/ms-rest-azure/package.json b/ClientRuntimes/NodeJS/ms-rest-azure/package.json index 1002e12f3eaa6..cd4e61c7c9655 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.13.0", + "version": "1.13.1", "description": "Client Runtime for Node.js Azure client libraries generated using AutoRest", "tags": [ "node", "microsoft", "autorest", "azure", "clientruntime" ], "keywords": [ "node", "microsoft", "autorest", "azure", "clientruntime" ], From 12ac6481ecad6067e29c95efb3b405f5e7443a25 Mon Sep 17 00:00:00 2001 From: Jianghao Lu Date: Wed, 11 May 2016 16:14:17 -0700 Subject: [PATCH 18/27] Use 1.0.0-SNAPSHOT for Java & Azure.Java --- AutoRest/Generators/Java/Azure.Java/AzureJavaCodeGenerator.cs | 2 +- AutoRest/Generators/Java/Java/JavaCodeGenerator.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/AutoRest/Generators/Java/Azure.Java/AzureJavaCodeGenerator.cs b/AutoRest/Generators/Java/Azure.Java/AzureJavaCodeGenerator.cs index d17290e7a1b97..45e4651a69e84 100644 --- a/AutoRest/Generators/Java/Azure.Java/AzureJavaCodeGenerator.cs +++ b/AutoRest/Generators/Java/Azure.Java/AzureJavaCodeGenerator.cs @@ -18,7 +18,7 @@ public class AzureJavaCodeGenerator : JavaCodeGenerator { private readonly AzureJavaCodeNamer _namer; - private const string ClientRuntimePackage = "com.microsoft.rest:azure-client-runtime:0.0.1-SNAPSHOT"; + private const string ClientRuntimePackage = "com.microsoft.rest:azure-client-runtime:1.0.0-SNAPSHOT from snapshot repo http://adxsnapshots.azurewebsites.net/"; private const string _packageInfoFileName = "package-info.java"; // page extensions class dictionary. diff --git a/AutoRest/Generators/Java/Java/JavaCodeGenerator.cs b/AutoRest/Generators/Java/Java/JavaCodeGenerator.cs index 275c4b16eb4e3..66621e2f0034c 100644 --- a/AutoRest/Generators/Java/Java/JavaCodeGenerator.cs +++ b/AutoRest/Generators/Java/Java/JavaCodeGenerator.cs @@ -14,7 +14,7 @@ namespace Microsoft.Rest.Generator.Java { public class JavaCodeGenerator : CodeGenerator { - private const string ClientRuntimePackage = "com.microsoft.rest:client-runtime:0.0.1-SNAPSHOT"; + private const string ClientRuntimePackage = "com.microsoft.rest:client-runtime:1.0.0-SNAPSHOT from snapshot repo http://adxsnapshots.azurewebsites.net/"; private const string _packageInfoFileName = "package-info.java"; public JavaCodeNamer Namer { get; private set; } From af4d52244e3e529a8d534f51720a3b24b1cd1f84 Mon Sep 17 00:00:00 2001 From: Amar Zavery Date: Wed, 11 May 2016 16:36:08 -0700 Subject: [PATCH 19/27] fix env tests --- .../ms-rest-azure/test/azureEnvironmentTests.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ClientRuntimes/NodeJS/ms-rest-azure/test/azureEnvironmentTests.js b/ClientRuntimes/NodeJS/ms-rest-azure/test/azureEnvironmentTests.js index 01b6fbfd81708..26f8db2e2e3e8 100644 --- a/ClientRuntimes/NodeJS/ms-rest-azure/test/azureEnvironmentTests.js +++ b/ClientRuntimes/NodeJS/ms-rest-azure/test/azureEnvironmentTests.js @@ -14,7 +14,7 @@ describe('AzureEnvironment', function() { it('should show the details of Azure Production environment correctly', function(done) { var tempEnv = msRestAzure.AzureEnvironment.Azure; tempEnv.name.should.equal('Azure'); - tempEnv.activeDirectoryEndpointUrl.should.equal('https://login.microsoftonline.com'); + tempEnv.activeDirectoryEndpointUrl.should.equal('https://login.microsoftonline.com/'); tempEnv.activeDirectoryResourceId.should.equal('https://management.core.windows.net/'); tempEnv.managementEndpointUrl.should.equal('https://management.core.windows.net'); tempEnv.resourceManagerEndpointUrl.should.equal('https://management.azure.com/'); @@ -26,7 +26,7 @@ describe('AzureEnvironment', function() { it('should show the details of Azure China environment correctly', function(done) { var tempEnv = msRestAzure.AzureEnvironment.AzureChina; tempEnv.name.should.equal('AzureChina'); - tempEnv.activeDirectoryEndpointUrl.should.equal('https://login.chinacloudapi.cn'); + tempEnv.activeDirectoryEndpointUrl.should.equal('https://login.chinacloudapi.cn/'); tempEnv.activeDirectoryResourceId.should.equal('https://management.core.chinacloudapi.cn/'); tempEnv.managementEndpointUrl.should.equal('https://management.core.chinacloudapi.cn'); tempEnv.resourceManagerEndpointUrl.should.equal('https://management.chinacloudapi.cn'); @@ -38,7 +38,7 @@ describe('AzureEnvironment', function() { it('should show the details of Azure USGovernment environment correctly', function(done) { var tempEnv = msRestAzure.AzureEnvironment.AzureUSGovernment; tempEnv.name.should.equal('AzureUSGovernment'); - tempEnv.activeDirectoryEndpointUrl.should.equal('https://login.microsoftonline.com'); + tempEnv.activeDirectoryEndpointUrl.should.equal('https://login.microsoftonline.com/'); tempEnv.activeDirectoryResourceId.should.equal('https://management.core.usgovcloudapi.net/'); tempEnv.managementEndpointUrl.should.equal('https://management.core.usgovcloudapi.net'); tempEnv.resourceManagerEndpointUrl.should.equal('https://management.usgovcloudapi.net'); @@ -50,7 +50,7 @@ describe('AzureEnvironment', function() { it('should show the details of Azure GermanCloud environment correctly', function(done) { var tempEnv = msRestAzure.AzureEnvironment.AzureGermanCloud; tempEnv.name.should.equal('AzureGermanCloud'); - tempEnv.activeDirectoryEndpointUrl.should.equal('https://login.microsoftonline.de'); + tempEnv.activeDirectoryEndpointUrl.should.equal('https://login.microsoftonline.de/'); tempEnv.activeDirectoryResourceId.should.equal('https://management.core.cloudapi.de/'); tempEnv.managementEndpointUrl.should.equal('https://management.core.cloudapi.de'); tempEnv.resourceManagerEndpointUrl.should.equal('https://management.microsoftazure.de'); @@ -65,13 +65,13 @@ describe('AzureEnvironment', function() { portalUrl: 'http://go.microsoft.com/fwlink/?LinkId=254433', managementEndpointUrl: 'https://management.core.windows.net', resourceManagerEndpointUrl: 'https://management.azure.com/', - activeDirectoryEndpointUrl: 'https://login.microsoftonline.com', + activeDirectoryEndpointUrl: 'https://login.microsoftonline.com/', activeDirectoryResourceId: 'https://management.core.windows.net/' }; var tempEnv = msRestAzure.AzureEnvironment; var dfood = tempEnv.add(df); dfood.name.should.equal('Dogfood'); - dfood.activeDirectoryEndpointUrl.should.equal('https://login.microsoftonline.com'); + dfood.activeDirectoryEndpointUrl.should.equal('https://login.microsoftonline.com/'); dfood.activeDirectoryResourceId.should.equal('https://management.core.windows.net/'); dfood.managementEndpointUrl.should.equal('https://management.core.windows.net'); dfood.resourceManagerEndpointUrl.should.equal('https://management.azure.com/'); @@ -80,7 +80,7 @@ describe('AzureEnvironment', function() { //Verify that the environment properly got added to the prototype tempEnv.Dogfood.name.should.equal('Dogfood'); - tempEnv.Dogfood.activeDirectoryEndpointUrl.should.equal('https://login.microsoftonline.com'); + tempEnv.Dogfood.activeDirectoryEndpointUrl.should.equal('https://login.microsoftonline.com/'); tempEnv.Dogfood.activeDirectoryResourceId.should.equal('https://management.core.windows.net/'); tempEnv.Dogfood.managementEndpointUrl.should.equal('https://management.core.windows.net'); tempEnv.Dogfood.resourceManagerEndpointUrl.should.equal('https://management.azure.com/'); From fe3e5a4ccd87af9e7dfcec310826353a86000a8d Mon Sep 17 00:00:00 2001 From: Thomas Bombach Date: Thu, 12 May 2016 10:47:46 -0700 Subject: [PATCH 20/27] Fix for a null reference exception in JavaCodeNamer when the namespace parameter is not provided as a command line parameter --- AutoRest/Generators/Java/Java/JavaCodeNamer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AutoRest/Generators/Java/Java/JavaCodeNamer.cs b/AutoRest/Generators/Java/Java/JavaCodeNamer.cs index c8d58b1031848..3c4921479f9e1 100644 --- a/AutoRest/Generators/Java/Java/JavaCodeNamer.cs +++ b/AutoRest/Generators/Java/Java/JavaCodeNamer.cs @@ -33,7 +33,7 @@ public JavaCodeNamer(string nameSpace) { // List retrieved from // http://docs.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html - _package = nameSpace.ToLower(CultureInfo.InvariantCulture); + _package = nameSpace != null ? nameSpace.ToLower(CultureInfo.InvariantCulture) : string.Empty; new HashSet { "abstract", "assert", "boolean", "break", "byte", From 78356b5087ce70559da29d8a38381f4f94433ba1 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 12 May 2016 14:21:12 -0700 Subject: [PATCH 21/27] Updated comments for references --- .../CSharp/CSharp/ClientModelExtensions.cs | 30 +++++++++++++++++++ .../CSharp/Templates/ModelTemplate.cshtml | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/AutoRest/Generators/CSharp/CSharp/ClientModelExtensions.cs b/AutoRest/Generators/CSharp/CSharp/ClientModelExtensions.cs index ae4d9f11159de..ff5f118022781 100644 --- a/AutoRest/Generators/CSharp/CSharp/ClientModelExtensions.cs +++ b/AutoRest/Generators/CSharp/CSharp/ClientModelExtensions.cs @@ -131,6 +131,36 @@ private static bool ShouldValidate(this IType model) return false; } + /// + /// Format the documentation of a property properly with the correct getters and setters. Note that this validation will + /// checks for special cases such as acronyms and article words. + /// + /// The given property documentation to format + /// A reference of the property documentation + public static string GetFormattedPropertyDocumentation(this Property property) + { + if (string.IsNullOrEmpty(property.Documentation)) + { + return property.Documentation.EscapeXmlComment(); + } + + string documentation = property.IsReadOnly ? "Gets " : "Gets or sets "; + + string firstWord = property.Documentation.TrimStart().Split(' ').First(); + if (firstWord.Length <= 1) + { + documentation += char.ToLower(property.Documentation[0]) + property.Documentation.Substring(1); + } + else + { + documentation += firstWord.ToUpper() == firstWord + ? property.Documentation + : char.ToLower(property.Documentation[0]) + property.Documentation.Substring(1); + } + + return documentation.EscapeXmlComment(); + } + /// /// Format the value of a sequence given the modeled element format. Note that only sequences of strings are supported /// diff --git a/AutoRest/Generators/CSharp/CSharp/Templates/ModelTemplate.cshtml b/AutoRest/Generators/CSharp/CSharp/Templates/ModelTemplate.cshtml index 942e67ef809e3..aeb27d92a4579 100644 --- a/AutoRest/Generators/CSharp/CSharp/Templates/ModelTemplate.cshtml +++ b/AutoRest/Generators/CSharp/CSharp/Templates/ModelTemplate.cshtml @@ -109,7 +109,7 @@ namespace @(Settings.Namespace).Models @foreach (var property in Model.PropertyTemplateModels.Where(p => !p.IsConstant)) { @:/// - @:@WrapComment("/// ", property.Documentation.EscapeXmlComment()) + @:@WrapComment("/// ", property.GetFormattedPropertyDocumentation()) @:/// if (property.Type.IsPrimaryType(KnownPrimaryType.Date)) { From 374455aa8e30dcdd89b2b8027fe2315c0ac173af Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 12 May 2016 14:25:08 -0700 Subject: [PATCH 22/27] Regenerated expected files --- .../AzureCompositeModelClient/Models/Basic.cs | 3 +- .../Models/CatalogArray.cs | 2 +- .../Models/CatalogArrayOfDictionary.cs | 2 +- .../Models/CatalogDictionary.cs | 2 +- .../Models/CatalogDictionaryOfArray.cs | 2 +- .../Models/Product.cs | 15 ++- .../Models/FirstParameterGroup.cs | 4 +- ...ingPostMultiParamGroupsSecondParamGroup.cs | 4 +- ...ParameterGroupingPostOptionalParameters.cs | 4 +- ...ParameterGroupingPostRequiredParameters.cs | 6 +- .../AzureResource/Models/Resource.cs | 8 +- .../HeaderCustomNamedRequestIdHeaders.cs | 2 +- .../LRORetrysDelete202Retry200Headers.cs | 6 +- ...eleteAsyncRelativeRetrySucceededHeaders.cs | 8 +- ...visioning202Accepted200SucceededHeaders.cs | 6 +- .../Models/LRORetrysPost202Retry200Headers.cs | 6 +- ...sPostAsyncRelativeRetrySucceededHeaders.cs | 8 +- ...ysPutAsyncRelativeRetrySucceededHeaders.cs | 8 +- .../LROSADsDelete202NonRetry400Headers.cs | 6 +- ...OSADsDelete202RetryInvalidHeaderHeaders.cs | 7 +- ...OSADsDeleteAsyncRelativeRetry400Headers.cs | 8 +- ...eAsyncRelativeRetryInvalidHeaderHeaders.cs | 10 +- ...cRelativeRetryInvalidJsonPollingHeaders.cs | 8 +- ...DeleteAsyncRelativeRetryNoStatusHeaders.cs | 8 +- .../Models/LROSADsDeleteNonRetry400Headers.cs | 6 +- .../Models/LROSADsPost202NoLocationHeaders.cs | 6 +- .../LROSADsPost202NonRetry400Headers.cs | 6 +- ...LROSADsPost202RetryInvalidHeaderHeaders.cs | 7 +- ...LROSADsPostAsyncRelativeRetry400Headers.cs | 8 +- ...tAsyncRelativeRetryInvalidHeaderHeaders.cs | 8 +- ...cRelativeRetryInvalidJsonPollingHeaders.cs | 8 +- ...sPostAsyncRelativeRetryNoPayloadHeaders.cs | 8 +- .../Models/LROSADsPostNonRetry400Headers.cs | 6 +- .../LROSADsPutAsyncRelativeRetry400Headers.cs | 8 +- ...tAsyncRelativeRetryInvalidHeaderHeaders.cs | 8 +- ...cRelativeRetryInvalidJsonPollingHeaders.cs | 8 +- ...ADsPutAsyncRelativeRetryNoStatusHeaders.cs | 8 +- ...syncRelativeRetryNoStatusPayloadHeaders.cs | 8 +- .../LROsCustomHeaderPost202Retry200Headers.cs | 6 +- ...tomHeaderPostAsyncRetrySucceededHeaders.cs | 8 +- ...stomHeaderPutAsyncRetrySucceededHeaders.cs | 8 +- .../Models/LROsDelete202NoRetry204Headers.cs | 6 +- .../Models/LROsDelete202Retry200Headers.cs | 6 +- .../LROsDeleteAsyncNoHeaderInRetryHeaders.cs | 2 +- .../LROsDeleteAsyncNoRetrySucceededHeaders.cs | 8 +- .../LROsDeleteAsyncRetryFailedHeaders.cs | 8 +- .../LROsDeleteAsyncRetrySucceededHeaders.cs | 8 +- .../LROsDeleteAsyncRetrycanceledHeaders.cs | 8 +- .../LROsDeleteNoHeaderInRetryHeaders.cs | 2 +- ...visioning202Accepted200SucceededHeaders.cs | 6 +- ...Provisioning202DeletingFailed200Headers.cs | 6 +- ...ovisioning202Deletingcanceled200Headers.cs | 6 +- .../Models/LROsPost202NoRetry204Headers.cs | 6 +- .../Lro/Models/LROsPost202Retry200Headers.cs | 6 +- .../LROsPostAsyncNoRetrySucceededHeaders.cs | 8 +- .../Models/LROsPostAsyncRetryFailedHeaders.cs | 8 +- .../LROsPostAsyncRetrySucceededHeaders.cs | 8 +- .../LROsPostAsyncRetrycanceledHeaders.cs | 8 +- .../LROsPutAsyncNoRetrySucceededHeaders.cs | 4 +- .../LROsPutAsyncNoRetrycanceledHeaders.cs | 4 +- .../Models/LROsPutAsyncRetryFailedHeaders.cs | 8 +- .../LROsPutAsyncRetrySucceededHeaders.cs | 8 +- .../Models/LROsPutNoHeaderInRetryHeaders.cs | 2 +- .../Lro/Models/OperationResult.cs | 6 +- .../Lro/Models/OperationResultError.cs | 4 +- .../AcceptanceTests/Lro/Models/Product.cs | 2 +- .../AcceptanceTests/Lro/Models/Resource.cs | 8 +- .../AcceptanceTests/Lro/Models/SubProduct.cs | 2 +- .../AcceptanceTests/Lro/Models/SubResource.cs | 2 +- .../Paging/Models/OperationResult.cs | 6 +- .../Models/PagingGetMultiplePagesOptions.cs | 9 +- ...ngGetMultiplePagesWithOffsetNextOptions.cs | 7 +- ...PagingGetMultiplePagesWithOffsetOptions.cs | 11 +- .../Models/SampleResourceGroup.cs | 4 +- .../BodyComplex/Models/Basic.cs | 3 +- .../Models/HeaderResponseBoolHeaders.cs | 2 +- .../Models/HeaderResponseByteHeaders.cs | 2 +- .../Models/HeaderResponseDateHeaders.cs | 3 +- .../Models/HeaderResponseDatetimeHeaders.cs | 2 +- .../HeaderResponseDatetimeRfc1123Headers.cs | 4 +- .../Models/HeaderResponseDoubleHeaders.cs | 2 +- .../Models/HeaderResponseDurationHeaders.cs | 2 +- .../Models/HeaderResponseEnumHeaders.cs | 2 +- .../HeaderResponseExistingKeyHeaders.cs | 2 +- .../Models/HeaderResponseFloatHeaders.cs | 2 +- .../Models/HeaderResponseIntegerHeaders.cs | 2 +- .../Models/HeaderResponseLongHeaders.cs | 2 +- .../HeaderResponseProtectedKeyHeaders.cs | 2 +- .../Models/HeaderResponseStringHeaders.cs | 4 +- .../Models/HttpRedirectsDelete307Headers.cs | 2 +- .../Http/Models/HttpRedirectsGet300Headers.cs | 2 +- .../Http/Models/HttpRedirectsGet301Headers.cs | 2 +- .../Http/Models/HttpRedirectsGet302Headers.cs | 2 +- .../Http/Models/HttpRedirectsGet307Headers.cs | 2 +- .../Models/HttpRedirectsHead300Headers.cs | 2 +- .../Models/HttpRedirectsHead301Headers.cs | 2 +- .../Models/HttpRedirectsHead302Headers.cs | 2 +- .../Models/HttpRedirectsHead307Headers.cs | 2 +- .../Models/HttpRedirectsPatch302Headers.cs | 2 +- .../Models/HttpRedirectsPatch307Headers.cs | 2 +- .../Models/HttpRedirectsPost303Headers.cs | 2 +- .../Models/HttpRedirectsPost307Headers.cs | 2 +- .../Http/Models/HttpRedirectsPut301Headers.cs | 2 +- .../Http/Models/HttpRedirectsPut307Headers.cs | 2 +- .../ModelFlattening/Models/BaseProduct.cs | 9 +- .../Models/FlattenParameterGroup.cs | 19 +-- .../Models/FlattenedProduct.cs | 2 +- .../ModelFlattening/Models/GenericUrl.cs | 2 +- .../ModelFlattening/Models/Resource.cs | 8 +- .../ModelFlattening/Models/SimpleProduct.cs | 6 +- .../Validation/Models/ChildProduct.cs | 2 +- .../Validation/Models/Product.cs | 9 +- .../Mirror.Polymorphic/Models/Animal.cs | 4 +- .../Mirror.Polymorphic/Models/BaseCat.cs | 2 +- .../Mirror.Polymorphic/Models/BurmeseCat.cs | 2 +- .../Mirror.Polymorphic/Models/Doggy.cs | 2 +- .../Mirror.Polymorphic/Models/HimalayanCat.cs | 2 +- .../Mirror.Polymorphic/Models/Horsey.cs | 2 +- .../Mirror.Polymorphic/Models/PersianCat.cs | 2 +- .../Mirror.Polymorphic/Models/SiameseCat.cs | 2 +- .../Mirror.Primitives/Models/Product.cs | 2 +- .../Mirror.RecursiveTypes/Models/Product.cs | 7 +- .../PetstoreV2/Models/LoginUserHeaders.cs | 4 +- .../Expected/PetstoreV2/Models/Order.cs | 4 +- .../Expected/PetstoreV2/Models/Pet.cs | 4 +- .../Expected/PetstoreV2/Models/User.cs | 2 +- .../models/FirstParameterGroup.java | 2 +- ...gPostMultiParamGroupsSecondParamGroup.java | 2 +- ...rameterGroupingPostOptionalParameters.java | 2 +- ...rameterGroupingPostRequiredParameters.java | 2 +- .../models/PagingGetMultiplePagesOptions.java | 2 +- ...gingGetMultiplePagesWithOffsetOptions.java | 2 +- .../models/FlattenParameterGroup.java | 2 +- .../models/firstParameterGroup.js | 2 +- .../AzureParameterGrouping/models/index.d.ts | 8 +- ...ingPostMultiParamGroupsSecondParamGroup.js | 2 +- ...parameterGroupingPostOptionalParameters.js | 2 +- ...parameterGroupingPostRequiredParameters.js | 2 +- .../Lro/operations/lRORetrys.js | 16 +-- .../AcceptanceTests/Lro/operations/lROSADs.js | 52 ++++---- .../AcceptanceTests/Lro/operations/lROs.js | 74 +++++------ .../Lro/operations/lROsCustomHeader.js | 10 +- .../AcceptanceTests/Paging/models/index.d.ts | 4 +- .../models/pagingGetMultiplePagesOptions.js | 2 +- ...pagingGetMultiplePagesWithOffsetOptions.js | 2 +- .../operations/storageAccounts.js | 2 +- .../models/flattenParameterGroup.js | 2 +- .../ModelFlattening/models/index.d.ts | 2 +- .../AzureBodyDuration/setup.py | 2 +- .../models/first_parameter_group.py | 2 +- ...t_multi_param_groups_second_param_group.py | 2 +- ...meter_grouping_post_optional_parameters.py | 2 +- ...meter_grouping_post_required_parameters.py | 2 +- .../AzureParameterGrouping/setup.py | 2 +- .../AcceptanceTests/AzureReport/setup.py | 2 +- .../AcceptanceTests/AzureResource/setup.py | 2 +- .../AcceptanceTests/AzureSpecials/setup.py | 2 +- .../AcceptanceTests/CustomBaseUri/setup.py | 2 +- .../Expected/AcceptanceTests/Head/setup.py | 2 +- .../AcceptanceTests/HeadExceptions/setup.py | 2 +- .../Expected/AcceptanceTests/Lro/setup.py | 2 +- .../paging_get_multiple_pages_options.py | 2 +- ..._get_multiple_pages_with_offset_options.py | 2 +- .../Expected/AcceptanceTests/Paging/setup.py | 2 +- .../StorageManagementClient/setup.py | 2 +- .../SubscriptionIdApiVersion/setup.py | 2 +- .../models/flatten_parameter_group.py | 2 +- .../Models/CheckNameAvailabilityResult.cs | 17 ++- .../Azure.CSharp/Models/CustomDomain.cs | 8 +- .../Azure.CSharp/Models/Endpoints.cs | 8 +- .../Azure.CSharp/Models/Resource.cs | 10 +- .../Models/StorageAccountCreateParameters.cs | 4 +- .../Azure.CSharp/Models/StorageAccountKeys.cs | 4 +- .../Models/StorageAccountProperties.cs | 64 ++++----- ...torageAccountPropertiesCreateParameters.cs | 6 +- ...torageAccountPropertiesUpdateParameters.cs | 14 +- .../Models/StorageAccountUpdateParameters.cs | 2 +- .../Azure.CSharp/Models/Usage.cs | 15 ++- .../Azure.CSharp/Models/UsageName.cs | 4 +- .../operations/storageAccounts.js | 2 +- Samples/azure-storage/Azure.Python/setup.py | 2 +- .../azure_storage/storage_accounts.rb | 47 +++++-- .../azure_storage/usage_operations.rb | 5 +- Samples/petstore/CSharp/Models/Order.cs | 4 +- Samples/petstore/CSharp/Models/Pet.cs | 4 +- Samples/petstore/CSharp/Models/User.cs | 2 +- .../Ruby/petstore/swagger_petstore.rb | 122 ++++++++++++++---- 187 files changed, 663 insertions(+), 544 deletions(-) diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/Models/Basic.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/Models/Basic.cs index e30aad46136d3..a3f115e527736 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/Models/Basic.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/Models/Basic.cs @@ -44,7 +44,8 @@ public Basic() { } public string Name { get; set; } /// - /// Possible values include: 'cyan', 'Magenta', 'YELLOW', 'blacK' + /// Gets or sets possible values include: 'cyan', 'Magenta', 'YELLOW', + /// 'blacK' /// [JsonProperty(PropertyName = "color")] public string Color { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/Models/CatalogArray.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/Models/CatalogArray.cs index 66c81ff69df2e..7d380e403bc71 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/Models/CatalogArray.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/Models/CatalogArray.cs @@ -32,7 +32,7 @@ public CatalogArray() { } } /// - /// Array of products + /// Gets or sets array of products /// [JsonProperty(PropertyName = "productArray")] public IList ProductArray { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/Models/CatalogArrayOfDictionary.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/Models/CatalogArrayOfDictionary.cs index 893eaa5620e00..5f64fd7d8be66 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/Models/CatalogArrayOfDictionary.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/Models/CatalogArrayOfDictionary.cs @@ -32,7 +32,7 @@ public CatalogArrayOfDictionary() { } } /// - /// Array of dictionary of products + /// Gets or sets array of dictionary of products /// [JsonProperty(PropertyName = "productArrayOfDictionary")] public IList> ProductArrayOfDictionary { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/Models/CatalogDictionary.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/Models/CatalogDictionary.cs index fc5886801b627..f3b008a02d974 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/Models/CatalogDictionary.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/Models/CatalogDictionary.cs @@ -32,7 +32,7 @@ public CatalogDictionary() { } } /// - /// Dictionary of products + /// Gets or sets dictionary of products /// [JsonProperty(PropertyName = "productDictionary")] public IDictionary ProductDictionary { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/Models/CatalogDictionaryOfArray.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/Models/CatalogDictionaryOfArray.cs index 08422bdccb508..1ce6d5bda5059 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/Models/CatalogDictionaryOfArray.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/Models/CatalogDictionaryOfArray.cs @@ -32,7 +32,7 @@ public CatalogDictionaryOfArray() { } } /// - /// Dictionary of Array of product + /// Gets or sets dictionary of Array of product /// [JsonProperty(PropertyName = "productDictionaryOfArray")] public IDictionary> ProductDictionaryOfArray { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/Models/Product.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/Models/Product.cs index f09206d4572f6..6490bfe15f7b7 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/Models/Product.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureCompositeModelClient/Models/Product.cs @@ -39,33 +39,34 @@ public Product() { } } /// - /// Unique identifier representing a specific product for a given - /// latitude & longitude. For example, uberX in San Francisco - /// will have a different product_id than uberX in Los Angeles. + /// Gets or sets unique identifier representing a specific product for + /// a given latitude & longitude. For example, uberX in San + /// Francisco will have a different product_id than uberX in Los + /// Angeles. /// [JsonProperty(PropertyName = "product_id")] public string ProductId { get; set; } /// - /// Description of product. + /// Gets or sets description of product. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } /// - /// Display name of product. + /// Gets or sets display name of product. /// [JsonProperty(PropertyName = "display_name")] public string DisplayName { get; set; } /// - /// Capacity of product. For example, 4 people. + /// Gets or sets capacity of product. For example, 4 people. /// [JsonProperty(PropertyName = "capacity")] public string Capacity { get; set; } /// - /// Image URL representing the product. + /// Gets or sets image URL representing the product. /// [JsonProperty(PropertyName = "image")] public string Image { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/FirstParameterGroup.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/FirstParameterGroup.cs index 0b05e6b45209b..64544e0994a33 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/FirstParameterGroup.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/FirstParameterGroup.cs @@ -17,7 +17,7 @@ namespace Fixtures.Azure.AcceptanceTestsAzureParameterGrouping.Models using Microsoft.Rest.Azure; /// - /// Additional parameters for the postMultiParamGroups operation. + /// Additional parameters for one or more operations /// public partial class FirstParameterGroup { @@ -41,7 +41,7 @@ public FirstParameterGroup() { } public string HeaderOne { get; set; } /// - /// Query parameter with default + /// Gets or sets query parameter with default /// [JsonProperty(PropertyName = "")] public int? QueryOne { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/ParameterGroupingPostMultiParamGroupsSecondParamGroup.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/ParameterGroupingPostMultiParamGroupsSecondParamGroup.cs index b62aab87f7c4e..874e8e1d79929 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/ParameterGroupingPostMultiParamGroupsSecondParamGroup.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/ParameterGroupingPostMultiParamGroupsSecondParamGroup.cs @@ -17,7 +17,7 @@ namespace Fixtures.Azure.AcceptanceTestsAzureParameterGrouping.Models using Microsoft.Rest.Azure; /// - /// Additional parameters for the postMultiParamGroups operation. + /// Additional parameters for one or more operations /// public partial class ParameterGroupingPostMultiParamGroupsSecondParamGroup { @@ -43,7 +43,7 @@ public ParameterGroupingPostMultiParamGroupsSecondParamGroup() { } public string HeaderTwo { get; set; } /// - /// Query parameter with default + /// Gets or sets query parameter with default /// [JsonProperty(PropertyName = "")] public int? QueryTwo { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/ParameterGroupingPostOptionalParameters.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/ParameterGroupingPostOptionalParameters.cs index ad34300acc32a..7dce24800e0f0 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/ParameterGroupingPostOptionalParameters.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/ParameterGroupingPostOptionalParameters.cs @@ -17,7 +17,7 @@ namespace Fixtures.Azure.AcceptanceTestsAzureParameterGrouping.Models using Microsoft.Rest.Azure; /// - /// Additional parameters for the postOptional operation. + /// Additional parameters for one or more operations /// public partial class ParameterGroupingPostOptionalParameters { @@ -43,7 +43,7 @@ public ParameterGroupingPostOptionalParameters() { } public string CustomHeader { get; set; } /// - /// Query parameter with default + /// Gets or sets query parameter with default /// [JsonProperty(PropertyName = "")] public int? Query { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/ParameterGroupingPostRequiredParameters.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/ParameterGroupingPostRequiredParameters.cs index 65b9f511989af..7f1bd8dfc24dd 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/ParameterGroupingPostRequiredParameters.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/ParameterGroupingPostRequiredParameters.cs @@ -17,7 +17,7 @@ namespace Fixtures.Azure.AcceptanceTestsAzureParameterGrouping.Models using Microsoft.Rest.Azure; /// - /// Additional parameters for the postRequired operation. + /// Additional parameters for one or more operations /// public partial class ParameterGroupingPostRequiredParameters { @@ -50,13 +50,13 @@ public ParameterGroupingPostRequiredParameters() { } public string CustomHeader { get; set; } /// - /// Query parameter with default + /// Gets or sets query parameter with default /// [JsonProperty(PropertyName = "")] public int? Query { get; set; } /// - /// Path parameter + /// Gets or sets path parameter /// [JsonProperty(PropertyName = "")] public string Path { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureResource/Models/Resource.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureResource/Models/Resource.cs index 8e0914cc4e682..61d81a2722b2c 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureResource/Models/Resource.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureResource/Models/Resource.cs @@ -36,13 +36,13 @@ public Resource() { } } /// - /// Resource Id + /// Gets resource Id /// [JsonProperty(PropertyName = "id")] public string Id { get; private set; } /// - /// Resource Type + /// Gets resource Type /// [JsonProperty(PropertyName = "type")] public string Type { get; private set; } @@ -53,13 +53,13 @@ public Resource() { } public IDictionary Tags { get; set; } /// - /// Resource Location + /// Gets or sets resource Location /// [JsonProperty(PropertyName = "location")] public string Location { get; set; } /// - /// Resource Name + /// Gets resource Name /// [JsonProperty(PropertyName = "name")] public string Name { get; private set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureSpecials/Models/HeaderCustomNamedRequestIdHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureSpecials/Models/HeaderCustomNamedRequestIdHeaders.cs index d00b60f8390f2..4328e58dfa0ed 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureSpecials/Models/HeaderCustomNamedRequestIdHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureSpecials/Models/HeaderCustomNamedRequestIdHeaders.cs @@ -37,7 +37,7 @@ public HeaderCustomNamedRequestIdHeaders() { } } /// - /// Gets the foo-request-id. + /// Gets or sets gets the foo-request-id. /// [JsonProperty(PropertyName = "foo-request-id")] public string FooRequestId { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LRORetrysDelete202Retry200Headers.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LRORetrysDelete202Retry200Headers.cs index 5a86816dc6a3b..48c5638bc1344 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LRORetrysDelete202Retry200Headers.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LRORetrysDelete202Retry200Headers.cs @@ -38,15 +38,15 @@ public LRORetrysDelete202Retry200Headers() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/retryerror/delete/202/retry/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LRORetrysDeleteAsyncRelativeRetrySucceededHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LRORetrysDeleteAsyncRelativeRetrySucceededHeaders.cs index e368937f0d639..095ed23b916b1 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LRORetrysDeleteAsyncRelativeRetrySucceededHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LRORetrysDeleteAsyncRelativeRetrySucceededHeaders.cs @@ -39,22 +39,22 @@ public LRORetrysDeleteAsyncRelativeRetrySucceededHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/retryerror/deleteasync/retry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/retryerror/deleteasync/retry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LRORetrysDeleteProvisioning202Accepted200SucceededHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LRORetrysDeleteProvisioning202Accepted200SucceededHeaders.cs index 6bf24c3d9a7cc..3c239e13c5061 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LRORetrysDeleteProvisioning202Accepted200SucceededHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LRORetrysDeleteProvisioning202Accepted200SucceededHeaders.cs @@ -39,15 +39,15 @@ public LRORetrysDeleteProvisioning202Accepted200SucceededHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/retryerror/delete/provisioning/202/accepted/200/succeeded /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LRORetrysPost202Retry200Headers.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LRORetrysPost202Retry200Headers.cs index d8e377089a104..be801531b1e35 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LRORetrysPost202Retry200Headers.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LRORetrysPost202Retry200Headers.cs @@ -38,15 +38,15 @@ public LRORetrysPost202Retry200Headers() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/retryerror/post/202/retry/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LRORetrysPostAsyncRelativeRetrySucceededHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LRORetrysPostAsyncRelativeRetrySucceededHeaders.cs index 0cf65de610684..694c6f60c6043 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LRORetrysPostAsyncRelativeRetrySucceededHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LRORetrysPostAsyncRelativeRetrySucceededHeaders.cs @@ -39,22 +39,22 @@ public LRORetrysPostAsyncRelativeRetrySucceededHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/retryerror/putasync/retry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/retryerror/putasync/retry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LRORetrysPutAsyncRelativeRetrySucceededHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LRORetrysPutAsyncRelativeRetrySucceededHeaders.cs index eeb61fc755b1c..02693514b3115 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LRORetrysPutAsyncRelativeRetrySucceededHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LRORetrysPutAsyncRelativeRetrySucceededHeaders.cs @@ -39,22 +39,22 @@ public LRORetrysPutAsyncRelativeRetrySucceededHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/retryerror/putasync/retry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/retryerror/putasync/retry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDelete202NonRetry400Headers.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDelete202NonRetry400Headers.cs index 5178d27baa190..116d6a7e5db40 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDelete202NonRetry400Headers.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDelete202NonRetry400Headers.cs @@ -38,15 +38,15 @@ public LROSADsDelete202NonRetry400Headers() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/retryerror/delete/202/retry/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDelete202RetryInvalidHeaderHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDelete202RetryInvalidHeaderHeaders.cs index 74944259a2ca3..727b01276234f 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDelete202RetryInvalidHeaderHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDelete202RetryInvalidHeaderHeaders.cs @@ -38,14 +38,15 @@ public LROSADsDelete202RetryInvalidHeaderHeaders() { } } /// - /// Location to poll for result status: will be set to /foo + /// Gets or sets location to poll for result status: will be set to + /// /foo /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to /bar + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to /bar /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDeleteAsyncRelativeRetry400Headers.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDeleteAsyncRelativeRetry400Headers.cs index fc54f97d80671..4c1ac5d129b81 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDeleteAsyncRelativeRetry400Headers.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDeleteAsyncRelativeRetry400Headers.cs @@ -39,22 +39,22 @@ public LROSADsDeleteAsyncRelativeRetry400Headers() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/nonretryerror/deleteasync/retry/operationResults/400 /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/nonretryerror/deleteasync/retry/operationResults/400 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeaders.cs index 1c1262eb4bd11..bcb53a47e9945 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeaders.cs @@ -39,20 +39,22 @@ public LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeaders() { } } /// - /// Location to poll for result status: will be set to /foo + /// Gets or sets location to poll for result status: will be set to + /// /foo /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to /foo + /// Gets or sets location to poll for result status: will be set to + /// /foo /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to /bar + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to /bar /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeaders.cs index 2ccbcaf1f68b6..8c30a0a4f97c9 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeaders.cs @@ -40,22 +40,22 @@ public LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/error/deleteasync/retry/failed/operationResults/invalidjsonpolling /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/error/deleteasync/retry/failed/operationResults/invalidjsonpolling /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDeleteAsyncRelativeRetryNoStatusHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDeleteAsyncRelativeRetryNoStatusHeaders.cs index a3b082bc44677..1a6afea5086b7 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDeleteAsyncRelativeRetryNoStatusHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDeleteAsyncRelativeRetryNoStatusHeaders.cs @@ -39,22 +39,22 @@ public LROSADsDeleteAsyncRelativeRetryNoStatusHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/deleteasync/retry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/deleteasync/retry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDeleteNonRetry400Headers.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDeleteNonRetry400Headers.cs index 8388c132dbadb..202e5b5d8b720 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDeleteNonRetry400Headers.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsDeleteNonRetry400Headers.cs @@ -38,15 +38,15 @@ public LROSADsDeleteNonRetry400Headers() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/retryerror/delete/202/retry/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPost202NoLocationHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPost202NoLocationHeaders.cs index d0ff72b0480ad..275c476a53236 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPost202NoLocationHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPost202NoLocationHeaders.cs @@ -38,14 +38,14 @@ public LROSADsPost202NoLocationHeaders() { } } /// - /// Location to poll for result status: will not be set + /// Gets or sets location to poll for result status: will not be set /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPost202NonRetry400Headers.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPost202NonRetry400Headers.cs index 4a631690e2b5d..448c6f2ed5db5 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPost202NonRetry400Headers.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPost202NonRetry400Headers.cs @@ -38,15 +38,15 @@ public LROSADsPost202NonRetry400Headers() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/retryerror/post/202/retry/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPost202RetryInvalidHeaderHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPost202RetryInvalidHeaderHeaders.cs index 8d258cf724680..31373a1d5bc26 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPost202RetryInvalidHeaderHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPost202RetryInvalidHeaderHeaders.cs @@ -38,14 +38,15 @@ public LROSADsPost202RetryInvalidHeaderHeaders() { } } /// - /// Location to poll for result status: will be set to /foo + /// Gets or sets location to poll for result status: will be set to + /// /foo /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to /bar + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to /bar /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPostAsyncRelativeRetry400Headers.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPostAsyncRelativeRetry400Headers.cs index 8b4d91544b02e..0c8e775eb0b59 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPostAsyncRelativeRetry400Headers.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPostAsyncRelativeRetry400Headers.cs @@ -39,22 +39,22 @@ public LROSADsPostAsyncRelativeRetry400Headers() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/nonretryerror/putasync/retry/operationResults/400 /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/nonretryerror/putasync/retry/operationResults/400 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPostAsyncRelativeRetryInvalidHeaderHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPostAsyncRelativeRetryInvalidHeaderHeaders.cs index ff5102bac8892..8b4a8487a6840 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPostAsyncRelativeRetryInvalidHeaderHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPostAsyncRelativeRetryInvalidHeaderHeaders.cs @@ -39,20 +39,20 @@ public LROSADsPostAsyncRelativeRetryInvalidHeaderHeaders() { } } /// - /// Location to poll for result status: will be set to foo + /// Gets or sets location to poll for result status: will be set to foo /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to foo + /// Gets or sets location to poll for result status: will be set to foo /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to /bar + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to /bar /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeaders.cs index 6b33dddde0813..55f40ad33f05d 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeaders.cs @@ -39,22 +39,22 @@ public LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/error/postasync/retry/failed/operationResults/invalidjsonpolling /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/error/postasync/retry/failed/operationResults/invalidjsonpolling /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPostAsyncRelativeRetryNoPayloadHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPostAsyncRelativeRetryNoPayloadHeaders.cs index 6b879e10ce3ce..c5a6c9a6a4b88 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPostAsyncRelativeRetryNoPayloadHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPostAsyncRelativeRetryNoPayloadHeaders.cs @@ -39,22 +39,22 @@ public LROSADsPostAsyncRelativeRetryNoPayloadHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/error/putasync/retry/failed/operationResults/nopayload /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/error/putasync/retry/failed/operationResults/nopayload /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPostNonRetry400Headers.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPostNonRetry400Headers.cs index b84f0a4ab2dae..a063b6ed3c2b3 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPostNonRetry400Headers.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPostNonRetry400Headers.cs @@ -38,15 +38,15 @@ public LROSADsPostNonRetry400Headers() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/retryerror/post/202/retry/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPutAsyncRelativeRetry400Headers.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPutAsyncRelativeRetry400Headers.cs index 4517f177b7c4e..a8fdaaf7b9fdf 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPutAsyncRelativeRetry400Headers.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPutAsyncRelativeRetry400Headers.cs @@ -39,22 +39,22 @@ public LROSADsPutAsyncRelativeRetry400Headers() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/nonretryerror/putasync/retry/operationResults/400 /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/nonretryerror/putasync/retry/operationResults/400 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPutAsyncRelativeRetryInvalidHeaderHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPutAsyncRelativeRetryInvalidHeaderHeaders.cs index 31f90b28d94dd..730e2a89f794b 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPutAsyncRelativeRetryInvalidHeaderHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPutAsyncRelativeRetryInvalidHeaderHeaders.cs @@ -39,22 +39,22 @@ public LROSADsPutAsyncRelativeRetryInvalidHeaderHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/putasync/retry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/putasync/retry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeaders.cs index cca85263d8ad6..0854ea59e12cd 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeaders.cs @@ -39,22 +39,22 @@ public LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/putasync/retry/failed/operationResults/200 /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/putasync/retry/failed/operationResults/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPutAsyncRelativeRetryNoStatusHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPutAsyncRelativeRetryNoStatusHeaders.cs index 5a4aeef323fc4..2d63d0682d5d4 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPutAsyncRelativeRetryNoStatusHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPutAsyncRelativeRetryNoStatusHeaders.cs @@ -39,22 +39,22 @@ public LROSADsPutAsyncRelativeRetryNoStatusHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/putasync/retry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/putasync/retry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPutAsyncRelativeRetryNoStatusPayloadHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPutAsyncRelativeRetryNoStatusPayloadHeaders.cs index d027036126ada..5c75b72ec2e31 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPutAsyncRelativeRetryNoStatusPayloadHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROSADsPutAsyncRelativeRetryNoStatusPayloadHeaders.cs @@ -39,22 +39,22 @@ public LROSADsPutAsyncRelativeRetryNoStatusPayloadHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/putasync/retry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/putasync/retry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsCustomHeaderPost202Retry200Headers.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsCustomHeaderPost202Retry200Headers.cs index 462144eb416ec..ab928a160295a 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsCustomHeaderPost202Retry200Headers.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsCustomHeaderPost202Retry200Headers.cs @@ -38,15 +38,15 @@ public LROsCustomHeaderPost202Retry200Headers() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/customheader/post/202/retry/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsCustomHeaderPostAsyncRetrySucceededHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsCustomHeaderPostAsyncRetrySucceededHeaders.cs index 5a4c1cc9000a0..10a93dfb18dd5 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsCustomHeaderPostAsyncRetrySucceededHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsCustomHeaderPostAsyncRetrySucceededHeaders.cs @@ -39,22 +39,22 @@ public LROsCustomHeaderPostAsyncRetrySucceededHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/customheader/putasync/retry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/customheader/putasync/retry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsCustomHeaderPutAsyncRetrySucceededHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsCustomHeaderPutAsyncRetrySucceededHeaders.cs index 40a58b667514d..66cb66baec84a 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsCustomHeaderPutAsyncRetrySucceededHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsCustomHeaderPutAsyncRetrySucceededHeaders.cs @@ -39,22 +39,22 @@ public LROsCustomHeaderPutAsyncRetrySucceededHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/customheader/putasync/retry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/customheader/putasync/retry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDelete202NoRetry204Headers.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDelete202NoRetry204Headers.cs index 74f325ecf891e..9c1043c99e9c2 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDelete202NoRetry204Headers.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDelete202NoRetry204Headers.cs @@ -38,15 +38,15 @@ public LROsDelete202NoRetry204Headers() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/delete/202/noretry/204 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDelete202Retry200Headers.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDelete202Retry200Headers.cs index 73fec76b069e5..53c58b72c187b 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDelete202Retry200Headers.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDelete202Retry200Headers.cs @@ -38,15 +38,15 @@ public LROsDelete202Retry200Headers() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/delete/202/retry/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteAsyncNoHeaderInRetryHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteAsyncNoHeaderInRetryHeaders.cs index 2be5bc4d04650..71283acb56866 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteAsyncNoHeaderInRetryHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteAsyncNoHeaderInRetryHeaders.cs @@ -37,7 +37,7 @@ public LROsDeleteAsyncNoHeaderInRetryHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/put/noheader/202/204/operationresults /// [JsonProperty(PropertyName = "Location")] diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteAsyncNoRetrySucceededHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteAsyncNoRetrySucceededHeaders.cs index edbb8bacea891..177d0dbd34861 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteAsyncNoRetrySucceededHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteAsyncNoRetrySucceededHeaders.cs @@ -39,22 +39,22 @@ public LROsDeleteAsyncNoRetrySucceededHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/deleteasync/noretry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/deleteasync/noretry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteAsyncRetryFailedHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteAsyncRetryFailedHeaders.cs index f23c19fe68bc5..8f3aebdc781a2 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteAsyncRetryFailedHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteAsyncRetryFailedHeaders.cs @@ -39,22 +39,22 @@ public LROsDeleteAsyncRetryFailedHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/deleteasync/retry/failed/operationResults/200 /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/deleteasync/retry/failed/operationResults/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteAsyncRetrySucceededHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteAsyncRetrySucceededHeaders.cs index be0fa3a4ea8f4..acfd07ed5a1cd 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteAsyncRetrySucceededHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteAsyncRetrySucceededHeaders.cs @@ -39,22 +39,22 @@ public LROsDeleteAsyncRetrySucceededHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/deleteasync/retry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/deleteasync/retry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteAsyncRetrycanceledHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteAsyncRetrycanceledHeaders.cs index ce2675bf5c3d6..a5d86a7f1b956 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteAsyncRetrycanceledHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteAsyncRetrycanceledHeaders.cs @@ -39,22 +39,22 @@ public LROsDeleteAsyncRetrycanceledHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/deleteasync/retry/canceled/operationResults/200 /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/deleteasync/retry/canceled/operationResults/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteNoHeaderInRetryHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteNoHeaderInRetryHeaders.cs index 039a86d9a9f1a..7dc3e9b001a7b 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteNoHeaderInRetryHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteNoHeaderInRetryHeaders.cs @@ -37,7 +37,7 @@ public LROsDeleteNoHeaderInRetryHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/put/noheader/202/204/operationresults /// [JsonProperty(PropertyName = "Location")] diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteProvisioning202Accepted200SucceededHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteProvisioning202Accepted200SucceededHeaders.cs index af5c4ef25cfa3..9902e42b88cd1 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteProvisioning202Accepted200SucceededHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteProvisioning202Accepted200SucceededHeaders.cs @@ -39,15 +39,15 @@ public LROsDeleteProvisioning202Accepted200SucceededHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/delete/provisioning/202/accepted/200/succeeded /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteProvisioning202DeletingFailed200Headers.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteProvisioning202DeletingFailed200Headers.cs index c7cd89096d21e..aacc2cc6d51f1 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteProvisioning202DeletingFailed200Headers.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteProvisioning202DeletingFailed200Headers.cs @@ -38,15 +38,15 @@ public LROsDeleteProvisioning202DeletingFailed200Headers() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/delete/provisioning/202/deleting/200/failed /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteProvisioning202Deletingcanceled200Headers.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteProvisioning202Deletingcanceled200Headers.cs index 0ded45ed5163a..929ce769234e2 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteProvisioning202Deletingcanceled200Headers.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsDeleteProvisioning202Deletingcanceled200Headers.cs @@ -38,15 +38,15 @@ public LROsDeleteProvisioning202Deletingcanceled200Headers() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/delete/provisioning/202/deleting/200/canceled /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPost202NoRetry204Headers.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPost202NoRetry204Headers.cs index 5ee71af14e56e..2b1b350499ac7 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPost202NoRetry204Headers.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPost202NoRetry204Headers.cs @@ -38,15 +38,15 @@ public LROsPost202NoRetry204Headers() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/post/202/noretry/204 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPost202Retry200Headers.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPost202Retry200Headers.cs index 15ec65630416b..ac65636a94e0d 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPost202Retry200Headers.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPost202Retry200Headers.cs @@ -36,15 +36,15 @@ public LROsPost202Retry200Headers() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/post/202/retry/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPostAsyncNoRetrySucceededHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPostAsyncNoRetrySucceededHeaders.cs index b42d705c25373..ecfca7fc20346 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPostAsyncNoRetrySucceededHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPostAsyncNoRetrySucceededHeaders.cs @@ -39,22 +39,22 @@ public LROsPostAsyncNoRetrySucceededHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/putasync/retry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/putasync/retry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPostAsyncRetryFailedHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPostAsyncRetryFailedHeaders.cs index c917433f206d0..075c922deed85 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPostAsyncRetryFailedHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPostAsyncRetryFailedHeaders.cs @@ -39,22 +39,22 @@ public LROsPostAsyncRetryFailedHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/putasync/retry/failed/operationResults/200 /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/putasync/retry/failed/operationResults/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPostAsyncRetrySucceededHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPostAsyncRetrySucceededHeaders.cs index 54b3e15d511b2..c5130f0ffe7d6 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPostAsyncRetrySucceededHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPostAsyncRetrySucceededHeaders.cs @@ -39,22 +39,22 @@ public LROsPostAsyncRetrySucceededHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/putasync/retry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/putasync/retry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPostAsyncRetrycanceledHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPostAsyncRetrycanceledHeaders.cs index 0b4068d4ec5ed..a55f69e4730e4 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPostAsyncRetrycanceledHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPostAsyncRetrycanceledHeaders.cs @@ -39,22 +39,22 @@ public LROsPostAsyncRetrycanceledHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/putasync/retry/canceled/operationResults/200 /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/putasync/retry/canceled/operationResults/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPutAsyncNoRetrySucceededHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPutAsyncNoRetrySucceededHeaders.cs index 517418b91e280..b33f4f7df5d1f 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPutAsyncNoRetrySucceededHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPutAsyncNoRetrySucceededHeaders.cs @@ -38,14 +38,14 @@ public LROsPutAsyncNoRetrySucceededHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/putasync/noretry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/putasync/noretry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Location")] diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPutAsyncNoRetrycanceledHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPutAsyncNoRetrycanceledHeaders.cs index d2d6debcc6834..4c8bd617507b3 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPutAsyncNoRetrycanceledHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPutAsyncNoRetrycanceledHeaders.cs @@ -38,14 +38,14 @@ public LROsPutAsyncNoRetrycanceledHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/putasync/noretry/canceled/operationResults/200 /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/putasync/noretry/canceled/operationResults/200 /// [JsonProperty(PropertyName = "Location")] diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPutAsyncRetryFailedHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPutAsyncRetryFailedHeaders.cs index d4d12deacaf96..c840b00f06da1 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPutAsyncRetryFailedHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPutAsyncRetryFailedHeaders.cs @@ -39,22 +39,22 @@ public LROsPutAsyncRetryFailedHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/putasync/retry/failed/operationResults/200 /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/putasync/retry/failed/operationResults/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPutAsyncRetrySucceededHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPutAsyncRetrySucceededHeaders.cs index 3b09b57d0c161..b6b88a22380cd 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPutAsyncRetrySucceededHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPutAsyncRetrySucceededHeaders.cs @@ -39,22 +39,22 @@ public LROsPutAsyncRetrySucceededHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/putasync/retry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation { get; set; } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/putasync/retry/succeeded/operationResults/200 /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Number of milliseconds until the next poll should be sent, will be - /// set to zero + /// Gets or sets number of milliseconds until the next poll should be + /// sent, will be set to zero /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPutNoHeaderInRetryHeaders.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPutNoHeaderInRetryHeaders.cs index 66cec59294444..e0bbd41f30034 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPutNoHeaderInRetryHeaders.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/LROsPutNoHeaderInRetryHeaders.cs @@ -37,7 +37,7 @@ public LROsPutNoHeaderInRetryHeaders() { } } /// - /// Location to poll for result status: will be set to + /// Gets or sets location to poll for result status: will be set to /// /lro/putasync/noheader/202/200/operationResults /// [JsonProperty(PropertyName = "location")] diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/OperationResult.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/OperationResult.cs index 644400aec8bae..ac96c786203b9 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/OperationResult.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/OperationResult.cs @@ -33,9 +33,9 @@ public OperationResult() { } } /// - /// The status of the request. Possible values include: 'Succeeded', - /// 'Failed', 'canceled', 'Accepted', 'Creating', 'Created', - /// 'Updating', 'Updated', 'Deleting', 'Deleted', 'OK' + /// Gets or sets the status of the request. Possible values include: + /// 'Succeeded', 'Failed', 'canceled', 'Accepted', 'Creating', + /// 'Created', 'Updating', 'Updated', 'Deleting', 'Deleted', 'OK' /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/OperationResultError.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/OperationResultError.cs index e215156e349d1..879bd79f188ef 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/OperationResultError.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/OperationResultError.cs @@ -33,13 +33,13 @@ public OperationResultError() { } } /// - /// The error code for an operation failure + /// Gets or sets the error code for an operation failure /// [JsonProperty(PropertyName = "code")] public int? Code { get; set; } /// - /// The detailed arror message + /// Gets or sets the detailed arror message /// [JsonProperty(PropertyName = "message")] public string Message { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/Product.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/Product.cs index 989a0ca86de57..aa45a2ce75f42 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/Product.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/Product.cs @@ -40,7 +40,7 @@ public Product() { } public string ProvisioningState { get; set; } /// - /// Possible values include: 'Succeeded', 'Failed', 'canceled', + /// Gets possible values include: 'Succeeded', 'Failed', 'canceled', /// 'Accepted', 'Creating', 'Created', 'Updating', 'Updated', /// 'Deleting', 'Deleted', 'OK' /// diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/Resource.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/Resource.cs index f723039e2ea2a..ccedfcfae70c4 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/Resource.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/Resource.cs @@ -36,13 +36,13 @@ public Resource() { } } /// - /// Resource Id + /// Gets resource Id /// [JsonProperty(PropertyName = "id")] public string Id { get; private set; } /// - /// Resource Type + /// Gets resource Type /// [JsonProperty(PropertyName = "type")] public string Type { get; private set; } @@ -53,13 +53,13 @@ public Resource() { } public IDictionary Tags { get; set; } /// - /// Resource Location + /// Gets or sets resource Location /// [JsonProperty(PropertyName = "location")] public string Location { get; set; } /// - /// Resource Name + /// Gets resource Name /// [JsonProperty(PropertyName = "name")] public string Name { get; private set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/SubProduct.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/SubProduct.cs index 3e2dfb91369cd..838d1be2a237a 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/SubProduct.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/SubProduct.cs @@ -40,7 +40,7 @@ public SubProduct() { } public string ProvisioningState { get; set; } /// - /// Possible values include: 'Succeeded', 'Failed', 'canceled', + /// Gets possible values include: 'Succeeded', 'Failed', 'canceled', /// 'Accepted', 'Creating', 'Created', 'Updating', 'Updated', /// 'Deleting', 'Deleted', 'OK' /// diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/SubResource.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/SubResource.cs index a41dc0dd848fe..55a46212dfea1 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/SubResource.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Lro/Models/SubResource.cs @@ -32,7 +32,7 @@ public SubResource() { } } /// - /// Sub Resource Id + /// Gets sub Resource Id /// [JsonProperty(PropertyName = "id")] public string Id { get; private set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/Models/OperationResult.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/Models/OperationResult.cs index 584dc52c773b4..69a3704652479 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/Models/OperationResult.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/Models/OperationResult.cs @@ -32,9 +32,9 @@ public OperationResult() { } } /// - /// The status of the request. Possible values include: 'Succeeded', - /// 'Failed', 'canceled', 'Accepted', 'Creating', 'Created', - /// 'Updating', 'Updated', 'Deleting', 'Deleted', 'OK' + /// Gets or sets the status of the request. Possible values include: + /// 'Succeeded', 'Failed', 'canceled', 'Accepted', 'Creating', + /// 'Created', 'Updating', 'Updated', 'Deleting', 'Deleted', 'OK' /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/Models/PagingGetMultiplePagesOptions.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/Models/PagingGetMultiplePagesOptions.cs index 3b1227cd3b0f5..cd420389a93e4 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/Models/PagingGetMultiplePagesOptions.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/Models/PagingGetMultiplePagesOptions.cs @@ -17,7 +17,7 @@ namespace Fixtures.Azure.AcceptanceTestsPaging.Models using Microsoft.Rest.Azure; /// - /// Additional parameters for the getMultiplePages operation. + /// Additional parameters for one or more operations /// public partial class PagingGetMultiplePagesOptions { @@ -38,14 +38,15 @@ public PagingGetMultiplePagesOptions() { } } /// - /// Sets the maximum number of items to return in the response. + /// Gets or sets sets the maximum number of items to return in the + /// response. /// [JsonProperty(PropertyName = "")] public int? Maxresults { get; set; } /// - /// Sets the maximum time that the server can spend processing the - /// request, in seconds. The default is 30 seconds. + /// Gets or sets sets the maximum time that the server can spend + /// processing the request, in seconds. The default is 30 seconds. /// [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/Models/PagingGetMultiplePagesWithOffsetNextOptions.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/Models/PagingGetMultiplePagesWithOffsetNextOptions.cs index 78992ebfb834e..13885d8129848 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/Models/PagingGetMultiplePagesWithOffsetNextOptions.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/Models/PagingGetMultiplePagesWithOffsetNextOptions.cs @@ -38,14 +38,15 @@ public PagingGetMultiplePagesWithOffsetNextOptions() { } } /// - /// Sets the maximum number of items to return in the response. + /// Gets or sets sets the maximum number of items to return in the + /// response. /// [JsonProperty(PropertyName = "")] public int? Maxresults { get; set; } /// - /// Sets the maximum time that the server can spend processing the - /// request, in seconds. The default is 30 seconds. + /// Gets or sets sets the maximum time that the server can spend + /// processing the request, in seconds. The default is 30 seconds. /// [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/Models/PagingGetMultiplePagesWithOffsetOptions.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/Models/PagingGetMultiplePagesWithOffsetOptions.cs index e4c74a8e57a6e..91c7ecd834f40 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/Models/PagingGetMultiplePagesWithOffsetOptions.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/Models/PagingGetMultiplePagesWithOffsetOptions.cs @@ -17,7 +17,7 @@ namespace Fixtures.Azure.AcceptanceTestsPaging.Models using Microsoft.Rest.Azure; /// - /// Additional parameters for the getMultiplePagesWithOffset operation. + /// Additional parameters for one or more operations /// public partial class PagingGetMultiplePagesWithOffsetOptions { @@ -39,20 +39,21 @@ public PagingGetMultiplePagesWithOffsetOptions() { } } /// - /// Sets the maximum number of items to return in the response. + /// Gets or sets sets the maximum number of items to return in the + /// response. /// [JsonProperty(PropertyName = "")] public int? Maxresults { get; set; } /// - /// Offset of return value + /// Gets or sets offset of return value /// [JsonProperty(PropertyName = "")] public int Offset { get; set; } /// - /// Sets the maximum time that the server can spend processing the - /// request, in seconds. The default is 30 seconds. + /// Gets or sets sets the maximum time that the server can spend + /// processing the request, in seconds. The default is 30 seconds. /// [JsonProperty(PropertyName = "")] public int? Timeout { get; set; } diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/SubscriptionIdApiVersion/Models/SampleResourceGroup.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/SubscriptionIdApiVersion/Models/SampleResourceGroup.cs index 4b1187cae87dd..6ce67ca345a8b 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/SubscriptionIdApiVersion/Models/SampleResourceGroup.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/SubscriptionIdApiVersion/Models/SampleResourceGroup.cs @@ -33,13 +33,13 @@ public SampleResourceGroup() { } } /// - /// resource group name 'testgroup101' + /// Gets or sets resource group name 'testgroup101' /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// resource group location 'West US' + /// Gets or sets resource group location 'West US' /// [JsonProperty(PropertyName = "location")] public string Location { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyComplex/Models/Basic.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyComplex/Models/Basic.cs index 37a8fff6fc165..be0b4041263e4 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyComplex/Models/Basic.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/BodyComplex/Models/Basic.cs @@ -43,7 +43,8 @@ public Basic() { } public string Name { get; set; } /// - /// Possible values include: 'cyan', 'Magenta', 'YELLOW', 'blacK' + /// Gets or sets possible values include: 'cyan', 'Magenta', 'YELLOW', + /// 'blacK' /// [JsonProperty(PropertyName = "color")] public string Color { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseBoolHeaders.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseBoolHeaders.cs index 54bb390e7cb96..3461139acef89 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseBoolHeaders.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseBoolHeaders.cs @@ -34,7 +34,7 @@ public HeaderResponseBoolHeaders() { } } /// - /// response with header value "value": true or false + /// Gets or sets response with header value "value": true or false /// [JsonProperty(PropertyName = "value")] public bool? Value { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseByteHeaders.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseByteHeaders.cs index 1119ed4d030a1..742bece92143d 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseByteHeaders.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseByteHeaders.cs @@ -34,7 +34,7 @@ public HeaderResponseByteHeaders() { } } /// - /// response with header values "啊齄丂狛狜隣郎隣兀﨩" + /// Gets or sets response with header values "啊齄丂狛狜隣郎隣兀﨩" /// [JsonProperty(PropertyName = "value")] public byte[] Value { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseDateHeaders.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseDateHeaders.cs index 0cb1bd745fb51..e00cbc09557f9 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseDateHeaders.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseDateHeaders.cs @@ -34,7 +34,8 @@ public HeaderResponseDateHeaders() { } } /// - /// response with header values "2010-01-01" or "0001-01-01" + /// Gets or sets response with header values "2010-01-01" or + /// "0001-01-01" /// [JsonConverter(typeof(DateJsonConverter))] [JsonProperty(PropertyName = "value")] diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseDatetimeHeaders.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseDatetimeHeaders.cs index 8215b0ae1c617..cffbd3421661b 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseDatetimeHeaders.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseDatetimeHeaders.cs @@ -36,7 +36,7 @@ public HeaderResponseDatetimeHeaders() { } } /// - /// response with header values "2010-01-01T12:34:56Z" or + /// Gets or sets response with header values "2010-01-01T12:34:56Z" or /// "0001-01-01T00:00:00Z" /// [JsonProperty(PropertyName = "value")] diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseDatetimeRfc1123Headers.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseDatetimeRfc1123Headers.cs index 124f599f9ba0d..f188e986ab6b5 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseDatetimeRfc1123Headers.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseDatetimeRfc1123Headers.cs @@ -36,8 +36,8 @@ public HeaderResponseDatetimeRfc1123Headers() { } } /// - /// response with header values "Wed, 01 Jan 2010 12:34:56 GMT" or - /// "Mon, 01 Jan 0001 00:00:00 GMT" + /// Gets or sets response with header values "Wed, 01 Jan 2010 + /// 12:34:56 GMT" or "Mon, 01 Jan 0001 00:00:00 GMT" /// [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] [JsonProperty(PropertyName = "value")] diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseDoubleHeaders.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseDoubleHeaders.cs index 104620a950907..e34f3b911d504 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseDoubleHeaders.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseDoubleHeaders.cs @@ -36,7 +36,7 @@ public HeaderResponseDoubleHeaders() { } } /// - /// response with header value "value": 7e120 or -3.0 + /// Gets or sets response with header value "value": 7e120 or -3.0 /// [JsonProperty(PropertyName = "value")] public double? Value { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseDurationHeaders.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseDurationHeaders.cs index 71f279990a846..2795657f73e3f 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseDurationHeaders.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseDurationHeaders.cs @@ -36,7 +36,7 @@ public HeaderResponseDurationHeaders() { } } /// - /// response with header values "P123DT22H14M12.011S" + /// Gets or sets response with header values "P123DT22H14M12.011S" /// [JsonProperty(PropertyName = "value")] public TimeSpan? Value { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseEnumHeaders.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseEnumHeaders.cs index 06092074d54e8..f955fca276f99 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseEnumHeaders.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseEnumHeaders.cs @@ -34,7 +34,7 @@ public HeaderResponseEnumHeaders() { } } /// - /// response with header values "GREY" or null + /// Gets or sets response with header values "GREY" or null /// [JsonProperty(PropertyName = "value")] public GreyscaleColors? Value { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseExistingKeyHeaders.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseExistingKeyHeaders.cs index 344136218eec5..42a5c1aeda709 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseExistingKeyHeaders.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseExistingKeyHeaders.cs @@ -36,7 +36,7 @@ public HeaderResponseExistingKeyHeaders() { } } /// - /// response with header value "User-Agent": "overwrite" + /// Gets or sets response with header value "User-Agent": "overwrite" /// [JsonProperty(PropertyName = "User-Agent")] public string UserAgent { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseFloatHeaders.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseFloatHeaders.cs index 987718bad93bb..6e5353a3fcaeb 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseFloatHeaders.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseFloatHeaders.cs @@ -34,7 +34,7 @@ public HeaderResponseFloatHeaders() { } } /// - /// response with header value "value": 0.07 or -3.0 + /// Gets or sets response with header value "value": 0.07 or -3.0 /// [JsonProperty(PropertyName = "value")] public double? Value { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseIntegerHeaders.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseIntegerHeaders.cs index 28d60394d0b77..3ce8bd066a79f 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseIntegerHeaders.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseIntegerHeaders.cs @@ -36,7 +36,7 @@ public HeaderResponseIntegerHeaders() { } } /// - /// response with header value "value": 1 or -2 + /// Gets or sets response with header value "value": 1 or -2 /// [JsonProperty(PropertyName = "value")] public int? Value { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseLongHeaders.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseLongHeaders.cs index cf9efd1fe838e..6e15f2eecc4a1 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseLongHeaders.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseLongHeaders.cs @@ -34,7 +34,7 @@ public HeaderResponseLongHeaders() { } } /// - /// response with header value "value": 105 or -2 + /// Gets or sets response with header value "value": 105 or -2 /// [JsonProperty(PropertyName = "value")] public long? Value { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseProtectedKeyHeaders.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseProtectedKeyHeaders.cs index abb1464ad445d..7adbdf29bebfa 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseProtectedKeyHeaders.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseProtectedKeyHeaders.cs @@ -36,7 +36,7 @@ public HeaderResponseProtectedKeyHeaders() { } } /// - /// response with header value "Content-Type": "text/html" + /// Gets or sets response with header value "Content-Type": "text/html" /// [JsonProperty(PropertyName = "Content-Type")] public string ContentType { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseStringHeaders.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseStringHeaders.cs index 7184a38f5c59a..0744f2115b545 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseStringHeaders.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Header/Models/HeaderResponseStringHeaders.cs @@ -36,8 +36,8 @@ public HeaderResponseStringHeaders() { } } /// - /// response with header values "The quick brown fox jumps over the - /// lazy dog" or null or "" + /// Gets or sets response with header values "The quick brown fox + /// jumps over the lazy dog" or null or "" /// [JsonProperty(PropertyName = "value")] public string Value { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsDelete307Headers.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsDelete307Headers.cs index cbf7865f2726d..999dd9f164742 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsDelete307Headers.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsDelete307Headers.cs @@ -36,7 +36,7 @@ public HttpRedirectsDelete307Headers() { } } /// - /// The redirect location for this request + /// Gets or sets the redirect location for this request /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsGet300Headers.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsGet300Headers.cs index d14c5fc870c9f..ad0dacb9d1aaa 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsGet300Headers.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsGet300Headers.cs @@ -34,7 +34,7 @@ public HttpRedirectsGet300Headers() { } } /// - /// The redirect location for this request + /// Gets or sets the redirect location for this request /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsGet301Headers.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsGet301Headers.cs index 70432eae09b3e..2a543db3975b1 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsGet301Headers.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsGet301Headers.cs @@ -34,7 +34,7 @@ public HttpRedirectsGet301Headers() { } } /// - /// The redirect location for this request + /// Gets or sets the redirect location for this request /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsGet302Headers.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsGet302Headers.cs index 22bc242974d1e..59b857904134b 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsGet302Headers.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsGet302Headers.cs @@ -34,7 +34,7 @@ public HttpRedirectsGet302Headers() { } } /// - /// The redirect location for this request + /// Gets or sets the redirect location for this request /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsGet307Headers.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsGet307Headers.cs index 7eb98fab6bef3..73111e08f2591 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsGet307Headers.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsGet307Headers.cs @@ -34,7 +34,7 @@ public HttpRedirectsGet307Headers() { } } /// - /// The redirect location for this request + /// Gets or sets the redirect location for this request /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsHead300Headers.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsHead300Headers.cs index 5f32659b21b54..3970436db87b0 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsHead300Headers.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsHead300Headers.cs @@ -36,7 +36,7 @@ public HttpRedirectsHead300Headers() { } } /// - /// The redirect location for this request + /// Gets or sets the redirect location for this request /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsHead301Headers.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsHead301Headers.cs index af9b0310e5bc4..aed6cb6c515d5 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsHead301Headers.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsHead301Headers.cs @@ -36,7 +36,7 @@ public HttpRedirectsHead301Headers() { } } /// - /// The redirect location for this request + /// Gets or sets the redirect location for this request /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsHead302Headers.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsHead302Headers.cs index 2f1ed670c469e..797193619a8de 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsHead302Headers.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsHead302Headers.cs @@ -36,7 +36,7 @@ public HttpRedirectsHead302Headers() { } } /// - /// The redirect location for this request + /// Gets or sets the redirect location for this request /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsHead307Headers.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsHead307Headers.cs index b1ad99069c7cb..dd01aa2366771 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsHead307Headers.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsHead307Headers.cs @@ -36,7 +36,7 @@ public HttpRedirectsHead307Headers() { } } /// - /// The redirect location for this request + /// Gets or sets the redirect location for this request /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsPatch302Headers.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsPatch302Headers.cs index 5dfe6e3e5290e..8178b6f377ec0 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsPatch302Headers.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsPatch302Headers.cs @@ -36,7 +36,7 @@ public HttpRedirectsPatch302Headers() { } } /// - /// The redirect location for this request + /// Gets or sets the redirect location for this request /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsPatch307Headers.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsPatch307Headers.cs index 19973f88ef893..d94f9c8ac7785 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsPatch307Headers.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsPatch307Headers.cs @@ -36,7 +36,7 @@ public HttpRedirectsPatch307Headers() { } } /// - /// The redirect location for this request + /// Gets or sets the redirect location for this request /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsPost303Headers.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsPost303Headers.cs index 8036c76d9716c..9f6ac7869584a 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsPost303Headers.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsPost303Headers.cs @@ -36,7 +36,7 @@ public HttpRedirectsPost303Headers() { } } /// - /// The redirect location for this request + /// Gets or sets the redirect location for this request /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsPost307Headers.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsPost307Headers.cs index 59c68c116bea0..3f6ee41fd2e46 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsPost307Headers.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsPost307Headers.cs @@ -36,7 +36,7 @@ public HttpRedirectsPost307Headers() { } } /// - /// The redirect location for this request + /// Gets or sets the redirect location for this request /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsPut301Headers.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsPut301Headers.cs index e48732af63bea..3eb3f2fe37f13 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsPut301Headers.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsPut301Headers.cs @@ -34,7 +34,7 @@ public HttpRedirectsPut301Headers() { } } /// - /// The redirect location for this request + /// Gets or sets the redirect location for this request /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsPut307Headers.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsPut307Headers.cs index f3148bff9a057..a4cbbc843f10c 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsPut307Headers.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Http/Models/HttpRedirectsPut307Headers.cs @@ -34,7 +34,7 @@ public HttpRedirectsPut307Headers() { } } /// - /// The redirect location for this request + /// Gets or sets the redirect location for this request /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/BaseProduct.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/BaseProduct.cs index 40511ce7b4474..3615d58922019 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/BaseProduct.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/BaseProduct.cs @@ -35,15 +35,16 @@ public BaseProduct() { } } /// - /// Unique identifier representing a specific product for a given - /// latitude & longitude. For example, uberX in San Francisco - /// will have a different product_id than uberX in Los Angeles. + /// Gets or sets unique identifier representing a specific product for + /// a given latitude & longitude. For example, uberX in San + /// Francisco will have a different product_id than uberX in Los + /// Angeles. /// [JsonProperty(PropertyName = "base_product_id")] public string ProductId { get; set; } /// - /// Description of product. + /// Gets or sets description of product. /// [JsonProperty(PropertyName = "base_product_description")] public string Description { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/FlattenParameterGroup.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/FlattenParameterGroup.cs index db9785813c55c..b80bf2fa6210d 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/FlattenParameterGroup.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/FlattenParameterGroup.cs @@ -16,7 +16,7 @@ namespace Fixtures.AcceptanceTestsModelFlattening.Models using Microsoft.Rest.Serialization; /// - /// Additional parameters for the putSimpleProductWithGrouping operation. + /// Additional parameters for one or more operations /// [JsonTransformation] public partial class FlattenParameterGroup @@ -40,39 +40,40 @@ public FlattenParameterGroup() { } } /// - /// Product name with value 'groupproduct' + /// Gets or sets product name with value 'groupproduct' /// [JsonProperty(PropertyName = "")] public string Name { get; set; } /// - /// Unique identifier representing a specific product for a given - /// latitude & longitude. For example, uberX in San Francisco - /// will have a different product_id than uberX in Los Angeles. + /// Gets or sets unique identifier representing a specific product for + /// a given latitude & longitude. For example, uberX in San + /// Francisco will have a different product_id than uberX in Los + /// Angeles. /// [JsonProperty(PropertyName = "")] public string ProductId { get; set; } /// - /// Description of product. + /// Gets or sets description of product. /// [JsonProperty(PropertyName = "")] public string Description { get; set; } /// - /// Display name of product. + /// Gets or sets display name of product. /// [JsonProperty(PropertyName = "")] public string MaxProductDisplayName { get; set; } /// - /// Generic URL value. + /// Gets or sets generic URL value. /// [JsonProperty(PropertyName = "")] public string GenericValue { get; set; } /// - /// URL value. + /// Gets or sets URL value. /// [JsonProperty(PropertyName = "")] public string Odatavalue { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/FlattenedProduct.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/FlattenedProduct.cs index 9c7cb37c74d13..415f53a6e3dfd 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/FlattenedProduct.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/FlattenedProduct.cs @@ -46,7 +46,7 @@ public FlattenedProduct() { } public string FlattenedProductType { get; set; } /// - /// Possible values include: 'Succeeded', 'Failed', 'canceled', + /// Gets possible values include: 'Succeeded', 'Failed', 'canceled', /// 'Accepted', 'Creating', 'Created', 'Updating', 'Updated', /// 'Deleting', 'Deleted', 'OK' /// diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/GenericUrl.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/GenericUrl.cs index 309028eb12669..2022f0d0a073c 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/GenericUrl.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/GenericUrl.cs @@ -34,7 +34,7 @@ public GenericUrl() { } } /// - /// Generic URL value. + /// Gets or sets generic URL value. /// [JsonProperty(PropertyName = "generic_value")] public string GenericValue { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/Resource.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/Resource.cs index a43c4e5d5a21e..5679632fe9533 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/Resource.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/Resource.cs @@ -35,13 +35,13 @@ public Resource() { } } /// - /// Resource Id + /// Gets resource Id /// [JsonProperty(PropertyName = "id")] public string Id { get; private set; } /// - /// Resource Type + /// Gets resource Type /// [JsonProperty(PropertyName = "type")] public string Type { get; private set; } @@ -52,13 +52,13 @@ public Resource() { } public IDictionary Tags { get; set; } /// - /// Resource Location + /// Gets or sets resource Location /// [JsonProperty(PropertyName = "location")] public string Location { get; set; } /// - /// Resource Name + /// Gets resource Name /// [JsonProperty(PropertyName = "name")] public string Name { get; private set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/SimpleProduct.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/SimpleProduct.cs index 5ee2fa897a5ea..4ae8f66017f6c 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/SimpleProduct.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/SimpleProduct.cs @@ -45,19 +45,19 @@ static SimpleProduct() } /// - /// Display name of product. + /// Gets or sets display name of product. /// [JsonProperty(PropertyName = "details.max_product_display_name")] public string MaxProductDisplayName { get; set; } /// - /// Generic URL value. + /// Gets or sets generic URL value. /// [JsonProperty(PropertyName = "details.max_product_image.generic_value")] public string GenericValue { get; set; } /// - /// URL value. + /// Gets or sets URL value. /// [JsonProperty(PropertyName = "details.max_product_image.@odata\\.value")] public string Odatavalue { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Validation/Models/ChildProduct.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Validation/Models/ChildProduct.cs index 07e06b7a22d11..be6803337118d 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Validation/Models/ChildProduct.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Validation/Models/ChildProduct.cs @@ -41,7 +41,7 @@ static ChildProduct() } /// - /// Count + /// Gets or sets count /// [JsonProperty(PropertyName = "count")] public int? Count { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Validation/Models/Product.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Validation/Models/Product.cs index 09addd8369ff8..e434110c5df7d 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Validation/Models/Product.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/Validation/Models/Product.cs @@ -51,19 +51,20 @@ static Product() } /// - /// Non required array of unique items from 0 to 6 elements. + /// Gets or sets non required array of unique items from 0 to 6 + /// elements. /// [JsonProperty(PropertyName = "display_names")] public IList DisplayNames { get; set; } /// - /// Non required int betwen 0 and 100 exclusive. + /// Gets or sets non required int betwen 0 and 100 exclusive. /// [JsonProperty(PropertyName = "capacity")] public int? Capacity { get; set; } /// - /// Image URL representing the product. + /// Gets or sets image URL representing the product. /// [JsonProperty(PropertyName = "image")] public string Image { get; set; } @@ -74,7 +75,7 @@ static Product() public ChildProduct Child { get; set; } /// - /// Constant string as Enum. Possible values include: + /// Gets or sets constant string as Enum. Possible values include: /// 'constant_string_as_enum' /// [JsonProperty(PropertyName = "constStringAsEnum")] diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/Animal.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/Animal.cs index f473ba11c0c73..ff20c9b53490f 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/Animal.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/Animal.cs @@ -32,13 +32,13 @@ public Animal() { } } /// - /// Id. + /// Gets or sets id. /// [JsonProperty(PropertyName = "id")] public string Id { get; set; } /// - /// Description of a Animal. + /// Gets or sets description of a Animal. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/BaseCat.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/BaseCat.cs index d789e963ce3e7..1504a551144a8 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/BaseCat.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/BaseCat.cs @@ -32,7 +32,7 @@ public BaseCat() { } } /// - /// cat color + /// Gets or sets cat color /// [JsonProperty(PropertyName = "color")] public string Color { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/BurmeseCat.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/BurmeseCat.cs index 9afcdd57e4274..b815f2c67c76e 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/BurmeseCat.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/BurmeseCat.cs @@ -32,7 +32,7 @@ public BurmeseCat() { } } /// - /// cat nick name + /// Gets or sets cat nick name /// [JsonProperty(PropertyName = "nickName")] public int? NickName { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/Doggy.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/Doggy.cs index ef0ad5d1d7a75..0572ac24c447f 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/Doggy.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/Doggy.cs @@ -32,7 +32,7 @@ public Doggy() { } } /// - /// dog name + /// Gets or sets dog name /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/HimalayanCat.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/HimalayanCat.cs index d8f3b45767b92..5d175e80804a1 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/HimalayanCat.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/HimalayanCat.cs @@ -32,7 +32,7 @@ public HimalayanCat() { } } /// - /// cat hair length + /// Gets or sets cat hair length /// [JsonProperty(PropertyName = "hairLength")] public int? HairLength { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/Horsey.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/Horsey.cs index 7bfdbd57709fc..144bf308611f6 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/Horsey.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/Horsey.cs @@ -32,7 +32,7 @@ public Horsey() { } } /// - /// horse breed + /// Gets or sets horse breed /// [JsonProperty(PropertyName = "breed")] public string Breed { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/PersianCat.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/PersianCat.cs index fc5c99d0eebb3..26ff193a73afc 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/PersianCat.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/PersianCat.cs @@ -32,7 +32,7 @@ public PersianCat() { } } /// - /// cat size + /// Gets or sets cat size /// [JsonProperty(PropertyName = "size")] public int? Size { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/SiameseCat.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/SiameseCat.cs index 17ba85a1781b1..fbaf9b7ecdaef 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/SiameseCat.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Polymorphic/Models/SiameseCat.cs @@ -32,7 +32,7 @@ public SiameseCat() { } } /// - /// cat length + /// Gets or sets cat length /// [JsonProperty(PropertyName = "length")] public int? Length { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Primitives/Models/Product.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Primitives/Models/Product.cs index d2ea149e267a9..fcb542d7165ed 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Primitives/Models/Product.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.Primitives/Models/Product.cs @@ -108,7 +108,7 @@ public Product() { } public Guid? Uuid { get; set; } /// - /// Possible values include: 'red', 'blue', 'green' + /// Gets or sets possible values include: 'red', 'blue', 'green' /// [JsonProperty(PropertyName = "enum")] public string EnumProperty { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.RecursiveTypes/Models/Product.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.RecursiveTypes/Models/Product.cs index 3757ada79d8f7..5752acc51ef91 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.RecursiveTypes/Models/Product.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Mirror.RecursiveTypes/Models/Product.cs @@ -33,9 +33,10 @@ public Product() { } } /// - /// Unique identifier representing a specific product for a given - /// latitude & longitude. For example, uberX in San Francisco - /// will have a different product_id than uberX in Los Angeles. + /// Gets or sets unique identifier representing a specific product for + /// a given latitude & longitude. For example, uberX in San + /// Francisco will have a different product_id than uberX in Los + /// Angeles. /// [JsonProperty(PropertyName = "product_id")] public string ProductId { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2/Models/LoginUserHeaders.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2/Models/LoginUserHeaders.cs index 1402f6a440cc7..295f1137f2e98 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2/Models/LoginUserHeaders.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2/Models/LoginUserHeaders.cs @@ -35,13 +35,13 @@ public LoginUserHeaders() { } } /// - /// calls per hour allowed by the user + /// Gets or sets calls per hour allowed by the user /// [JsonProperty(PropertyName = "X-Rate-Limit")] public int? XRateLimit { get; set; } /// - /// date in UTC when toekn expires + /// Gets or sets date in UTC when toekn expires /// [JsonProperty(PropertyName = "X-Expires-After")] public DateTime? XExpiresAfter { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2/Models/Order.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2/Models/Order.cs index c4823360b919f..fab6f61cc6cc3 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2/Models/Order.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2/Models/Order.cs @@ -56,8 +56,8 @@ public Order() { } public DateTime? ShipDate { get; set; } /// - /// Order Status. Possible values include: 'placed', 'approved', - /// 'delivered' + /// Gets or sets order Status. Possible values include: 'placed', + /// 'approved', 'delivered' /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2/Models/Pet.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2/Models/Pet.cs index 5cf3bf826766e..176ac348f7598 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2/Models/Pet.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2/Models/Pet.cs @@ -79,8 +79,8 @@ public Pet() { } public IDictionary Dictionary { get; set; } /// - /// pet status in the store. Possible values include: 'available', - /// 'pending', 'sold' + /// Gets or sets pet status in the store. Possible values include: + /// 'available', 'pending', 'sold' /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2/Models/User.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2/Models/User.cs index 9e770d05cc329..26aa7a291ee10 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2/Models/User.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2/Models/User.cs @@ -73,7 +73,7 @@ public User() { } public string Phone { get; set; } /// - /// User Status + /// Gets or sets user Status /// [JsonProperty(PropertyName = "userStatus")] public int? UserStatus { get; set; } diff --git a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/FirstParameterGroup.java b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/FirstParameterGroup.java index 714247eeb7969..11a3b19314227 100644 --- a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/FirstParameterGroup.java +++ b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/FirstParameterGroup.java @@ -13,7 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Additional parameters for the postMultiParamGroups operation. + * Additional parameters for one or more operations. */ public class FirstParameterGroup { /** diff --git a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostMultiParamGroupsSecondParamGroup.java b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostMultiParamGroupsSecondParamGroup.java index c44445601ac69..62b198e1819b3 100644 --- a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostMultiParamGroupsSecondParamGroup.java +++ b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostMultiParamGroupsSecondParamGroup.java @@ -13,7 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Additional parameters for the postMultiParamGroups operation. + * Additional parameters for one or more operations. */ public class ParameterGroupingPostMultiParamGroupsSecondParamGroup { /** diff --git a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostOptionalParameters.java b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostOptionalParameters.java index 641ac92c6ad07..ca1acfaa80941 100644 --- a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostOptionalParameters.java +++ b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostOptionalParameters.java @@ -13,7 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Additional parameters for the postOptional operation. + * Additional parameters for one or more operations. */ public class ParameterGroupingPostOptionalParameters { /** diff --git a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostRequiredParameters.java b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostRequiredParameters.java index c038b22f59d50..729b020e4dfbf 100644 --- a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostRequiredParameters.java +++ b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostRequiredParameters.java @@ -13,7 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Additional parameters for the postRequired operation. + * Additional parameters for one or more operations. */ public class ParameterGroupingPostRequiredParameters { /** diff --git a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/paging/models/PagingGetMultiplePagesOptions.java b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/paging/models/PagingGetMultiplePagesOptions.java index 6f61d486bb090..c00d7b13f0370 100644 --- a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/paging/models/PagingGetMultiplePagesOptions.java +++ b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/paging/models/PagingGetMultiplePagesOptions.java @@ -13,7 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Additional parameters for the getMultiplePages operation. + * Additional parameters for one or more operations. */ public class PagingGetMultiplePagesOptions { /** diff --git a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/paging/models/PagingGetMultiplePagesWithOffsetOptions.java b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/paging/models/PagingGetMultiplePagesWithOffsetOptions.java index 5827dbdd2d3a4..d2c8350978d67 100644 --- a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/paging/models/PagingGetMultiplePagesWithOffsetOptions.java +++ b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/paging/models/PagingGetMultiplePagesWithOffsetOptions.java @@ -13,7 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Additional parameters for the getMultiplePagesWithOffset operation. + * Additional parameters for one or more operations. */ public class PagingGetMultiplePagesWithOffsetOptions { /** diff --git a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/modelflattening/models/FlattenParameterGroup.java b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/modelflattening/models/FlattenParameterGroup.java index 342b622a71f03..557060fba52c1 100644 --- a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/modelflattening/models/FlattenParameterGroup.java +++ b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/modelflattening/models/FlattenParameterGroup.java @@ -14,7 +14,7 @@ import com.microsoft.rest.serializer.JsonFlatten; /** - * Additional parameters for the putSimpleProductWithGrouping operation. + * Additional parameters for one or more operations. */ @JsonFlatten public class FlattenParameterGroup { diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/firstParameterGroup.js b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/firstParameterGroup.js index 0ee0d72686ad4..ba3b0d7727b98 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/firstParameterGroup.js +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/firstParameterGroup.js @@ -14,7 +14,7 @@ * @class * Initializes a new instance of the FirstParameterGroup class. * @constructor - * Additional parameters for the postMultiParamGroups operation. + * Additional parameters for one or more operations * @member {string} [headerOne] * * @member {number} [queryOne] Query parameter with default. Default value: 30 diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/index.d.ts b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/index.d.ts index b2155667f07a8..9456f4830bfc2 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/index.d.ts +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/index.d.ts @@ -28,7 +28,7 @@ export interface ErrorModel { * @class * Initializes a new instance of the ParameterGroupingPostRequiredParameters class. * @constructor - * Additional parameters for the postRequired operation. + * Additional parameters for one or more operations * @member {number} body * * @member {string} [customHeader] @@ -49,7 +49,7 @@ export interface ParameterGroupingPostRequiredParameters { * @class * Initializes a new instance of the ParameterGroupingPostOptionalParameters class. * @constructor - * Additional parameters for the postOptional operation. + * Additional parameters for one or more operations * @member {string} [customHeader] * * @member {number} [query] Query parameter with default @@ -64,7 +64,7 @@ export interface ParameterGroupingPostOptionalParameters { * @class * Initializes a new instance of the FirstParameterGroup class. * @constructor - * Additional parameters for the postMultiParamGroups operation. + * Additional parameters for one or more operations * @member {string} [headerOne] * * @member {number} [queryOne] Query parameter with default @@ -79,7 +79,7 @@ export interface FirstParameterGroup { * @class * Initializes a new instance of the ParameterGroupingPostMultiParamGroupsSecondParamGroup class. * @constructor - * Additional parameters for the postMultiParamGroups operation. + * Additional parameters for one or more operations * @member {string} [headerTwo] * * @member {number} [queryTwo] Query parameter with default diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/parameterGroupingPostMultiParamGroupsSecondParamGroup.js b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/parameterGroupingPostMultiParamGroupsSecondParamGroup.js index aa82d43c29053..372e9841d5145 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/parameterGroupingPostMultiParamGroupsSecondParamGroup.js +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/parameterGroupingPostMultiParamGroupsSecondParamGroup.js @@ -14,7 +14,7 @@ * @class * Initializes a new instance of the ParameterGroupingPostMultiParamGroupsSecondParamGroup class. * @constructor - * Additional parameters for the postMultiParamGroups operation. + * Additional parameters for one or more operations * @member {string} [headerTwo] * * @member {number} [queryTwo] Query parameter with default. Default value: 30 diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/parameterGroupingPostOptionalParameters.js b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/parameterGroupingPostOptionalParameters.js index 825d2f6436ab3..c0f6f1b6635a6 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/parameterGroupingPostOptionalParameters.js +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/parameterGroupingPostOptionalParameters.js @@ -14,7 +14,7 @@ * @class * Initializes a new instance of the ParameterGroupingPostOptionalParameters class. * @constructor - * Additional parameters for the postOptional operation. + * Additional parameters for one or more operations * @member {string} [customHeader] * * @member {number} [query] Query parameter with default. Default value: 30 . diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/parameterGroupingPostRequiredParameters.js b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/parameterGroupingPostRequiredParameters.js index 561fa05da6a71..ca7054de32923 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/parameterGroupingPostRequiredParameters.js +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/parameterGroupingPostRequiredParameters.js @@ -14,7 +14,7 @@ * @class * Initializes a new instance of the ParameterGroupingPostRequiredParameters class. * @constructor - * Additional parameters for the postRequired operation. + * Additional parameters for one or more operations * @member {number} body * * @member {string} [customHeader] diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Lro/operations/lRORetrys.js b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Lro/operations/lRORetrys.js index 91416004b938f..bacca9fd614ab 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Lro/operations/lRORetrys.js +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Lro/operations/lRORetrys.js @@ -81,7 +81,7 @@ LRORetrys.prototype.put201CreatingSucceeded200 = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -334,7 +334,7 @@ LRORetrys.prototype.putAsyncRelativeRetrySucceeded = function (options, callback initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -562,7 +562,7 @@ LRORetrys.prototype.deleteProvisioning202Accepted200Succeeded = function (option initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -782,7 +782,7 @@ LRORetrys.prototype.delete202Retry200 = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -952,7 +952,7 @@ LRORetrys.prototype.deleteAsyncRelativeRetrySucceeded = function (options, callb initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -1130,7 +1130,7 @@ LRORetrys.prototype.post202Retry200 = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -1332,7 +1332,7 @@ LRORetrys.prototype.postAsyncRelativeRetrySucceeded = function (options, callbac initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -1485,4 +1485,4 @@ LRORetrys.prototype.beginPostAsyncRelativeRetrySucceeded = function (options, ca }; -module.exports = LRORetrys; \ No newline at end of file +module.exports = LRORetrys; diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Lro/operations/lROSADs.js b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Lro/operations/lROSADs.js index b82dd78f09140..240dd4e45fbd6 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Lro/operations/lROSADs.js +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Lro/operations/lROSADs.js @@ -78,7 +78,7 @@ LROSADs.prototype.putNonRetry400 = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -326,7 +326,7 @@ LROSADs.prototype.putNonRetry201Creating400 = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -575,7 +575,7 @@ LROSADs.prototype.putNonRetry201Creating400InvalidJson = function (options, call initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -825,7 +825,7 @@ LROSADs.prototype.putAsyncRelativeRetry400 = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -1048,7 +1048,7 @@ LROSADs.prototype.deleteNonRetry400 = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -1214,7 +1214,7 @@ LROSADs.prototype.delete202NonRetry400 = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -1382,7 +1382,7 @@ LROSADs.prototype.deleteAsyncRelativeRetry400 = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -1558,7 +1558,7 @@ LROSADs.prototype.postNonRetry400 = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -1755,7 +1755,7 @@ LROSADs.prototype.post202NonRetry400 = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -1954,7 +1954,7 @@ LROSADs.prototype.postAsyncRelativeRetry400 = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -2155,7 +2155,7 @@ LROSADs.prototype.putError201NoProvisioningStatePayload = function (options, cal initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -2405,7 +2405,7 @@ LROSADs.prototype.putAsyncRelativeRetryNoStatus = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -2639,7 +2639,7 @@ LROSADs.prototype.putAsyncRelativeRetryNoStatusPayload = function (options, call initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -2863,7 +2863,7 @@ LROSADs.prototype.delete204Succeeded = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -3032,7 +3032,7 @@ LROSADs.prototype.deleteAsyncRelativeRetryNoStatus = function (options, callback initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -3209,7 +3209,7 @@ LROSADs.prototype.post202NoLocation = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -3409,7 +3409,7 @@ LROSADs.prototype.postAsyncRelativeRetryNoPayload = function (options, callback) initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -3610,7 +3610,7 @@ LROSADs.prototype.put200InvalidJson = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -3843,7 +3843,7 @@ LROSADs.prototype.putAsyncRelativeRetryInvalidHeader = function (options, callba initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -4077,7 +4077,7 @@ LROSADs.prototype.putAsyncRelativeRetryInvalidJsonPolling = function (options, c initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -4301,7 +4301,7 @@ LROSADs.prototype.delete202RetryInvalidHeader = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -4469,7 +4469,7 @@ LROSADs.prototype.deleteAsyncRelativeRetryInvalidHeader = function (options, cal initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -4638,7 +4638,7 @@ LROSADs.prototype.deleteAsyncRelativeRetryInvalidJsonPolling = function (options initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -4815,7 +4815,7 @@ LROSADs.prototype.post202RetryInvalidHeader = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -5015,7 +5015,7 @@ LROSADs.prototype.postAsyncRelativeRetryInvalidHeader = function (options, callb initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -5216,7 +5216,7 @@ LROSADs.prototype.postAsyncRelativeRetryInvalidJsonPolling = function (options, initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Lro/operations/lROs.js b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Lro/operations/lROs.js index 7655fc4191aa2..f403121e6dfec 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Lro/operations/lROs.js +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Lro/operations/lROs.js @@ -79,7 +79,7 @@ LROs.prototype.put200Succeeded = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -311,7 +311,7 @@ LROs.prototype.put200SucceededNoState = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -544,7 +544,7 @@ LROs.prototype.put202Retry200 = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -779,7 +779,7 @@ LROs.prototype.put201CreatingSucceeded200 = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -1032,7 +1032,7 @@ LROs.prototype.put200UpdatingSucceeded204 = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -1268,7 +1268,7 @@ LROs.prototype.put201CreatingFailed200 = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -1521,7 +1521,7 @@ LROs.prototype.put200Acceptedcanceled200 = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -1756,7 +1756,7 @@ LROs.prototype.putNoHeaderInRetry = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -1990,7 +1990,7 @@ LROs.prototype.putAsyncRetrySucceeded = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -2224,7 +2224,7 @@ LROs.prototype.putAsyncNoRetrySucceeded = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -2458,7 +2458,7 @@ LROs.prototype.putAsyncRetryFailed = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -2692,7 +2692,7 @@ LROs.prototype.putAsyncNoRetrycanceled = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -2926,7 +2926,7 @@ LROs.prototype.putAsyncNoHeaderInRetry = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -3156,7 +3156,7 @@ LROs.prototype.putNonResource = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -3382,7 +3382,7 @@ LROs.prototype.putAsyncNonResource = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -3606,7 +3606,7 @@ LROs.prototype.putSubResource = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -3828,7 +3828,7 @@ LROs.prototype.putAsyncSubResource = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -4049,7 +4049,7 @@ LROs.prototype.deleteProvisioning202Accepted200Succeeded = function (options, ca initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -4271,7 +4271,7 @@ LROs.prototype.deleteProvisioning202DeletingFailed200 = function (options, callb initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -4493,7 +4493,7 @@ LROs.prototype.deleteProvisioning202Deletingcanceled200 = function (options, cal initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -4711,7 +4711,7 @@ LROs.prototype.delete204Succeeded = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -4880,7 +4880,7 @@ LROs.prototype.delete202Retry200 = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -5083,7 +5083,7 @@ LROs.prototype.delete202NoRetry204 = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -5285,7 +5285,7 @@ LROs.prototype.deleteNoHeaderInRetry = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -5455,7 +5455,7 @@ LROs.prototype.deleteAsyncNoHeaderInRetry = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -5625,7 +5625,7 @@ LROs.prototype.deleteAsyncRetrySucceeded = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -5795,7 +5795,7 @@ LROs.prototype.deleteAsyncNoRetrySucceeded = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -5965,7 +5965,7 @@ LROs.prototype.deleteAsyncRetryFailed = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -6135,7 +6135,7 @@ LROs.prototype.deleteAsyncRetrycanceled = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -6306,7 +6306,7 @@ LROs.prototype.post200WithPayload = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -6533,7 +6533,7 @@ LROs.prototype.post202Retry200 = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -6734,7 +6734,7 @@ LROs.prototype.post202NoRetry204 = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -6967,7 +6967,7 @@ LROs.prototype.postAsyncRetrySucceeded = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -7201,7 +7201,7 @@ LROs.prototype.postAsyncNoRetrySucceeded = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -7434,7 +7434,7 @@ LROs.prototype.postAsyncRetryFailed = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -7635,7 +7635,7 @@ LROs.prototype.postAsyncRetrycanceled = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -7787,4 +7787,4 @@ LROs.prototype.beginPostAsyncRetrycanceled = function (options, callback) { }; -module.exports = LROs; \ No newline at end of file +module.exports = LROs; diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Lro/operations/lROsCustomHeader.js b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Lro/operations/lROsCustomHeader.js index 0c25e2df3bb0c..3d4d296e68aaa 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Lro/operations/lROsCustomHeader.js +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Lro/operations/lROsCustomHeader.js @@ -82,7 +82,7 @@ LROsCustomHeader.prototype.putAsyncRetrySucceeded = function (options, callback) initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -320,7 +320,7 @@ LROsCustomHeader.prototype.put201CreatingSucceeded200 = function (options, callb initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -573,7 +573,7 @@ LROsCustomHeader.prototype.post202Retry200 = function (options, callback) { initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -777,7 +777,7 @@ LROsCustomHeader.prototype.postAsyncRetrySucceeded = function (options, callback initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPostOrDeleteOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result @@ -931,4 +931,4 @@ LROsCustomHeader.prototype.beginPostAsyncRetrySucceeded = function (options, cal }; -module.exports = LROsCustomHeader; \ No newline at end of file +module.exports = LROsCustomHeader; diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Paging/models/index.d.ts b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Paging/models/index.d.ts index b95c21cdbef8a..3f94c15e7a4b4 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Paging/models/index.d.ts +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Paging/models/index.d.ts @@ -56,7 +56,7 @@ export interface OperationResult { * @class * Initializes a new instance of the PagingGetMultiplePagesOptions class. * @constructor - * Additional parameters for the getMultiplePages operation. + * Additional parameters for one or more operations * @member {number} [maxresults] Sets the maximum number of items to return in * the response. * @@ -73,7 +73,7 @@ export interface PagingGetMultiplePagesOptions { * @class * Initializes a new instance of the PagingGetMultiplePagesWithOffsetOptions class. * @constructor - * Additional parameters for the getMultiplePagesWithOffset operation. + * Additional parameters for one or more operations * @member {number} [maxresults] Sets the maximum number of items to return in * the response. * diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Paging/models/pagingGetMultiplePagesOptions.js b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Paging/models/pagingGetMultiplePagesOptions.js index 017fd4372b9ee..5c7103c374193 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Paging/models/pagingGetMultiplePagesOptions.js +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Paging/models/pagingGetMultiplePagesOptions.js @@ -14,7 +14,7 @@ * @class * Initializes a new instance of the PagingGetMultiplePagesOptions class. * @constructor - * Additional parameters for the getMultiplePages operation. + * Additional parameters for one or more operations * @member {number} [maxresults] Sets the maximum number of items to return in * the response. * diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Paging/models/pagingGetMultiplePagesWithOffsetOptions.js b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Paging/models/pagingGetMultiplePagesWithOffsetOptions.js index 42631d194f11b..1398c4f710fac 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Paging/models/pagingGetMultiplePagesWithOffsetOptions.js +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Paging/models/pagingGetMultiplePagesWithOffsetOptions.js @@ -14,7 +14,7 @@ * @class * Initializes a new instance of the PagingGetMultiplePagesWithOffsetOptions class. * @constructor - * Additional parameters for the getMultiplePagesWithOffset operation. + * Additional parameters for one or more operations * @member {number} [maxresults] Sets the maximum number of items to return in * the response. * diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/StorageManagementClient/operations/storageAccounts.js b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/StorageManagementClient/operations/storageAccounts.js index 272319d4ccc39..bff7003860456 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/StorageManagementClient/operations/storageAccounts.js +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/StorageManagementClient/operations/storageAccounts.js @@ -253,7 +253,7 @@ StorageAccounts.prototype.create = function (resourceGroupName, accountName, par initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/ModelFlattening/models/flattenParameterGroup.js b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/ModelFlattening/models/flattenParameterGroup.js index d548e2c6afea8..e034f91979bfb 100644 --- a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/ModelFlattening/models/flattenParameterGroup.js +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/ModelFlattening/models/flattenParameterGroup.js @@ -14,7 +14,7 @@ * @class * Initializes a new instance of the FlattenParameterGroup class. * @constructor - * Additional parameters for the putSimpleProductWithGrouping operation. + * Additional parameters for one or more operations * @member {string} name Product name with value 'groupproduct' * * @member {string} productId Unique identifier representing a specific diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/ModelFlattening/models/index.d.ts b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/ModelFlattening/models/index.d.ts index a105800deac0a..ea95cb0f14945 100644 --- a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/ModelFlattening/models/index.d.ts +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/ModelFlattening/models/index.d.ts @@ -137,7 +137,7 @@ export interface SimpleProduct extends BaseProduct { * @class * Initializes a new instance of the FlattenParameterGroup class. * @constructor - * Additional parameters for the putSimpleProductWithGrouping operation. + * Additional parameters for one or more operations * @member {string} name Product name with value 'groupproduct' * * @member {string} productId Unique identifier representing a specific diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureBodyDuration/setup.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureBodyDuration/setup.py index 251a4cda74c35..97aa1ecfa3dd1 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureBodyDuration/setup.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureBodyDuration/setup.py @@ -22,7 +22,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -REQUIRES = ["msrest>=0.2.0", "msrestazure>=0.2.1"] +REQUIRES = ["msrest>=0.3.0", "msrestazure>=0.3.0"] setup( name=NAME, diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/first_parameter_group.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/first_parameter_group.py index 0a3174e49ea52..dec4f136004f7 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/first_parameter_group.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/first_parameter_group.py @@ -14,7 +14,7 @@ class FirstParameterGroup(Model): """ - Additional parameters for the postMultiParamGroups operation. + Additional parameters for one or more operations :param header_one: :type header_one: str diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/parameter_grouping_post_multi_param_groups_second_param_group.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/parameter_grouping_post_multi_param_groups_second_param_group.py index d178c7470903e..4d4af238358bc 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/parameter_grouping_post_multi_param_groups_second_param_group.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/parameter_grouping_post_multi_param_groups_second_param_group.py @@ -14,7 +14,7 @@ class ParameterGroupingPostMultiParamGroupsSecondParamGroup(Model): """ - Additional parameters for the postMultiParamGroups operation. + Additional parameters for one or more operations :param header_two: :type header_two: str diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/parameter_grouping_post_optional_parameters.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/parameter_grouping_post_optional_parameters.py index 7368af7d84956..623b79fd0feee 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/parameter_grouping_post_optional_parameters.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/parameter_grouping_post_optional_parameters.py @@ -14,7 +14,7 @@ class ParameterGroupingPostOptionalParameters(Model): """ - Additional parameters for the postOptional operation. + Additional parameters for one or more operations :param custom_header: :type custom_header: str diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/parameter_grouping_post_required_parameters.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/parameter_grouping_post_required_parameters.py index 33627d834bdad..109ebe5ad51e0 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/parameter_grouping_post_required_parameters.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/parameter_grouping_post_required_parameters.py @@ -14,7 +14,7 @@ class ParameterGroupingPostRequiredParameters(Model): """ - Additional parameters for the postRequired operation. + Additional parameters for one or more operations :param body: :type body: int diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/setup.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/setup.py index 2e0910c9bcdeb..4e3dc67a4f96a 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/setup.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/setup.py @@ -22,7 +22,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -REQUIRES = ["msrest>=0.2.0", "msrestazure>=0.2.1"] +REQUIRES = ["msrest>=0.3.0", "msrestazure>=0.3.0"] setup( name=NAME, diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureReport/setup.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureReport/setup.py index 762429f51c290..fee4d2a41a3c6 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureReport/setup.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureReport/setup.py @@ -22,7 +22,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -REQUIRES = ["msrest>=0.2.0", "msrestazure>=0.2.1"] +REQUIRES = ["msrest>=0.3.0", "msrestazure>=0.3.0"] setup( name=NAME, diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureResource/setup.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureResource/setup.py index d4003cb22d3fd..095659cbb3fa4 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureResource/setup.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureResource/setup.py @@ -22,7 +22,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -REQUIRES = ["msrest>=0.2.0", "msrestazure>=0.2.1"] +REQUIRES = ["msrest>=0.3.0", "msrestazure>=0.3.0"] setup( name=NAME, diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureSpecials/setup.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureSpecials/setup.py index a23f56d19161d..cd93aa2dd66d6 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureSpecials/setup.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureSpecials/setup.py @@ -22,7 +22,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -REQUIRES = ["msrest>=0.2.0", "msrestazure>=0.2.1"] +REQUIRES = ["msrest>=0.3.0", "msrestazure>=0.3.0"] setup( name=NAME, diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/CustomBaseUri/setup.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/CustomBaseUri/setup.py index b58762d14bf16..b60d7cd0eb460 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/CustomBaseUri/setup.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/CustomBaseUri/setup.py @@ -22,7 +22,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -REQUIRES = ["msrest>=0.2.0", "msrestazure>=0.2.1"] +REQUIRES = ["msrest>=0.3.0", "msrestazure>=0.3.0"] setup( name=NAME, diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Head/setup.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Head/setup.py index e11e2311eb413..083369e096dcc 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Head/setup.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Head/setup.py @@ -22,7 +22,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -REQUIRES = ["msrest>=0.2.0", "msrestazure>=0.2.1"] +REQUIRES = ["msrest>=0.3.0", "msrestazure>=0.3.0"] setup( name=NAME, diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/HeadExceptions/setup.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/HeadExceptions/setup.py index eea7127ecba39..d66fa596b1ebb 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/HeadExceptions/setup.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/HeadExceptions/setup.py @@ -22,7 +22,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -REQUIRES = ["msrest>=0.2.0", "msrestazure>=0.2.1"] +REQUIRES = ["msrest>=0.3.0", "msrestazure>=0.3.0"] setup( name=NAME, diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/setup.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/setup.py index 6efdcd0d3ea4e..dab3d2e5e77e0 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/setup.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Lro/setup.py @@ -22,7 +22,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -REQUIRES = ["msrest>=0.2.0", "msrestazure>=0.2.1"] +REQUIRES = ["msrest>=0.3.0", "msrestazure>=0.3.0"] setup( name=NAME, diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/autorestpagingtestservice/models/paging_get_multiple_pages_options.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/autorestpagingtestservice/models/paging_get_multiple_pages_options.py index c776b4da879d7..4fcaf367d51bc 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/autorestpagingtestservice/models/paging_get_multiple_pages_options.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/autorestpagingtestservice/models/paging_get_multiple_pages_options.py @@ -14,7 +14,7 @@ class PagingGetMultiplePagesOptions(Model): """ - Additional parameters for the getMultiplePages operation. + Additional parameters for one or more operations :param maxresults: Sets the maximum number of items to return in the response. diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/autorestpagingtestservice/models/paging_get_multiple_pages_with_offset_options.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/autorestpagingtestservice/models/paging_get_multiple_pages_with_offset_options.py index 57650f8519648..48ed388233daf 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/autorestpagingtestservice/models/paging_get_multiple_pages_with_offset_options.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/autorestpagingtestservice/models/paging_get_multiple_pages_with_offset_options.py @@ -14,7 +14,7 @@ class PagingGetMultiplePagesWithOffsetOptions(Model): """ - Additional parameters for the getMultiplePagesWithOffset operation. + Additional parameters for one or more operations :param maxresults: Sets the maximum number of items to return in the response. diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/setup.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/setup.py index b8c042a69efb9..063fc0d9388e6 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/setup.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/setup.py @@ -22,7 +22,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -REQUIRES = ["msrest>=0.2.0", "msrestazure>=0.2.1"] +REQUIRES = ["msrest>=0.3.0", "msrestazure>=0.3.0"] setup( name=NAME, diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/StorageManagementClient/setup.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/StorageManagementClient/setup.py index 7e7b4160e02e1..b204e8c8c203b 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/StorageManagementClient/setup.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/StorageManagementClient/setup.py @@ -22,7 +22,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -REQUIRES = ["msrest>=0.2.0", "msrestazure>=0.2.1"] +REQUIRES = ["msrest>=0.3.0", "msrestazure>=0.3.0"] setup( name=NAME, diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/SubscriptionIdApiVersion/setup.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/SubscriptionIdApiVersion/setup.py index a0eeb22b2beda..270e110d8b34f 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/SubscriptionIdApiVersion/setup.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/SubscriptionIdApiVersion/setup.py @@ -22,7 +22,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -REQUIRES = ["msrest>=0.2.0", "msrestazure>=0.2.1"] +REQUIRES = ["msrest>=0.3.0", "msrestazure>=0.3.0"] setup( name=NAME, diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ModelFlattening/autorestresourceflatteningtestservice/models/flatten_parameter_group.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ModelFlattening/autorestresourceflatteningtestservice/models/flatten_parameter_group.py index ef30dd1f2d039..3e66e6a883e48 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ModelFlattening/autorestresourceflatteningtestservice/models/flatten_parameter_group.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ModelFlattening/autorestresourceflatteningtestservice/models/flatten_parameter_group.py @@ -14,7 +14,7 @@ class FlattenParameterGroup(Model): """ - Additional parameters for the putSimpleProductWithGrouping operation. + Additional parameters for one or more operations :param name: Product name with value 'groupproduct' :type name: str diff --git a/Samples/azure-storage/Azure.CSharp/Models/CheckNameAvailabilityResult.cs b/Samples/azure-storage/Azure.CSharp/Models/CheckNameAvailabilityResult.cs index c2a6c4848934b..086e8b5169ec2 100644 --- a/Samples/azure-storage/Azure.CSharp/Models/CheckNameAvailabilityResult.cs +++ b/Samples/azure-storage/Azure.CSharp/Models/CheckNameAvailabilityResult.cs @@ -32,23 +32,26 @@ public CheckNameAvailabilityResult() { } } /// - /// Gets a boolean value that indicates whether the name is available - /// for you to use. If true, the name is available. If false, the - /// name has already been taken or invalid and cannot be used. + /// Gets or sets gets a boolean value that indicates whether the name + /// is available for you to use. If true, the name is available. If + /// false, the name has already been taken or invalid and cannot be + /// used. /// [JsonProperty(PropertyName = "nameAvailable")] public bool? NameAvailable { get; set; } /// - /// Gets the reason that a storage account name could not be used. The - /// Reason element is only returned if NameAvailable is false. - /// Possible values include: 'AccountNameInvalid', 'AlreadyExists' + /// Gets or sets gets the reason that a storage account name could not + /// be used. The Reason element is only returned if NameAvailable is + /// false. Possible values include: 'AccountNameInvalid', + /// 'AlreadyExists' /// [JsonProperty(PropertyName = "reason")] public Reason? Reason { get; set; } /// - /// Gets an error message explaining the Reason value in more detail. + /// Gets or sets gets an error message explaining the Reason value in + /// more detail. /// [JsonProperty(PropertyName = "message")] public string Message { get; set; } diff --git a/Samples/azure-storage/Azure.CSharp/Models/CustomDomain.cs b/Samples/azure-storage/Azure.CSharp/Models/CustomDomain.cs index d783381ad39d1..5ada788894a57 100644 --- a/Samples/azure-storage/Azure.CSharp/Models/CustomDomain.cs +++ b/Samples/azure-storage/Azure.CSharp/Models/CustomDomain.cs @@ -30,14 +30,16 @@ public CustomDomain() { } } /// - /// Gets or sets the custom domain name. Name is the CNAME source. + /// Gets or sets gets or sets the custom domain name. Name is the + /// CNAME source. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// Indicates whether indirect CName validation is enabled. Default - /// value is false. This should only be set on updates + /// Gets or sets indicates whether indirect CName validation is + /// enabled. Default value is false. This should only be set on + /// updates /// [JsonProperty(PropertyName = "useSubDomain")] public bool? UseSubDomain { get; set; } diff --git a/Samples/azure-storage/Azure.CSharp/Models/Endpoints.cs b/Samples/azure-storage/Azure.CSharp/Models/Endpoints.cs index 892510076c3e5..f9b8d67d127d3 100644 --- a/Samples/azure-storage/Azure.CSharp/Models/Endpoints.cs +++ b/Samples/azure-storage/Azure.CSharp/Models/Endpoints.cs @@ -32,25 +32,25 @@ public Endpoints() { } } /// - /// Gets the blob endpoint. + /// Gets or sets gets the blob endpoint. /// [JsonProperty(PropertyName = "blob")] public string Blob { get; set; } /// - /// Gets the queue endpoint. + /// Gets or sets gets the queue endpoint. /// [JsonProperty(PropertyName = "queue")] public string Queue { get; set; } /// - /// Gets the table endpoint. + /// Gets or sets gets the table endpoint. /// [JsonProperty(PropertyName = "table")] public string Table { get; set; } /// - /// Gets the file endpoint. + /// Gets or sets gets the file endpoint. /// [JsonProperty(PropertyName = "file")] public string File { get; set; } diff --git a/Samples/azure-storage/Azure.CSharp/Models/Resource.cs b/Samples/azure-storage/Azure.CSharp/Models/Resource.cs index 4bdc3976317e8..fbf994880b942 100644 --- a/Samples/azure-storage/Azure.CSharp/Models/Resource.cs +++ b/Samples/azure-storage/Azure.CSharp/Models/Resource.cs @@ -29,31 +29,31 @@ public Resource() { } } /// - /// Resource Id + /// Gets resource Id /// [JsonProperty(PropertyName = "id")] public string Id { get; private set; } /// - /// Resource name + /// Gets resource name /// [JsonProperty(PropertyName = "name")] public string Name { get; private set; } /// - /// Resource type + /// Gets resource type /// [JsonProperty(PropertyName = "type")] public string Type { get; private set; } /// - /// Resource location + /// Gets or sets resource location /// [JsonProperty(PropertyName = "location")] public string Location { get; set; } /// - /// Resource tags + /// Gets or sets resource tags /// [JsonProperty(PropertyName = "tags")] public IDictionary Tags { get; set; } diff --git a/Samples/azure-storage/Azure.CSharp/Models/StorageAccountCreateParameters.cs b/Samples/azure-storage/Azure.CSharp/Models/StorageAccountCreateParameters.cs index c9b194c878b09..1c23f83ac300c 100644 --- a/Samples/azure-storage/Azure.CSharp/Models/StorageAccountCreateParameters.cs +++ b/Samples/azure-storage/Azure.CSharp/Models/StorageAccountCreateParameters.cs @@ -32,13 +32,13 @@ public StorageAccountCreateParameters() { } } /// - /// Resource location + /// Gets or sets resource location /// [JsonProperty(PropertyName = "location")] public string Location { get; set; } /// - /// Resource tags + /// Gets or sets resource tags /// [JsonProperty(PropertyName = "tags")] public IDictionary Tags { get; set; } diff --git a/Samples/azure-storage/Azure.CSharp/Models/StorageAccountKeys.cs b/Samples/azure-storage/Azure.CSharp/Models/StorageAccountKeys.cs index ce80a21921515..823fee32250f7 100644 --- a/Samples/azure-storage/Azure.CSharp/Models/StorageAccountKeys.cs +++ b/Samples/azure-storage/Azure.CSharp/Models/StorageAccountKeys.cs @@ -29,13 +29,13 @@ public StorageAccountKeys() { } } /// - /// Gets the value of key 1. + /// Gets or sets gets the value of key 1. /// [JsonProperty(PropertyName = "key1")] public string Key1 { get; set; } /// - /// Gets the value of key 2. + /// Gets or sets gets the value of key 2. /// [JsonProperty(PropertyName = "key2")] public string Key2 { get; set; } diff --git a/Samples/azure-storage/Azure.CSharp/Models/StorageAccountProperties.cs b/Samples/azure-storage/Azure.CSharp/Models/StorageAccountProperties.cs index e5af974c69344..8282d7cc49c8d 100644 --- a/Samples/azure-storage/Azure.CSharp/Models/StorageAccountProperties.cs +++ b/Samples/azure-storage/Azure.CSharp/Models/StorageAccountProperties.cs @@ -35,87 +35,89 @@ public StorageAccountProperties() { } } /// - /// Gets the status of the storage account at the time the operation - /// was called. Possible values include: 'Creating', 'ResolvingDNS', - /// 'Succeeded' + /// Gets or sets gets the status of the storage account at the time + /// the operation was called. Possible values include: 'Creating', + /// 'ResolvingDNS', 'Succeeded' /// [JsonProperty(PropertyName = "provisioningState")] public ProvisioningState? ProvisioningState { get; set; } /// - /// Gets the type of the storage account. Possible values include: - /// 'Standard_LRS', 'Standard_ZRS', 'Standard_GRS', 'Standard_RAGRS', - /// 'Premium_LRS' + /// Gets or sets gets the type of the storage account. Possible values + /// include: 'Standard_LRS', 'Standard_ZRS', 'Standard_GRS', + /// 'Standard_RAGRS', 'Premium_LRS' /// [JsonProperty(PropertyName = "accountType")] public AccountType? AccountType { get; set; } /// - /// Gets the URLs that are used to perform a retrieval of a public - /// blob, queue or table object.Note that StandardZRS and PremiumLRS - /// accounts only return the blob endpoint. + /// Gets or sets gets the URLs that are used to perform a retrieval of + /// a public blob, queue or table object.Note that StandardZRS and + /// PremiumLRS accounts only return the blob endpoint. /// [JsonProperty(PropertyName = "primaryEndpoints")] public Endpoints PrimaryEndpoints { get; set; } /// - /// Gets the location of the primary for the storage account. + /// Gets or sets gets the location of the primary for the storage + /// account. /// [JsonProperty(PropertyName = "primaryLocation")] public string PrimaryLocation { get; set; } /// - /// Gets the status indicating whether the primary location of the - /// storage account is available or unavailable. Possible values - /// include: 'Available', 'Unavailable' + /// Gets or sets gets the status indicating whether the primary + /// location of the storage account is available or unavailable. + /// Possible values include: 'Available', 'Unavailable' /// [JsonProperty(PropertyName = "statusOfPrimary")] public AccountStatus? StatusOfPrimary { get; set; } /// - /// Gets the timestamp of the most recent instance of a failover to - /// the secondary location. Only the most recent timestamp is - /// retained. This element is not returned if there has never been a - /// failover instance. Only available if the accountType is - /// StandardGRS or StandardRAGRS. + /// Gets or sets gets the timestamp of the most recent instance of a + /// failover to the secondary location. Only the most recent + /// timestamp is retained. This element is not returned if there has + /// never been a failover instance. Only available if the accountType + /// is StandardGRS or StandardRAGRS. /// [JsonProperty(PropertyName = "lastGeoFailoverTime")] public DateTime? LastGeoFailoverTime { get; set; } /// - /// Gets the location of the geo replicated secondary for the storage - /// account. Only available if the accountType is StandardGRS or - /// StandardRAGRS. + /// Gets or sets gets the location of the geo replicated secondary for + /// the storage account. Only available if the accountType is + /// StandardGRS or StandardRAGRS. /// [JsonProperty(PropertyName = "secondaryLocation")] public string SecondaryLocation { get; set; } /// - /// Gets the status indicating whether the secondary location of the - /// storage account is available or unavailable. Only available if - /// the accountType is StandardGRS or StandardRAGRS. Possible values - /// include: 'Available', 'Unavailable' + /// Gets or sets gets the status indicating whether the secondary + /// location of the storage account is available or unavailable. Only + /// available if the accountType is StandardGRS or StandardRAGRS. + /// Possible values include: 'Available', 'Unavailable' /// [JsonProperty(PropertyName = "statusOfSecondary")] public AccountStatus? StatusOfSecondary { get; set; } /// - /// Gets the creation date and time of the storage account in UTC. + /// Gets or sets gets the creation date and time of the storage + /// account in UTC. /// [JsonProperty(PropertyName = "creationTime")] public DateTime? CreationTime { get; set; } /// - /// Gets the user assigned custom domain assigned to this storage - /// account. + /// Gets or sets gets the user assigned custom domain assigned to this + /// storage account. /// [JsonProperty(PropertyName = "customDomain")] public CustomDomain CustomDomain { get; set; } /// - /// Gets the URLs that are used to perform a retrieval of a public - /// blob, queue or table object from the secondary location of the - /// storage account. Only available if the accountType is + /// Gets or sets gets the URLs that are used to perform a retrieval of + /// a public blob, queue or table object from the secondary location + /// of the storage account. Only available if the accountType is /// StandardRAGRS. /// [JsonProperty(PropertyName = "secondaryEndpoints")] diff --git a/Samples/azure-storage/Azure.CSharp/Models/StorageAccountPropertiesCreateParameters.cs b/Samples/azure-storage/Azure.CSharp/Models/StorageAccountPropertiesCreateParameters.cs index bc0824cb9d80e..0c2a98e26f0b0 100644 --- a/Samples/azure-storage/Azure.CSharp/Models/StorageAccountPropertiesCreateParameters.cs +++ b/Samples/azure-storage/Azure.CSharp/Models/StorageAccountPropertiesCreateParameters.cs @@ -27,9 +27,9 @@ public StorageAccountPropertiesCreateParameters(AccountType accountType) } /// - /// Gets or sets the account type. Possible values include: - /// 'Standard_LRS', 'Standard_ZRS', 'Standard_GRS', 'Standard_RAGRS', - /// 'Premium_LRS' + /// Gets or sets gets or sets the account type. Possible values + /// include: 'Standard_LRS', 'Standard_ZRS', 'Standard_GRS', + /// 'Standard_RAGRS', 'Premium_LRS' /// [JsonProperty(PropertyName = "accountType")] public AccountType AccountType { get; set; } diff --git a/Samples/azure-storage/Azure.CSharp/Models/StorageAccountPropertiesUpdateParameters.cs b/Samples/azure-storage/Azure.CSharp/Models/StorageAccountPropertiesUpdateParameters.cs index 4808f3439b039..22ca07468f62a 100644 --- a/Samples/azure-storage/Azure.CSharp/Models/StorageAccountPropertiesUpdateParameters.cs +++ b/Samples/azure-storage/Azure.CSharp/Models/StorageAccountPropertiesUpdateParameters.cs @@ -28,9 +28,9 @@ public StorageAccountPropertiesUpdateParameters() { } } /// - /// Gets or sets the account type. Note that StandardZRS and - /// PremiumLRS accounts cannot be changed to other account types, and - /// other account types cannot be changed to StandardZRS or + /// Gets or sets gets or sets the account type. Note that StandardZRS + /// and PremiumLRS accounts cannot be changed to other account types, + /// and other account types cannot be changed to StandardZRS or /// PremiumLRS. Possible values include: 'Standard_LRS', /// 'Standard_ZRS', 'Standard_GRS', 'Standard_RAGRS', 'Premium_LRS' /// @@ -38,10 +38,10 @@ public StorageAccountPropertiesUpdateParameters() { } public AccountType? AccountType { get; set; } /// - /// User domain assigned to the storage account. Name is the CNAME - /// source. Only one custom domain is supported per storage account - /// at this time. To clear the existing custom domain, use an empty - /// string for the custom domain name property. + /// Gets or sets user domain assigned to the storage account. Name is + /// the CNAME source. Only one custom domain is supported per storage + /// account at this time. To clear the existing custom domain, use an + /// empty string for the custom domain name property. /// [JsonProperty(PropertyName = "customDomain")] public CustomDomain CustomDomain { get; set; } diff --git a/Samples/azure-storage/Azure.CSharp/Models/StorageAccountUpdateParameters.cs b/Samples/azure-storage/Azure.CSharp/Models/StorageAccountUpdateParameters.cs index 768e0fe7fbe4c..3346aab6e2f10 100644 --- a/Samples/azure-storage/Azure.CSharp/Models/StorageAccountUpdateParameters.cs +++ b/Samples/azure-storage/Azure.CSharp/Models/StorageAccountUpdateParameters.cs @@ -31,7 +31,7 @@ public StorageAccountUpdateParameters() { } } /// - /// Resource tags + /// Gets or sets resource tags /// [JsonProperty(PropertyName = "tags")] public IDictionary Tags { get; set; } diff --git a/Samples/azure-storage/Azure.CSharp/Models/Usage.cs b/Samples/azure-storage/Azure.CSharp/Models/Usage.cs index 338a900b30ddb..4499cc0487999 100644 --- a/Samples/azure-storage/Azure.CSharp/Models/Usage.cs +++ b/Samples/azure-storage/Azure.CSharp/Models/Usage.cs @@ -31,28 +31,29 @@ public Usage(UsageUnit unit, int currentValue, int limit, UsageName name) } /// - /// Gets the unit of measurement. Possible values include: 'Count', - /// 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond' + /// Gets or sets gets the unit of measurement. Possible values + /// include: 'Count', 'Bytes', 'Seconds', 'Percent', + /// 'CountsPerSecond', 'BytesPerSecond' /// [JsonProperty(PropertyName = "unit")] public UsageUnit Unit { get; set; } /// - /// Gets the current count of the allocated resources in the - /// subscription. + /// Gets or sets gets the current count of the allocated resources in + /// the subscription. /// [JsonProperty(PropertyName = "currentValue")] public int CurrentValue { get; set; } /// - /// Gets the maximum count of the resources that can be allocated in - /// the subscription. + /// Gets or sets gets the maximum count of the resources that can be + /// allocated in the subscription. /// [JsonProperty(PropertyName = "limit")] public int Limit { get; set; } /// - /// Gets the name of the type of usage. + /// Gets or sets gets the name of the type of usage. /// [JsonProperty(PropertyName = "name")] public UsageName Name { get; set; } diff --git a/Samples/azure-storage/Azure.CSharp/Models/UsageName.cs b/Samples/azure-storage/Azure.CSharp/Models/UsageName.cs index 694332c58b21b..9acc8b5e30d4e 100644 --- a/Samples/azure-storage/Azure.CSharp/Models/UsageName.cs +++ b/Samples/azure-storage/Azure.CSharp/Models/UsageName.cs @@ -29,13 +29,13 @@ public UsageName() { } } /// - /// Gets a string describing the resource name. + /// Gets or sets gets a string describing the resource name. /// [JsonProperty(PropertyName = "value")] public string Value { get; set; } /// - /// Gets a localized string describing the resource name. + /// Gets or sets gets a localized string describing the resource name. /// [JsonProperty(PropertyName = "localizedValue")] public string LocalizedValue { get; set; } diff --git a/Samples/azure-storage/Azure.NodeJS/operations/storageAccounts.js b/Samples/azure-storage/Azure.NodeJS/operations/storageAccounts.js index 1cd198259f23d..c1b4897711661 100644 --- a/Samples/azure-storage/Azure.NodeJS/operations/storageAccounts.js +++ b/Samples/azure-storage/Azure.NodeJS/operations/storageAccounts.js @@ -248,7 +248,7 @@ StorageAccounts.prototype.create = function (resourceGroupName, accountName, par initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; - client.getPutOrPatchOperationResult(initialResult, options, function (err, pollingResult) { + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { if (err) return callback(err); // Create Result diff --git a/Samples/azure-storage/Azure.Python/setup.py b/Samples/azure-storage/Azure.Python/setup.py index b9fe5db7a8f35..3260175533423 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.2.0", "msrestazure>=0.2.1"] +REQUIRES = ["msrest>=0.3.0", "msrestazure>=0.3.0"] setup( name=NAME, diff --git a/Samples/azure-storage/Azure.Ruby/azure_storage/storage_accounts.rb b/Samples/azure-storage/Azure.Ruby/azure_storage/storage_accounts.rb index d81d3ec1045df..771307fb0945d 100644 --- a/Samples/azure-storage/Azure.Ruby/azure_storage/storage_accounts.rb +++ b/Samples/azure-storage/Azure.Ruby/azure_storage/storage_accounts.rb @@ -89,7 +89,10 @@ def check_name_availability_async(account_name, custom_headers = nil) body: request_content, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options) + + request_url = @base_url || @client.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options) promise = request.run_promise do |req| @client.credentials.sign_request(req) unless @client.credentials.nil? end @@ -161,7 +164,7 @@ def create(resource_group_name, account_name, parameters, custom_headers = nil) end # Waiting for response. - @client.get_put_operation_result(response, deserialize_method) + @client.get_long_running_operation_result(response, deserialize_method) end promise @@ -260,7 +263,10 @@ def begin_create_async(resource_group_name, account_name, parameters, custom_hea body: request_content, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :put, options) + + request_url = @base_url || @client.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options) promise = request.run_promise do |req| @client.credentials.sign_request(req) unless @client.credentials.nil? end @@ -359,7 +365,10 @@ def delete_async(resource_group_name, account_name, custom_headers = nil) query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :delete, options) + + request_url = @base_url || @client.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options) promise = request.run_promise do |req| @client.credentials.sign_request(req) unless @client.credentials.nil? end @@ -453,7 +462,10 @@ def get_properties_async(resource_group_name, account_name, custom_headers = nil query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options) + + request_url = @base_url || @client.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options) promise = request.run_promise do |req| @client.credentials.sign_request(req) unless @client.credentials.nil? end @@ -605,7 +617,10 @@ def update_async(resource_group_name, account_name, parameters, custom_headers = body: request_content, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :patch, options) + + request_url = @base_url || @client.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :patch, options) promise = request.run_promise do |req| @client.credentials.sign_request(req) unless @client.credentials.nil? end @@ -696,7 +711,10 @@ def list_keys_async(resource_group_name, account_name, custom_headers = nil) query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options) + + request_url = @base_url || @client.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options) promise = request.run_promise do |req| @client.credentials.sign_request(req) unless @client.credentials.nil? end @@ -782,7 +800,10 @@ def list_async(custom_headers = nil) query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options) + + request_url = @base_url || @client.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options) promise = request.run_promise do |req| @client.credentials.sign_request(req) unless @client.credentials.nil? end @@ -878,7 +899,10 @@ def list_by_resource_group_async(resource_group_name, custom_headers = nil) query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options) + + request_url = @base_url || @client.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options) promise = request.run_promise do |req| @client.credentials.sign_request(req) unless @client.credentials.nil? end @@ -994,7 +1018,10 @@ def regenerate_key_async(resource_group_name, account_name, regenerate_key, cust body: request_content, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options) + + request_url = @base_url || @client.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options) promise = request.run_promise do |req| @client.credentials.sign_request(req) unless @client.credentials.nil? end diff --git a/Samples/azure-storage/Azure.Ruby/azure_storage/usage_operations.rb b/Samples/azure-storage/Azure.Ruby/azure_storage/usage_operations.rb index 54a4173ea263f..7ac968267e69c 100644 --- a/Samples/azure-storage/Azure.Ruby/azure_storage/usage_operations.rb +++ b/Samples/azure-storage/Azure.Ruby/azure_storage/usage_operations.rb @@ -70,7 +70,10 @@ def list_async(custom_headers = nil) query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options) + + request_url = @base_url || @client.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options) promise = request.run_promise do |req| @client.credentials.sign_request(req) unless @client.credentials.nil? end diff --git a/Samples/petstore/CSharp/Models/Order.cs b/Samples/petstore/CSharp/Models/Order.cs index b0c9e5ab6d146..23e3155fa2f51 100644 --- a/Samples/petstore/CSharp/Models/Order.cs +++ b/Samples/petstore/CSharp/Models/Order.cs @@ -49,8 +49,8 @@ public Order() { } public DateTime? ShipDate { get; set; } /// - /// Order Status. Possible values include: 'placed', 'approved', - /// 'delivered' + /// Gets or sets order Status. Possible values include: 'placed', + /// 'approved', 'delivered' /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } diff --git a/Samples/petstore/CSharp/Models/Pet.cs b/Samples/petstore/CSharp/Models/Pet.cs index c4e0286deb254..672c2aad64087 100644 --- a/Samples/petstore/CSharp/Models/Pet.cs +++ b/Samples/petstore/CSharp/Models/Pet.cs @@ -54,8 +54,8 @@ public Pet() { } public IList Tags { get; set; } /// - /// pet status in the store. Possible values include: 'available', - /// 'pending', 'sold' + /// Gets or sets pet status in the store. Possible values include: + /// 'available', 'pending', 'sold' /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } diff --git a/Samples/petstore/CSharp/Models/User.cs b/Samples/petstore/CSharp/Models/User.cs index d30dd443ac789..acdc7b1824011 100644 --- a/Samples/petstore/CSharp/Models/User.cs +++ b/Samples/petstore/CSharp/Models/User.cs @@ -66,7 +66,7 @@ public User() { } public string Phone { get; set; } /// - /// User Status + /// Gets or sets user Status /// [JsonProperty(PropertyName = "userStatus")] public int? UserStatus { get; set; } diff --git a/Samples/petstore/Ruby/petstore/swagger_petstore.rb b/Samples/petstore/Ruby/petstore/swagger_petstore.rb index 9584898cad19a..d1ebfee575938 100644 --- a/Samples/petstore/Ruby/petstore/swagger_petstore.rb +++ b/Samples/petstore/Ruby/petstore/swagger_petstore.rb @@ -75,7 +75,10 @@ def add_pet_using_byte_array_async(body = nil, custom_headers = nil) body: request_content, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || self.base_url, path_template, :post, options) + + request_url = @base_url || self.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options) promise = request.run_promise do |req| self.credentials.sign_request(req) unless self.credentials.nil? end @@ -148,7 +151,10 @@ def add_pet_async(body = nil, custom_headers = nil) body: request_content, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || self.base_url, path_template, :post, options) + + request_url = @base_url || self.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options) promise = request.run_promise do |req| self.credentials.sign_request(req) unless self.credentials.nil? end @@ -221,7 +227,10 @@ def update_pet_async(body = nil, custom_headers = nil) body: request_content, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || self.base_url, path_template, :put, options) + + request_url = @base_url || self.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options) promise = request.run_promise do |req| self.credentials.sign_request(req) unless self.credentials.nil? end @@ -294,10 +303,13 @@ def find_pets_by_status_async(status = nil, custom_headers = nil) path_template = '/pet/findByStatus' options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - query_params: {'status' => status}, + query_params: {'status' => status.join(',')}, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || self.base_url, path_template, :get, options) + + request_url = @base_url || self.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options) promise = request.run_promise do |req| self.credentials.sign_request(req) unless self.credentials.nil? end @@ -389,10 +401,13 @@ def find_pets_by_tags_async(tags = nil, custom_headers = nil) path_template = '/pet/findByTags' options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - query_params: {'tags' => tags}, + query_params: {'tags' => tags.join(',')}, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || self.base_url, path_template, :get, options) + + request_url = @base_url || self.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options) promise = request.run_promise do |req| self.credentials.sign_request(req) unless self.credentials.nil? end @@ -484,10 +499,13 @@ def find_pets_with_byte_array_async(pet_id, custom_headers = nil) path_template = '/pet/{petId}' options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'petId' => pet_id}, + path_params: {'petId' => pet_id.to_s}, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || self.base_url, path_template, :get, options) + + request_url = @base_url || self.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options) promise = request.run_promise do |req| self.credentials.sign_request(req) unless self.credentials.nil? end @@ -569,10 +587,13 @@ def get_pet_by_id_async(pet_id, custom_headers = nil) path_template = '/pet/{petId}' options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'petId' => pet_id}, + path_params: {'petId' => pet_id.to_s}, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || self.base_url, path_template, :get, options) + + request_url = @base_url || self.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options) promise = request.run_promise do |req| self.credentials.sign_request(req) unless self.credentials.nil? end @@ -656,7 +677,10 @@ def update_pet_with_form_async(pet_id, name = nil, status = nil, custom_headers path_params: {'petId' => pet_id}, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || self.base_url, path_template, :post, options) + + request_url = @base_url || self.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options) promise = request.run_promise do |req| self.credentials.sign_request(req) unless self.credentials.nil? end @@ -725,10 +749,13 @@ def delete_pet_async(pet_id, api_key = nil, custom_headers = nil) path_template = '/pet/{petId}' options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'petId' => pet_id}, + path_params: {'petId' => pet_id.to_s}, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || self.base_url, path_template, :delete, options) + + request_url = @base_url || self.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options) promise = request.run_promise do |req| self.credentials.sign_request(req) unless self.credentials.nil? end @@ -797,10 +824,13 @@ def upload_file_async(pet_id, additional_metadata = nil, file = nil, custom_head path_template = '/pet/{petId}/uploadImage' options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], - path_params: {'petId' => pet_id}, + path_params: {'petId' => pet_id.to_s}, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || self.base_url, path_template, :post, options) + + request_url = @base_url || self.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options) promise = request.run_promise do |req| self.credentials.sign_request(req) unless self.credentials.nil? end @@ -868,7 +898,10 @@ def get_inventory_async(custom_headers = nil) middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || self.base_url, path_template, :get, options) + + request_url = @base_url || self.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options) promise = request.run_promise do |req| self.credentials.sign_request(req) unless self.credentials.nil? end @@ -957,7 +990,10 @@ def place_order_async(body = nil, custom_headers = nil) body: request_content, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || self.base_url, path_template, :post, options) + + request_url = @base_url || self.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options) promise = request.run_promise do |req| self.credentials.sign_request(req) unless self.credentials.nil? end @@ -1045,7 +1081,10 @@ def get_order_by_id_async(order_id, custom_headers = nil) path_params: {'orderId' => order_id}, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || self.base_url, path_template, :get, options) + + request_url = @base_url || self.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options) promise = request.run_promise do |req| self.credentials.sign_request(req) unless self.credentials.nil? end @@ -1132,7 +1171,10 @@ def delete_order_async(order_id, custom_headers = nil) path_params: {'orderId' => order_id}, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || self.base_url, path_template, :delete, options) + + request_url = @base_url || self.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options) promise = request.run_promise do |req| self.credentials.sign_request(req) unless self.credentials.nil? end @@ -1211,7 +1253,10 @@ def create_user_async(body = nil, custom_headers = nil) body: request_content, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || self.base_url, path_template, :post, options) + + request_url = @base_url || self.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options) promise = request.run_promise do |req| self.credentials.sign_request(req) unless self.credentials.nil? end @@ -1291,7 +1336,10 @@ def create_users_with_array_input_async(body = nil, custom_headers = nil) body: request_content, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || self.base_url, path_template, :post, options) + + request_url = @base_url || self.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options) promise = request.run_promise do |req| self.credentials.sign_request(req) unless self.credentials.nil? end @@ -1371,7 +1419,10 @@ def create_users_with_list_input_async(body = nil, custom_headers = nil) body: request_content, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || self.base_url, path_template, :post, options) + + request_url = @base_url || self.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options) promise = request.run_promise do |req| self.credentials.sign_request(req) unless self.credentials.nil? end @@ -1440,7 +1491,10 @@ def login_user_async(username = nil, password = nil, custom_headers = nil) query_params: {'username' => username,'password' => password}, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || self.base_url, path_template, :get, options) + + request_url = @base_url || self.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options) promise = request.run_promise do |req| self.credentials.sign_request(req) unless self.credentials.nil? end @@ -1510,7 +1564,10 @@ def logout_user_async(custom_headers = nil) middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || self.base_url, path_template, :get, options) + + request_url = @base_url || self.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options) promise = request.run_promise do |req| self.credentials.sign_request(req) unless self.credentials.nil? end @@ -1580,7 +1637,10 @@ def get_user_by_name_async(username, custom_headers = nil) path_params: {'username' => username}, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || self.base_url, path_template, :get, options) + + request_url = @base_url || self.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options) promise = request.run_promise do |req| self.credentials.sign_request(req) unless self.credentials.nil? end @@ -1676,7 +1736,10 @@ def update_user_async(username, body = nil, custom_headers = nil) body: request_content, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || self.base_url, path_template, :put, options) + + request_url = @base_url || self.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options) promise = request.run_promise do |req| self.credentials.sign_request(req) unless self.credentials.nil? end @@ -1748,7 +1811,10 @@ def delete_user_async(username, custom_headers = nil) path_params: {'username' => username}, headers: request_headers.merge(custom_headers || {}) } - request = MsRest::HttpOperationRequest.new(@base_url || self.base_url, path_template, :delete, options) + + request_url = @base_url || self.base_url + + request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options) promise = request.run_promise do |req| self.credentials.sign_request(req) unless self.credentials.nil? end From dcdca06144c0f40fcda7e3cbc7a983b17e805c57 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 12 May 2016 15:36:40 -0700 Subject: [PATCH 23/27] Added null check for property --- .../CSharp/CSharp/ClientModelExtensions.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/AutoRest/Generators/CSharp/CSharp/ClientModelExtensions.cs b/AutoRest/Generators/CSharp/CSharp/ClientModelExtensions.cs index ff5f118022781..028322670e583 100644 --- a/AutoRest/Generators/CSharp/CSharp/ClientModelExtensions.cs +++ b/AutoRest/Generators/CSharp/CSharp/ClientModelExtensions.cs @@ -136,9 +136,14 @@ private static bool ShouldValidate(this IType model) /// checks for special cases such as acronyms and article words. /// /// The given property documentation to format - /// A reference of the property documentation + /// A reference to the property documentation public static string GetFormattedPropertyDocumentation(this Property property) { + if (property == null) + { + throw new ArgumentNullException("property"); + } + if (string.IsNullOrEmpty(property.Documentation)) { return property.Documentation.EscapeXmlComment(); @@ -149,13 +154,13 @@ public static string GetFormattedPropertyDocumentation(this Property property) string firstWord = property.Documentation.TrimStart().Split(' ').First(); if (firstWord.Length <= 1) { - documentation += char.ToLower(property.Documentation[0]) + property.Documentation.Substring(1); + documentation += char.ToLower(property.Documentation[0], CultureInfo.InvariantCulture) + property.Documentation.Substring(1); } else { - documentation += firstWord.ToUpper() == firstWord + documentation += firstWord.ToUpper(CultureInfo.InvariantCulture) == firstWord ? property.Documentation - : char.ToLower(property.Documentation[0]) + property.Documentation.Substring(1); + : char.ToLower(property.Documentation[0], CultureInfo.InvariantCulture) + property.Documentation.Substring(1); } return documentation.EscapeXmlComment(); From 61962779449aedfc486ab2e59fe247fb957078c9 Mon Sep 17 00:00:00 2001 From: Thomas Bombach Date: Thu, 12 May 2016 16:29:09 -0700 Subject: [PATCH 24/27] Updating the dockerfile to use AutoRest 0.16.0 --- Tools/dockerfiles/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tools/dockerfiles/Dockerfile b/Tools/dockerfiles/Dockerfile index dd223ea348932..a7b67824690b7 100644 --- a/Tools/dockerfiles/Dockerfile +++ b/Tools/dockerfiles/Dockerfile @@ -10,8 +10,8 @@ RUN apt-get -qqy update && \ RUN bash -c "\ mkdir /opt/autorest && \ cd /opt/autorest && \ - wget https://github.com/Azure/autorest/releases/download/AutoRest-0.15.0/autorest.0.15.0.zip && \ - unzip autorest.0.15.0.zip" + wget https://github.com/Azure/autorest/releases/download/AutoRest-0.16.0/autorest.0.16.0.zip && \ + unzip autorest.0.16.0.zip" ADD autorest /opt/autorest/autorest From 6de0b6d72609af91ded33d461b2ca9154d53d18c Mon Sep 17 00:00:00 2001 From: Vishrut Shah Date: Thu, 12 May 2016 18:22:03 -0700 Subject: [PATCH 25/27] Adding support for Unix date-time in ruby (#1014) --- .../Azure.Ruby/AzureClientModelExtensions.cs | 10 +++++++ .../Ruby.Tests/RspecTests/integer_spec.rb | 26 +++++++++++++++++-- .../Ruby/Ruby/ClientModelExtensions.cs | 10 +++++++ .../Generators/Ruby/Ruby/RubyCodeNamer.cs | 2 +- 4 files changed, 45 insertions(+), 3 deletions(-) diff --git a/AutoRest/Generators/Ruby/Azure.Ruby/AzureClientModelExtensions.cs b/AutoRest/Generators/Ruby/Azure.Ruby/AzureClientModelExtensions.cs index 13a93416ce55d..61699fbef07be 100644 --- a/AutoRest/Generators/Ruby/Azure.Ruby/AzureClientModelExtensions.cs +++ b/AutoRest/Generators/Ruby/Azure.Ruby/AzureClientModelExtensions.cs @@ -68,6 +68,11 @@ public static string AzureDeserializeType( { return builder.AppendLine("{0} = DateTime.parse({0}) unless {0}.to_s.empty?", valueReference).ToString(); } + + if (primary.Type == KnownPrimaryType.UnixTime) + { + return builder.AppendLine("{0} = DateTime.strptime({0}.to_s, '%s') unless {0}.to_s.empty?", valueReference).ToString(); + } } else if (enumType != null && !string.IsNullOrEmpty(enumType.Name)) { @@ -175,6 +180,11 @@ public static string AzureSerializeType( { return builder.AppendLine("{0} = {0}.new_offset(0).strftime('%a, %d %b %Y %H:%M:%S GMT')", valueReference).ToString(); } + + if (primary.Type == KnownPrimaryType.UnixTime) + { + return builder.AppendLine("{0} = {0}.new_offset(0).strftime('%s')", valueReference).ToString(); + } } else if (sequence != null) { diff --git a/AutoRest/Generators/Ruby/Ruby.Tests/RspecTests/integer_spec.rb b/AutoRest/Generators/Ruby/Ruby.Tests/RspecTests/integer_spec.rb index 2d118b8531760..f7556f6741a20 100644 --- a/AutoRest/Generators/Ruby/Ruby.Tests/RspecTests/integer_spec.rb +++ b/AutoRest/Generators/Ruby/Ruby.Tests/RspecTests/integer_spec.rb @@ -67,11 +67,33 @@ it 'should get null' do result = @int_client.get_null_async().value! - expect(result.response.status).to eq(200) - expect(result.body).to eq(nil) + expect(result.response.status).to eq(200) + expect(result.body).to eq(nil) end it 'should get invalid' do expect{ @int_client.get_invalid_async().value! }.to raise_error(MsRest::DeserializationError) end + + it 'should put unix time' do + result = @int_client.put_unix_time_date_async(DateTime.new(2016, 4, 13, 0, 0, 0, 'Z')).value! + expect(result.response.status).to eq(200) + expect(result.body).to eq(nil) + end + + it 'should get unix time' do + result = @int_client.get_unix_time_async().value! + expect(result.response.status).to eq(200) + expect(result.body).to eq(DateTime.new(2016, 4, 13, 0, 0, 0, 'Z')) + end + + it 'should get null unix time' do + result = @int_client.get_null_unix_time_async().value! + expect(result.response.status).to eq(200) + expect(result.body).to eq(nil) + end + + it 'should get invalid unix time' do + expect{ @int_client.get_invalid_unix_time_async().value! }.to raise_error(MsRest::DeserializationError) + end end \ No newline at end of file diff --git a/AutoRest/Generators/Ruby/Ruby/ClientModelExtensions.cs b/AutoRest/Generators/Ruby/Ruby/ClientModelExtensions.cs index 8a055ed3fe45a..853c37f8ea7e7 100644 --- a/AutoRest/Generators/Ruby/Ruby/ClientModelExtensions.cs +++ b/AutoRest/Generators/Ruby/Ruby/ClientModelExtensions.cs @@ -313,6 +313,11 @@ public static string DeserializeType( { return builder.AppendLine("{0} = DateTime.parse({0}) unless {0}.to_s.empty?", valueReference).ToString(); } + + if (primary.Type == KnownPrimaryType.UnixTime) + { + return builder.AppendLine("{0} = DateTime.strptime({0}.to_s, '%s') unless {0}.to_s.empty?", valueReference).ToString(); + } } else if (enumType != null && !string.IsNullOrEmpty(enumType.Name)) { @@ -415,6 +420,11 @@ public static string SerializeType( { return builder.AppendLine("{0} = {0}.new_offset(0).strftime('%a, %d %b %Y %H:%M:%S GMT')", valueReference).ToString(); } + + if (primary.Type == KnownPrimaryType.UnixTime) + { + return builder.AppendLine("{0} = {0}.new_offset(0).strftime('%s')", valueReference).ToString(); + } } else if (sequence != null) { diff --git a/AutoRest/Generators/Ruby/Ruby/RubyCodeNamer.cs b/AutoRest/Generators/Ruby/Ruby/RubyCodeNamer.cs index c40423ee1b4ae..3709e888fdb8c 100644 --- a/AutoRest/Generators/Ruby/Ruby/RubyCodeNamer.cs +++ b/AutoRest/Generators/Ruby/Ruby/RubyCodeNamer.cs @@ -374,7 +374,7 @@ private IType NormalizePrimaryType(PrimaryType primaryType) } else if (primaryType.Type == KnownPrimaryType.UnixTime) { - primaryType.Name = "Bignum"; + primaryType.Name = "DateTime"; } else if (primaryType.Type == KnownPrimaryType.Object) { From ac754e617d66ff24378bdca09755862479f6eec9 Mon Sep 17 00:00:00 2001 From: matthchr Date: Thu, 12 May 2016 18:42:04 -0700 Subject: [PATCH 26/27] Refactor parameter grouping and enable better comments - Parameter grouping code is clearer. - Models for parameter grouping now more clearly state what operations they are used on. --- .../Azure.Extensions/AzureExtensions.cs | 2 +- .../AutoRest.Generator.Extensions.csproj | 1 + .../Extensions/Extensions/Extensions.cs | 137 +---------- .../ParameterGroupExtensionHelper.cs | 229 ++++++++++++++++++ .../Azure.Python/AzurePythonCodeGenerator.cs | 2 +- 5 files changed, 233 insertions(+), 138 deletions(-) create mode 100644 AutoRest/Generators/Extensions/Extensions/ParameterGroupExtensionHelper.cs diff --git a/AutoRest/Generators/Extensions/Azure.Extensions/AzureExtensions.cs b/AutoRest/Generators/Extensions/Azure.Extensions/AzureExtensions.cs index c38246fdccd61..d4863ccf8beb9 100644 --- a/AutoRest/Generators/Extensions/Azure.Extensions/AzureExtensions.cs +++ b/AutoRest/Generators/Extensions/Azure.Extensions/AzureExtensions.cs @@ -77,7 +77,7 @@ public static void NormalizeAzureClientModel(ServiceClient serviceClient, Settin ParseODataExtension(serviceClient); FlattenModels(serviceClient); FlattenMethodParameters(serviceClient, settings); - AddParameterGroups(serviceClient); + ParameterGroupExtensionHelper.AddParameterGroups(serviceClient); AddLongRunningOperations(serviceClient); AddAzureProperties(serviceClient); SetDefaultResponses(serviceClient); diff --git a/AutoRest/Generators/Extensions/Extensions/AutoRest.Generator.Extensions.csproj b/AutoRest/Generators/Extensions/Extensions/AutoRest.Generator.Extensions.csproj index b5ca288802491..baeb25e146303 100644 --- a/AutoRest/Generators/Extensions/Extensions/AutoRest.Generator.Extensions.csproj +++ b/AutoRest/Generators/Extensions/Extensions/AutoRest.Generator.Extensions.csproj @@ -27,6 +27,7 @@ + True diff --git a/AutoRest/Generators/Extensions/Extensions/Extensions.cs b/AutoRest/Generators/Extensions/Extensions/Extensions.cs index 44b69bfea2122..2016e53f1fb60 100644 --- a/AutoRest/Generators/Extensions/Extensions/Extensions.cs +++ b/AutoRest/Generators/Extensions/Extensions/Extensions.cs @@ -44,7 +44,7 @@ public static void NormalizeClientModel(ServiceClient serviceClient, Settings se { FlattenModels(serviceClient); FlattenMethodParameters(serviceClient, settings); - AddParameterGroups(serviceClient); + ParameterGroupExtensionHelper.AddParameterGroups(serviceClient); ProcessParameterizedHost(serviceClient, settings); } @@ -333,141 +333,6 @@ public static void RemoveUnreferencedTypes(ServiceClient serviceClient, HashSet< } } - /// - /// Adds the parameter groups to operation parameters. - /// - /// - public static void AddParameterGroups(ServiceClient serviceClient) - { - if (serviceClient == null) - { - throw new ArgumentNullException("serviceClient"); - } - - HashSet generatedParameterGroups = new HashSet(); - - foreach (Method method in serviceClient.Methods) - { - //Copy out flattening transformations as they should be the last - List flatteningTransformations = method.InputParameterTransformation.ToList(); - method.InputParameterTransformation.Clear(); - - //This group name is normalized by each languages code generator later, so it need not happen here. - Dictionary> parameterGroups = new Dictionary>(); - - foreach (Parameter parameter in method.Parameters) - { - if (parameter.Extensions.ContainsKey(ParameterGroupExtension)) - { - JContainer extensionObject = parameter.Extensions[ParameterGroupExtension] as JContainer; - if (extensionObject != null) - { - string specifiedGroupName = extensionObject.Value("name"); - string parameterGroupName; - if (specifiedGroupName == null) - { - string postfix = extensionObject.Value("postfix") ?? "Parameters"; - parameterGroupName = method.Group + "-" + method.Name + "-" + postfix; - } - else - { - parameterGroupName = specifiedGroupName; - } - - if (!parameterGroups.ContainsKey(parameterGroupName)) - { - parameterGroups.Add(parameterGroupName, new Dictionary()); - } - - Property groupProperty = new Property() - { - IsReadOnly = false, //Since these properties are used as parameters they are never read only - Name = parameter.Name, - IsRequired = parameter.IsRequired, - DefaultValue = parameter.DefaultValue, - //Constraints = parameter.Constraints, Omit these since we don't want to perform parameter validation - Documentation = parameter.Documentation, - Type = parameter.Type, - SerializedName = null //Parameter is never serialized directly - }; - // Copy over extensions - foreach (var key in parameter.Extensions.Keys) - { - groupProperty.Extensions[key] = parameter.Extensions[key]; - } - - parameterGroups[parameterGroupName].Add(groupProperty, parameter); - } - } - } - - foreach (string parameterGroupName in parameterGroups.Keys) - { - CompositeType parameterGroupType = - generatedParameterGroups.FirstOrDefault(item => item.Name == parameterGroupName); - if (parameterGroupType == null) - { - parameterGroupType = new CompositeType - { - Name = parameterGroupName, - Documentation = "Additional parameters for one or more operations" - }; - generatedParameterGroups.Add(parameterGroupType); - - //Add to the service client - serviceClient.ModelTypes.Add(parameterGroupType); - } - foreach (Property property in parameterGroups[parameterGroupName].Keys) - { - Property matchingProperty = parameterGroupType.Properties.FirstOrDefault( - item => item.Name == property.Name && - item.IsReadOnly == property.IsReadOnly && - item.DefaultValue == property.DefaultValue && - item.SerializedName == property.SerializedName); - if (matchingProperty == null) - { - parameterGroupType.Properties.Add(property); - } - } - - bool isGroupParameterRequired = parameterGroupType.Properties.Any(p => p.IsRequired); - - //Create the new parameter object based on the parameter group type - Parameter parameterGroup = new Parameter() - { - Name = parameterGroupName, - IsRequired = isGroupParameterRequired, - Location = ClientModel.ParameterLocation.None, - SerializedName = string.Empty, - Type = parameterGroupType, - Documentation = "Additional parameters for the operation" - }; - - method.Parameters.Add(parameterGroup); - - //Link the grouped parameters to their parent, and remove them from the method parameters - foreach (Property property in parameterGroups[parameterGroupName].Keys) - { - Parameter p = parameterGroups[parameterGroupName][property]; - - var parameterTransformation = new ParameterTransformation - { - OutputParameter = p - }; - parameterTransformation.ParameterMappings.Add(new ParameterMapping - { - InputParameter = parameterGroup, - InputParameterProperty = property.GetClientName() - }); - method.InputParameterTransformation.Add(parameterTransformation); - method.Parameters.Remove(p); - } - } - - // Copy back flattening transformations if any - flatteningTransformations.ForEach(t => method.InputParameterTransformation.Add(t)); - } - } /// /// Flattens the request payload if the number of properties of the diff --git a/AutoRest/Generators/Extensions/Extensions/ParameterGroupExtensionHelper.cs b/AutoRest/Generators/Extensions/Extensions/ParameterGroupExtensionHelper.cs new file mode 100644 index 0000000000000..5a97e2619f79f --- /dev/null +++ b/AutoRest/Generators/Extensions/Extensions/ParameterGroupExtensionHelper.cs @@ -0,0 +1,229 @@ +namespace Microsoft.Rest.Generator +{ + using System; + using System.Collections.Generic; + using System.Globalization; + using System.Linq; + using System.Text; + using System.Threading.Tasks; + using ClientModel; + using Newtonsoft.Json.Linq; + + public static class ParameterGroupExtensionHelper + { + private class ParameterGroup + { + public string Name { get; } + + public Dictionary ParameterMapping { get; } + + public ParameterGroup(string name, Dictionary parameterMapping) + { + this.Name = name; + this.ParameterMapping = parameterMapping; + } + } + + private static Property CreateParameterGroupProperty(Parameter parameter) + { + Property groupProperty = new Property() + { + IsReadOnly = false, //Since these properties are used as parameters they are never read only + Name = parameter.Name, + IsRequired = parameter.IsRequired, + DefaultValue = parameter.DefaultValue, + //Constraints = parameter.Constraints, Omit these since we don't want to perform parameter validation + Documentation = parameter.Documentation, + Type = parameter.Type, + SerializedName = null //Parameter is never serialized directly + }; + + // Copy over extensions + foreach (var key in parameter.Extensions.Keys) + { + groupProperty.Extensions[key] = parameter.Extensions[key]; + } + + return groupProperty; + } + + private static ParameterGroup BuildParameterGroup(string parameterGroupName, Method method) + { + Dictionary parameterMapping = method.Parameters.Where( + p => GetParameterGroupName(method.Group, method.Name, p) == parameterGroupName).ToDictionary( + CreateParameterGroupProperty, + p => p); + + return new ParameterGroup(parameterGroupName, parameterMapping); + } + + private static string GetParameterGroupName(string methodGroupName, string methodName, Parameter parameter) + { + if (parameter.Extensions.ContainsKey(Extensions.ParameterGroupExtension)) + { + JContainer extensionObject = parameter.Extensions[Extensions.ParameterGroupExtension] as JContainer; + if (extensionObject != null) + { + string specifiedGroupName = extensionObject.Value("name"); + string parameterGroupName; + if (specifiedGroupName == null) + { + string postfix = extensionObject.Value("postfix") ?? "Parameters"; + parameterGroupName = methodGroupName + "-" + methodName + "-" + postfix; + } + else + { + parameterGroupName = specifiedGroupName; + } + return parameterGroupName; + } + } + + return null; + } + + private static IEnumerable ExtractParameterGroupNames(Method method) + { + return method.Parameters.Select(p => GetParameterGroupName(method.Group, method.Name, p)).Where(name => !string.IsNullOrEmpty(name)).Distinct(); + } + + private static IEnumerable ExtractParameterGroups(Method method) + { + IEnumerable parameterGroupNames = ExtractParameterGroupNames(method); + + return parameterGroupNames.Select(parameterGroupName => BuildParameterGroup(parameterGroupName, method)); + } + + private static IEnumerable GetMethodsUsingParameterGroup(IEnumerable methods, ParameterGroup parameterGroup) + { + return methods.Where(m => ExtractParameterGroupNames(m).Contains(parameterGroup.Name)); + } + + private static string GenerateParameterGroupModelText(IEnumerable methodsWhichUseGroup) + { + Func createOperationDisplayString = (group, name) => + { + return string.IsNullOrEmpty(group) ? name : string.Format(CultureInfo.InvariantCulture, "{0}_{1}", group, name); + }; + + List methodList = methodsWhichUseGroup.ToList(); + if (methodList.Count == 1) + { + Method method = methodList.Single(); + return string.Format(CultureInfo.InvariantCulture, "Additional parameters for the {0} operation.", + createOperationDisplayString(method.Group, method.Name)); + } + else if (methodList.Count <= 4) + { + string operationsString = string.Join(", ", methodList.Select( + m => string.Format(CultureInfo.InvariantCulture, createOperationDisplayString(m.Group, m.Name)))); + + return string.Format(CultureInfo.InvariantCulture, "Additional parameters for a set of operations, such as: {0}.", operationsString); + } + else + { + return "Additional parameters for a set of operations."; + } + } + + /// + /// Adds the parameter groups to operation parameters. + /// + /// + public static void AddParameterGroups(ServiceClient serviceClient) + { + if (serviceClient == null) + { + throw new ArgumentNullException("serviceClient"); + } + + HashSet generatedParameterGroups = new HashSet(); + + foreach (Method method in serviceClient.Methods) + { + //Copy out flattening transformations as they should be the last + List flatteningTransformations = method.InputParameterTransformation.ToList(); + method.InputParameterTransformation.Clear(); + + //This group name is normalized by each languages code generator later, so it need not happen here. + IEnumerable parameterGroups = ExtractParameterGroups(method); + + List parametersToAddToMethod = new List(); + List parametersToRemoveFromMethod = new List(); + + foreach (ParameterGroup parameterGroup in parameterGroups) + { + CompositeType parameterGroupType = + generatedParameterGroups.FirstOrDefault(item => item.Name == parameterGroup.Name); + + if (parameterGroupType == null) + { + IEnumerable methodsWhichUseGroup = GetMethodsUsingParameterGroup(serviceClient.Methods, parameterGroup); + + parameterGroupType = new CompositeType + { + Name = parameterGroup.Name, + Documentation = GenerateParameterGroupModelText(methodsWhichUseGroup) + }; + generatedParameterGroups.Add(parameterGroupType); + + //Add to the service client + serviceClient.ModelTypes.Add(parameterGroupType); + } + + foreach (Property property in parameterGroup.ParameterMapping.Keys) + { + Property matchingProperty = parameterGroupType.Properties.FirstOrDefault( + item => item.Name == property.Name && + item.IsReadOnly == property.IsReadOnly && + item.DefaultValue == property.DefaultValue && + item.SerializedName == property.SerializedName); + if (matchingProperty == null) + { + parameterGroupType.Properties.Add(property); + } + } + + bool isGroupParameterRequired = parameterGroupType.Properties.Any(p => p.IsRequired); + + //Create the new parameter object based on the parameter group type + Parameter newParameter = new Parameter() + { + Name = parameterGroup.Name, + IsRequired = isGroupParameterRequired, + Location = ClientModel.ParameterLocation.None, + SerializedName = string.Empty, + Type = parameterGroupType, + Documentation = "Additional parameters for the operation" + }; + parametersToAddToMethod.Add(newParameter); + + //Link the grouped parameters to their parent, and remove them from the method parameters + foreach (Property property in parameterGroup.ParameterMapping.Keys) + { + Parameter p = parameterGroup.ParameterMapping[property]; + + var parameterTransformation = new ParameterTransformation + { + OutputParameter = p + }; + + parameterTransformation.ParameterMappings.Add(new ParameterMapping + { + InputParameter = newParameter, + InputParameterProperty = property.GetClientName() + }); + method.InputParameterTransformation.Add(parameterTransformation); + parametersToRemoveFromMethod.Add(p); + } + } + + method.Parameters.RemoveAll(p => parametersToRemoveFromMethod.Contains(p)); + method.Parameters.AddRange(parametersToAddToMethod); + + // Copy back flattening transformations if any + flatteningTransformations.ForEach(t => method.InputParameterTransformation.Add(t)); + } + } + } +} diff --git a/AutoRest/Generators/Python/Azure.Python/AzurePythonCodeGenerator.cs b/AutoRest/Generators/Python/Azure.Python/AzurePythonCodeGenerator.cs index eeb311593bb52..2bc8932aa11fc 100644 --- a/AutoRest/Generators/Python/Azure.Python/AzurePythonCodeGenerator.cs +++ b/AutoRest/Generators/Python/Azure.Python/AzurePythonCodeGenerator.cs @@ -62,7 +62,7 @@ public override void NormalizeClientModel(ServiceClient serviceClient) AzureExtensions.UpdateHeadMethods(serviceClient); AzureExtensions.ParseODataExtension(serviceClient); Extensions.FlattenModels(serviceClient); - Extensions.AddParameterGroups(serviceClient); + ParameterGroupExtensionHelper.AddParameterGroups(serviceClient); AzureExtensions.AddAzureProperties(serviceClient); AzureExtensions.SetDefaultResponses(serviceClient); CorrectFilterParameters(serviceClient); From a0a620d51869738790e5fa45f14624fbf372e071 Mon Sep 17 00:00:00 2001 From: matthchr Date: Thu, 12 May 2016 18:52:47 -0700 Subject: [PATCH 27/27] Regenerate expected --- .../Models/FirstParameterGroup.cs | 4 +++- ...terGroupingPostMultiParamGroupsSecondParamGroup.cs | 3 ++- .../Models/ParameterGroupingPostOptionalParameters.cs | 2 +- .../Models/ParameterGroupingPostRequiredParameters.cs | 2 +- .../Paging/Models/PagingGetMultiplePagesOptions.cs | 2 +- .../Models/PagingGetMultiplePagesWithOffsetOptions.cs | 3 ++- .../ModelFlattening/Models/FlattenParameterGroup.cs | 2 +- .../models/FirstParameterGroup.java | 4 +++- ...rGroupingPostMultiParamGroupsSecondParamGroup.java | 3 ++- .../ParameterGroupingPostOptionalParameters.java | 2 +- .../ParameterGroupingPostRequiredParameters.java | 2 +- .../paging/models/PagingGetMultiplePagesOptions.java | 2 +- .../PagingGetMultiplePagesWithOffsetOptions.java | 2 +- .../modelflattening/models/FlattenParameterGroup.java | 2 +- .../models/firstParameterGroup.js | 4 +++- .../AzureParameterGrouping/models/index.d.ts | 11 +++++++---- ...terGroupingPostMultiParamGroupsSecondParamGroup.js | 3 ++- .../models/parameterGroupingPostOptionalParameters.js | 2 +- .../models/parameterGroupingPostRequiredParameters.js | 2 +- .../Expected/AcceptanceTests/Paging/models/index.d.ts | 4 ++-- .../Paging/models/pagingGetMultiplePagesOptions.js | 2 +- .../models/pagingGetMultiplePagesWithOffsetOptions.js | 2 +- .../ModelFlattening/models/flattenParameterGroup.js | 2 +- .../AcceptanceTests/ModelFlattening/models/index.d.ts | 2 +- .../models/first_parameter_group.py | 4 +++- ...ping_post_multi_param_groups_second_param_group.py | 3 ++- .../parameter_grouping_post_optional_parameters.py | 2 +- .../parameter_grouping_post_required_parameters.py | 2 +- .../models/paging_get_multiple_pages_options.py | 2 +- .../paging_get_multiple_pages_with_offset_options.py | 2 +- .../models/flatten_parameter_group.py | 2 +- 31 files changed, 51 insertions(+), 35 deletions(-) diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/FirstParameterGroup.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/FirstParameterGroup.cs index 64544e0994a33..4e2fe34867c21 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/FirstParameterGroup.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/FirstParameterGroup.cs @@ -17,7 +17,9 @@ namespace Fixtures.Azure.AcceptanceTestsAzureParameterGrouping.Models using Microsoft.Rest.Azure; /// - /// Additional parameters for one or more operations + /// Additional parameters for a set of operations, such as: + /// parameterGrouping_postMultiParamGroups, + /// parameterGrouping_postSharedParameterGroupObject. /// public partial class FirstParameterGroup { diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/ParameterGroupingPostMultiParamGroupsSecondParamGroup.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/ParameterGroupingPostMultiParamGroupsSecondParamGroup.cs index 874e8e1d79929..6d81fef18781c 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/ParameterGroupingPostMultiParamGroupsSecondParamGroup.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/ParameterGroupingPostMultiParamGroupsSecondParamGroup.cs @@ -17,7 +17,8 @@ namespace Fixtures.Azure.AcceptanceTestsAzureParameterGrouping.Models using Microsoft.Rest.Azure; /// - /// Additional parameters for one or more operations + /// Additional parameters for the parameterGrouping_postMultiParamGroups + /// operation. /// public partial class ParameterGroupingPostMultiParamGroupsSecondParamGroup { diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/ParameterGroupingPostOptionalParameters.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/ParameterGroupingPostOptionalParameters.cs index 7dce24800e0f0..3a3dcc12562a8 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/ParameterGroupingPostOptionalParameters.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/ParameterGroupingPostOptionalParameters.cs @@ -17,7 +17,7 @@ namespace Fixtures.Azure.AcceptanceTestsAzureParameterGrouping.Models using Microsoft.Rest.Azure; /// - /// Additional parameters for one or more operations + /// Additional parameters for the parameterGrouping_postOptional operation. /// public partial class ParameterGroupingPostOptionalParameters { diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/ParameterGroupingPostRequiredParameters.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/ParameterGroupingPostRequiredParameters.cs index 7f1bd8dfc24dd..4251abe07005e 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/ParameterGroupingPostRequiredParameters.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureParameterGrouping/Models/ParameterGroupingPostRequiredParameters.cs @@ -17,7 +17,7 @@ namespace Fixtures.Azure.AcceptanceTestsAzureParameterGrouping.Models using Microsoft.Rest.Azure; /// - /// Additional parameters for one or more operations + /// Additional parameters for the parameterGrouping_postRequired operation. /// public partial class ParameterGroupingPostRequiredParameters { diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/Models/PagingGetMultiplePagesOptions.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/Models/PagingGetMultiplePagesOptions.cs index cd420389a93e4..2c900f171ed91 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/Models/PagingGetMultiplePagesOptions.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/Models/PagingGetMultiplePagesOptions.cs @@ -17,7 +17,7 @@ namespace Fixtures.Azure.AcceptanceTestsPaging.Models using Microsoft.Rest.Azure; /// - /// Additional parameters for one or more operations + /// Additional parameters for the Paging_getMultiplePages operation. /// public partial class PagingGetMultiplePagesOptions { diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/Models/PagingGetMultiplePagesWithOffsetOptions.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/Models/PagingGetMultiplePagesWithOffsetOptions.cs index 91c7ecd834f40..076d5bf8587b8 100644 --- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/Models/PagingGetMultiplePagesWithOffsetOptions.cs +++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/Paging/Models/PagingGetMultiplePagesWithOffsetOptions.cs @@ -17,7 +17,8 @@ namespace Fixtures.Azure.AcceptanceTestsPaging.Models using Microsoft.Rest.Azure; /// - /// Additional parameters for one or more operations + /// Additional parameters for the Paging_getMultiplePagesWithOffset + /// operation. /// public partial class PagingGetMultiplePagesWithOffsetOptions { diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/FlattenParameterGroup.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/FlattenParameterGroup.cs index b80bf2fa6210d..fac4cd5c66e3d 100644 --- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/FlattenParameterGroup.cs +++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/AcceptanceTests/ModelFlattening/Models/FlattenParameterGroup.cs @@ -16,7 +16,7 @@ namespace Fixtures.AcceptanceTestsModelFlattening.Models using Microsoft.Rest.Serialization; /// - /// Additional parameters for one or more operations + /// Additional parameters for the putSimpleProductWithGrouping operation. /// [JsonTransformation] public partial class FlattenParameterGroup diff --git a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/FirstParameterGroup.java b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/FirstParameterGroup.java index 11a3b19314227..bbe5038e8892e 100644 --- a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/FirstParameterGroup.java +++ b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/FirstParameterGroup.java @@ -13,7 +13,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Additional parameters for one or more operations. + * Additional parameters for a set of operations, such as: + * parameterGrouping_postMultiParamGroups, + * parameterGrouping_postSharedParameterGroupObject. */ public class FirstParameterGroup { /** diff --git a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostMultiParamGroupsSecondParamGroup.java b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostMultiParamGroupsSecondParamGroup.java index 62b198e1819b3..e8c9db90cc753 100644 --- a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostMultiParamGroupsSecondParamGroup.java +++ b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostMultiParamGroupsSecondParamGroup.java @@ -13,7 +13,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Additional parameters for one or more operations. + * Additional parameters for the parameterGrouping_postMultiParamGroups + * operation. */ public class ParameterGroupingPostMultiParamGroupsSecondParamGroup { /** diff --git a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostOptionalParameters.java b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostOptionalParameters.java index ca1acfaa80941..8177eb2257697 100644 --- a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostOptionalParameters.java +++ b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostOptionalParameters.java @@ -13,7 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Additional parameters for one or more operations. + * Additional parameters for the parameterGrouping_postOptional operation. */ public class ParameterGroupingPostOptionalParameters { /** diff --git a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostRequiredParameters.java b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostRequiredParameters.java index 729b020e4dfbf..98f0a230bc383 100644 --- a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostRequiredParameters.java +++ b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostRequiredParameters.java @@ -13,7 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Additional parameters for one or more operations. + * Additional parameters for the parameterGrouping_postRequired operation. */ public class ParameterGroupingPostRequiredParameters { /** diff --git a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/paging/models/PagingGetMultiplePagesOptions.java b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/paging/models/PagingGetMultiplePagesOptions.java index c00d7b13f0370..0ce6b1680d2f3 100644 --- a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/paging/models/PagingGetMultiplePagesOptions.java +++ b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/paging/models/PagingGetMultiplePagesOptions.java @@ -13,7 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Additional parameters for one or more operations. + * Additional parameters for the Paging_getMultiplePages operation. */ public class PagingGetMultiplePagesOptions { /** diff --git a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/paging/models/PagingGetMultiplePagesWithOffsetOptions.java b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/paging/models/PagingGetMultiplePagesWithOffsetOptions.java index d2c8350978d67..1cff9918a4fee 100644 --- a/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/paging/models/PagingGetMultiplePagesWithOffsetOptions.java +++ b/AutoRest/Generators/Java/Azure.Java.Tests/src/main/java/fixtures/paging/models/PagingGetMultiplePagesWithOffsetOptions.java @@ -13,7 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Additional parameters for one or more operations. + * Additional parameters for the Paging_getMultiplePagesWithOffset operation. */ public class PagingGetMultiplePagesWithOffsetOptions { /** diff --git a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/modelflattening/models/FlattenParameterGroup.java b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/modelflattening/models/FlattenParameterGroup.java index 557060fba52c1..342b622a71f03 100644 --- a/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/modelflattening/models/FlattenParameterGroup.java +++ b/AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/modelflattening/models/FlattenParameterGroup.java @@ -14,7 +14,7 @@ import com.microsoft.rest.serializer.JsonFlatten; /** - * Additional parameters for one or more operations. + * Additional parameters for the putSimpleProductWithGrouping operation. */ @JsonFlatten public class FlattenParameterGroup { diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/firstParameterGroup.js b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/firstParameterGroup.js index ba3b0d7727b98..30da6b2ad3c63 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/firstParameterGroup.js +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/firstParameterGroup.js @@ -14,7 +14,9 @@ * @class * Initializes a new instance of the FirstParameterGroup class. * @constructor - * Additional parameters for one or more operations + * Additional parameters for a set of operations, such as: + * parameterGrouping_postMultiParamGroups, + * parameterGrouping_postSharedParameterGroupObject. * @member {string} [headerOne] * * @member {number} [queryOne] Query parameter with default. Default value: 30 diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/index.d.ts b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/index.d.ts index 9456f4830bfc2..16a7ffc754ca4 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/index.d.ts +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/index.d.ts @@ -28,7 +28,7 @@ export interface ErrorModel { * @class * Initializes a new instance of the ParameterGroupingPostRequiredParameters class. * @constructor - * Additional parameters for one or more operations + * Additional parameters for the parameterGrouping_postRequired operation. * @member {number} body * * @member {string} [customHeader] @@ -49,7 +49,7 @@ export interface ParameterGroupingPostRequiredParameters { * @class * Initializes a new instance of the ParameterGroupingPostOptionalParameters class. * @constructor - * Additional parameters for one or more operations + * Additional parameters for the parameterGrouping_postOptional operation. * @member {string} [customHeader] * * @member {number} [query] Query parameter with default @@ -64,7 +64,9 @@ export interface ParameterGroupingPostOptionalParameters { * @class * Initializes a new instance of the FirstParameterGroup class. * @constructor - * Additional parameters for one or more operations + * Additional parameters for a set of operations, such as: + * parameterGrouping_postMultiParamGroups, + * parameterGrouping_postSharedParameterGroupObject. * @member {string} [headerOne] * * @member {number} [queryOne] Query parameter with default @@ -79,7 +81,8 @@ export interface FirstParameterGroup { * @class * Initializes a new instance of the ParameterGroupingPostMultiParamGroupsSecondParamGroup class. * @constructor - * Additional parameters for one or more operations + * Additional parameters for the parameterGrouping_postMultiParamGroups + * operation. * @member {string} [headerTwo] * * @member {number} [queryTwo] Query parameter with default diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/parameterGroupingPostMultiParamGroupsSecondParamGroup.js b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/parameterGroupingPostMultiParamGroupsSecondParamGroup.js index 372e9841d5145..430f4f669f12c 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/parameterGroupingPostMultiParamGroupsSecondParamGroup.js +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/parameterGroupingPostMultiParamGroupsSecondParamGroup.js @@ -14,7 +14,8 @@ * @class * Initializes a new instance of the ParameterGroupingPostMultiParamGroupsSecondParamGroup class. * @constructor - * Additional parameters for one or more operations + * Additional parameters for the parameterGrouping_postMultiParamGroups + * operation. * @member {string} [headerTwo] * * @member {number} [queryTwo] Query parameter with default. Default value: 30 diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/parameterGroupingPostOptionalParameters.js b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/parameterGroupingPostOptionalParameters.js index c0f6f1b6635a6..b100000a14aee 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/parameterGroupingPostOptionalParameters.js +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/parameterGroupingPostOptionalParameters.js @@ -14,7 +14,7 @@ * @class * Initializes a new instance of the ParameterGroupingPostOptionalParameters class. * @constructor - * Additional parameters for one or more operations + * Additional parameters for the parameterGrouping_postOptional operation. * @member {string} [customHeader] * * @member {number} [query] Query parameter with default. Default value: 30 . diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/parameterGroupingPostRequiredParameters.js b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/parameterGroupingPostRequiredParameters.js index ca7054de32923..70dfd11124694 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/parameterGroupingPostRequiredParameters.js +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/AzureParameterGrouping/models/parameterGroupingPostRequiredParameters.js @@ -14,7 +14,7 @@ * @class * Initializes a new instance of the ParameterGroupingPostRequiredParameters class. * @constructor - * Additional parameters for one or more operations + * Additional parameters for the parameterGrouping_postRequired operation. * @member {number} body * * @member {string} [customHeader] diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Paging/models/index.d.ts b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Paging/models/index.d.ts index 3f94c15e7a4b4..4df2fb2dc1100 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Paging/models/index.d.ts +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Paging/models/index.d.ts @@ -56,7 +56,7 @@ export interface OperationResult { * @class * Initializes a new instance of the PagingGetMultiplePagesOptions class. * @constructor - * Additional parameters for one or more operations + * Additional parameters for the Paging_getMultiplePages operation. * @member {number} [maxresults] Sets the maximum number of items to return in * the response. * @@ -73,7 +73,7 @@ export interface PagingGetMultiplePagesOptions { * @class * Initializes a new instance of the PagingGetMultiplePagesWithOffsetOptions class. * @constructor - * Additional parameters for one or more operations + * Additional parameters for the Paging_getMultiplePagesWithOffset operation. * @member {number} [maxresults] Sets the maximum number of items to return in * the response. * diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Paging/models/pagingGetMultiplePagesOptions.js b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Paging/models/pagingGetMultiplePagesOptions.js index 5c7103c374193..054ea7a991213 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Paging/models/pagingGetMultiplePagesOptions.js +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Paging/models/pagingGetMultiplePagesOptions.js @@ -14,7 +14,7 @@ * @class * Initializes a new instance of the PagingGetMultiplePagesOptions class. * @constructor - * Additional parameters for one or more operations + * Additional parameters for the Paging_getMultiplePages operation. * @member {number} [maxresults] Sets the maximum number of items to return in * the response. * diff --git a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Paging/models/pagingGetMultiplePagesWithOffsetOptions.js b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Paging/models/pagingGetMultiplePagesWithOffsetOptions.js index 1398c4f710fac..03b9df22d91a4 100644 --- a/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Paging/models/pagingGetMultiplePagesWithOffsetOptions.js +++ b/AutoRest/Generators/NodeJS/Azure.NodeJS.Tests/Expected/AcceptanceTests/Paging/models/pagingGetMultiplePagesWithOffsetOptions.js @@ -14,7 +14,7 @@ * @class * Initializes a new instance of the PagingGetMultiplePagesWithOffsetOptions class. * @constructor - * Additional parameters for one or more operations + * Additional parameters for the Paging_getMultiplePagesWithOffset operation. * @member {number} [maxresults] Sets the maximum number of items to return in * the response. * diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/ModelFlattening/models/flattenParameterGroup.js b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/ModelFlattening/models/flattenParameterGroup.js index e034f91979bfb..d548e2c6afea8 100644 --- a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/ModelFlattening/models/flattenParameterGroup.js +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/ModelFlattening/models/flattenParameterGroup.js @@ -14,7 +14,7 @@ * @class * Initializes a new instance of the FlattenParameterGroup class. * @constructor - * Additional parameters for one or more operations + * Additional parameters for the putSimpleProductWithGrouping operation. * @member {string} name Product name with value 'groupproduct' * * @member {string} productId Unique identifier representing a specific diff --git a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/ModelFlattening/models/index.d.ts b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/ModelFlattening/models/index.d.ts index ea95cb0f14945..a105800deac0a 100644 --- a/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/ModelFlattening/models/index.d.ts +++ b/AutoRest/Generators/NodeJS/NodeJS.Tests/Expected/AcceptanceTests/ModelFlattening/models/index.d.ts @@ -137,7 +137,7 @@ export interface SimpleProduct extends BaseProduct { * @class * Initializes a new instance of the FlattenParameterGroup class. * @constructor - * Additional parameters for one or more operations + * Additional parameters for the putSimpleProductWithGrouping operation. * @member {string} name Product name with value 'groupproduct' * * @member {string} productId Unique identifier representing a specific diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/first_parameter_group.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/first_parameter_group.py index dec4f136004f7..172a4349ff36c 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/first_parameter_group.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/first_parameter_group.py @@ -14,7 +14,9 @@ class FirstParameterGroup(Model): """ - Additional parameters for one or more operations + Additional parameters for a set of operations, such as: + parameterGrouping_postMultiParamGroups, + parameterGrouping_postSharedParameterGroupObject. :param header_one: :type header_one: str diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/parameter_grouping_post_multi_param_groups_second_param_group.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/parameter_grouping_post_multi_param_groups_second_param_group.py index 4d4af238358bc..bccdfab25480f 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/parameter_grouping_post_multi_param_groups_second_param_group.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/parameter_grouping_post_multi_param_groups_second_param_group.py @@ -14,7 +14,8 @@ class ParameterGroupingPostMultiParamGroupsSecondParamGroup(Model): """ - Additional parameters for one or more operations + Additional parameters for the parameterGrouping_postMultiParamGroups + operation. :param header_two: :type header_two: str diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/parameter_grouping_post_optional_parameters.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/parameter_grouping_post_optional_parameters.py index 623b79fd0feee..a62313adf9a27 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/parameter_grouping_post_optional_parameters.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/parameter_grouping_post_optional_parameters.py @@ -14,7 +14,7 @@ class ParameterGroupingPostOptionalParameters(Model): """ - Additional parameters for one or more operations + Additional parameters for the parameterGrouping_postOptional operation. :param custom_header: :type custom_header: str diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/parameter_grouping_post_required_parameters.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/parameter_grouping_post_required_parameters.py index 109ebe5ad51e0..409f4ffcdcf26 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/parameter_grouping_post_required_parameters.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/parameter_grouping_post_required_parameters.py @@ -14,7 +14,7 @@ class ParameterGroupingPostRequiredParameters(Model): """ - Additional parameters for one or more operations + Additional parameters for the parameterGrouping_postRequired operation. :param body: :type body: int diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/autorestpagingtestservice/models/paging_get_multiple_pages_options.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/autorestpagingtestservice/models/paging_get_multiple_pages_options.py index 4fcaf367d51bc..15ba71465cac8 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/autorestpagingtestservice/models/paging_get_multiple_pages_options.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/autorestpagingtestservice/models/paging_get_multiple_pages_options.py @@ -14,7 +14,7 @@ class PagingGetMultiplePagesOptions(Model): """ - Additional parameters for one or more operations + Additional parameters for the Paging_getMultiplePages operation. :param maxresults: Sets the maximum number of items to return in the response. diff --git a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/autorestpagingtestservice/models/paging_get_multiple_pages_with_offset_options.py b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/autorestpagingtestservice/models/paging_get_multiple_pages_with_offset_options.py index 48ed388233daf..23e7a887f274c 100644 --- a/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/autorestpagingtestservice/models/paging_get_multiple_pages_with_offset_options.py +++ b/AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/Paging/autorestpagingtestservice/models/paging_get_multiple_pages_with_offset_options.py @@ -14,7 +14,7 @@ class PagingGetMultiplePagesWithOffsetOptions(Model): """ - Additional parameters for one or more operations + Additional parameters for the Paging_getMultiplePagesWithOffset operation. :param maxresults: Sets the maximum number of items to return in the response. diff --git a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ModelFlattening/autorestresourceflatteningtestservice/models/flatten_parameter_group.py b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ModelFlattening/autorestresourceflatteningtestservice/models/flatten_parameter_group.py index 3e66e6a883e48..ef30dd1f2d039 100644 --- a/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ModelFlattening/autorestresourceflatteningtestservice/models/flatten_parameter_group.py +++ b/AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ModelFlattening/autorestresourceflatteningtestservice/models/flatten_parameter_group.py @@ -14,7 +14,7 @@ class FlattenParameterGroup(Model): """ - Additional parameters for one or more operations + Additional parameters for the putSimpleProductWithGrouping operation. :param name: Product name with value 'groupproduct' :type name: str