forked from Azure/autorest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhancement to x-ms-parameterized-host extension
- Loading branch information
1 parent
b73c784
commit 63b9fd6
Showing
47 changed files
with
2,378 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
AutoRest/Generators/AzureResourceSchema/AzureResourceSchema.Tests/packages.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="xunit" version="2.1.0" targetFramework="net452" /> | ||
<package id="xunit.abstractions" version="2.0.0" targetFramework="net452" /> | ||
<package id="xunit.assert" version="2.1.0" targetFramework="net452" /> | ||
<package id="xunit.core" version="2.1.0" targetFramework="net452" /> | ||
<package id="xunit.extensibility.core" version="2.1.0" targetFramework="net452" /> | ||
<package id="xunit.extensibility.execution" version="2.1.0" targetFramework="net452" /> | ||
<package id="xunit.runner.visualstudio" version="2.1.0" targetFramework="net452" /> | ||
<package id="xunit" version="2.1.0" targetFramework="net45" /> | ||
<package id="xunit.abstractions" version="2.0.0" targetFramework="net451" /> | ||
<package id="xunit.assert" version="2.1.0" targetFramework="net45" /> | ||
<package id="xunit.core" version="2.1.0" targetFramework="net45" /> | ||
<package id="xunit.extensibility.core" version="2.1.0" targetFramework="net45" /> | ||
<package id="xunit.extensibility.execution" version="2.1.0" targetFramework="net45" /> | ||
<package id="xunit.runner.visualstudio" version="2.1.0" targetFramework="net45" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
128 changes: 128 additions & 0 deletions
128
...ted/AcceptanceTests/CustomBaseUriMoreOptions/AutoRestParameterizedCustomHostTestClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
|
||
/// <summary> | ||
/// Test Infrastructure for AutoRest | ||
/// </summary> | ||
public partial class AutoRestParameterizedCustomHostTestClient : ServiceClient<AutoRestParameterizedCustomHostTestClient>, IAutoRestParameterizedCustomHostTestClient | ||
{ | ||
/// <summary> | ||
/// The base URI of the service. | ||
/// </summary> | ||
internal string BaseUri {get; set;} | ||
|
||
/// <summary> | ||
/// Gets or sets json serialization settings. | ||
/// </summary> | ||
public JsonSerializerSettings SerializationSettings { get; private set; } | ||
|
||
/// <summary> | ||
/// Gets or sets json deserialization settings. | ||
/// </summary> | ||
public JsonSerializerSettings DeserializationSettings { get; private set; } | ||
|
||
/// <summary> | ||
/// The subscription id with value 'test12'. | ||
/// </summary> | ||
public string SubscriptionId { get; set; } | ||
|
||
/// <summary> | ||
/// A string value that is used as a global part of the parameterized host. | ||
/// Default value 'host'. | ||
/// </summary> | ||
public string DnsSuffix { get; set; } | ||
|
||
/// <summary> | ||
/// Gets the IPaths. | ||
/// </summary> | ||
public virtual IPaths Paths { get; private set; } | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the AutoRestParameterizedCustomHostTestClient class. | ||
/// </summary> | ||
/// <param name='handlers'> | ||
/// Optional. The delegating handlers to add to the http client pipeline. | ||
/// </param> | ||
public AutoRestParameterizedCustomHostTestClient(params DelegatingHandler[] handlers) : base(handlers) | ||
{ | ||
this.Initialize(); | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the AutoRestParameterizedCustomHostTestClient class. | ||
/// </summary> | ||
/// <param name='rootHandler'> | ||
/// Optional. The http client handler used to handle http transport. | ||
/// </param> | ||
/// <param name='handlers'> | ||
/// Optional. The delegating handlers to add to the http client pipeline. | ||
/// </param> | ||
public AutoRestParameterizedCustomHostTestClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) | ||
{ | ||
this.Initialize(); | ||
} | ||
|
||
/// <summary> | ||
/// An optional partial-method to perform custom initialization. | ||
///</summary> | ||
partial void CustomInitialize(); | ||
/// <summary> | ||
/// Initializes client properties. | ||
/// </summary> | ||
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<JsonConverter> | ||
{ | ||
new Iso8601TimeSpanConverter() | ||
} | ||
}; | ||
DeserializationSettings = new JsonSerializerSettings | ||
{ | ||
DateFormatHandling = DateFormatHandling.IsoDateFormat, | ||
DateTimeZoneHandling = DateTimeZoneHandling.Utc, | ||
NullValueHandling = NullValueHandling.Ignore, | ||
ReferenceLoopHandling = ReferenceLoopHandling.Serialize, | ||
ContractResolver = new ReadOnlyJsonContractResolver(), | ||
Converters = new List<JsonConverter> | ||
{ | ||
new Iso8601TimeSpanConverter() | ||
} | ||
}; | ||
CustomInitialize(); | ||
} | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
...ed/AcceptanceTests/CustomBaseUriMoreOptions/IAutoRestParameterizedCustomHostTestClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
|
||
/// <summary> | ||
/// Test Infrastructure for AutoRest | ||
/// </summary> | ||
public partial interface IAutoRestParameterizedCustomHostTestClient : IDisposable | ||
{ | ||
/// <summary> | ||
/// The base URI of the service. | ||
/// </summary> | ||
|
||
/// <summary> | ||
/// Gets or sets json serialization settings. | ||
/// </summary> | ||
JsonSerializerSettings SerializationSettings { get; } | ||
|
||
/// <summary> | ||
/// Gets or sets json deserialization settings. | ||
/// </summary> | ||
JsonSerializerSettings DeserializationSettings { get; } | ||
|
||
/// <summary> | ||
/// The subscription id with value 'test12'. | ||
/// </summary> | ||
string SubscriptionId { get; set; } | ||
|
||
/// <summary> | ||
/// A string value that is used as a global part of the parameterized | ||
/// host. Default value 'host'. | ||
/// </summary> | ||
string DnsSuffix { get; set; } | ||
|
||
|
||
/// <summary> | ||
/// Gets the IPaths. | ||
/// </summary> | ||
IPaths Paths { get; } | ||
|
||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
...enerators/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/IPaths.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
|
||
/// <summary> | ||
/// Paths operations. | ||
/// </summary> | ||
public partial interface IPaths | ||
{ | ||
/// <summary> | ||
/// Get a 200 to test a valid base uri | ||
/// </summary> | ||
/// <param name='vault'> | ||
/// The vault name, e.g. https://myvault | ||
/// </param> | ||
/// <param name='secret'> | ||
/// Secret value. | ||
/// </param> | ||
/// <param name='keyName'> | ||
/// The key name with value 'key1'. | ||
/// </param> | ||
/// <param name='keyVersion'> | ||
/// The key version. Default value 'v1'. | ||
/// </param> | ||
/// <param name='customHeaders'> | ||
/// The headers that will be added to request. | ||
/// </param> | ||
/// <param name='cancellationToken'> | ||
/// The cancellation token. | ||
/// </param> | ||
Task<HttpOperationResponse> GetEmptyWithHttpMessagesAsync(string vault, string secret, string keyName, string keyVersion = "v1", Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
...ors/CSharp/CSharp.Tests/Expected/AcceptanceTests/CustomBaseUriMoreOptions/Models/Error.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the Error class. | ||
/// </summary> | ||
public Error() { } | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the Error class. | ||
/// </summary> | ||
public Error(int? status = default(int?), string message = default(string)) | ||
{ | ||
Status = status; | ||
Message = message; | ||
} | ||
|
||
/// <summary> | ||
/// </summary> | ||
[JsonProperty(PropertyName = "status")] | ||
public int? Status { get; set; } | ||
|
||
/// <summary> | ||
/// </summary> | ||
[JsonProperty(PropertyName = "message")] | ||
public string Message { get; set; } | ||
|
||
} | ||
} |
Oops, something went wrong.