Update test server version and add new tests (#814)

This commit is contained in:
ShivangiReja 2020-06-12 08:48:35 -07:00 коммит произвёл GitHub
Родитель 4b3495f120
Коммит 26040ccbb0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
21 изменённых файлов: 607 добавлений и 176 удалений

65
package-lock.json сгенерированный
Просмотреть файл

@ -4,9 +4,9 @@
"lockfileVersion": 1,
"dependencies": {
"@microsoft.azure/autorest.testserver": {
"version": "2.10.37",
"resolved": "https://registry.npmjs.org/@microsoft.azure/autorest.testserver/-/autorest.testserver-2.10.37.tgz",
"integrity": "sha512-ZSB5eoi/z7Rl9xMqxBVOfiWXecNGnBkAt3GUET6MKdnz2xIoDcypy4caXFvEvAUGj9AZPbh4V2nA5/zw0zFJ9g==",
"version": "2.10.42",
"resolved": "https://registry.npmjs.org/@microsoft.azure/autorest.testserver/-/autorest.testserver-2.10.42.tgz",
"integrity": "sha512-4OWs1SeL8YCcp/Op3UGS36jI7TxRP+rea3VfkeOn4ClqZkDZ4Yaw4GIv/w9goBwAsY2PfvOQDqBizWoeOkeU8g==",
"dev": true,
"requires": {
"azure-storage": "^2.4.0",
@ -179,9 +179,9 @@
"dev": true
},
"aws4": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz",
"integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==",
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.0.tgz",
"integrity": "sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==",
"dev": true
},
"azure-storage": {
@ -661,9 +661,9 @@
"dev": true
},
"engine.io": {
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.4.1.tgz",
"integrity": "sha512-8MfIfF1/IIfxuc2gv5K+XlFZczw/BpTvqBdl0E2fBLkYQp4miv4LuDTVtYt4yMyaIFLEr4vtaSgV4mjvll8Crw==",
"version": "3.4.2",
"resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.4.2.tgz",
"integrity": "sha512-b4Q85dFkGw+TqgytGPrGgACRUhsdKc9S9ErRAXpPGy/CXKs4tYoHDkvIRdsseAF7NjfVwjRFIn6KTnbw7LwJZg==",
"dev": true,
"requires": {
"accepts": "~1.3.4",
@ -698,9 +698,9 @@
}
},
"engine.io-client": {
"version": "3.4.2",
"resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.4.2.tgz",
"integrity": "sha512-AWjc1Xg06a6UPFOBAzJf48W1UR/qKYmv/ubgSCumo9GXgvL/xGIvo05dXoBL+2NTLMipDI7in8xK61C17L25xg==",
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.4.3.tgz",
"integrity": "sha512-0NGY+9hioejTEJCaSJZfWZLk4FPI9dN+1H1C4+wj2iuFba47UgZbJzfWs4aNFajnX/qAaYKbe2lLTfEEWzCmcw==",
"dev": true,
"requires": {
"component-emitter": "~1.3.0",
@ -853,9 +853,9 @@
"dev": true
},
"fast-deep-equal": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz",
"integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==",
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
"dev": true
},
"fast-json-stable-stringify": {
@ -925,12 +925,6 @@
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
"dev": true
},
"function-bind": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
"dev": true
},
"getpass": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
@ -970,15 +964,6 @@
"har-schema": "^2.0.0"
}
},
"has": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
"dev": true,
"requires": {
"function-bind": "^1.1.1"
}
},
"has-binary2": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.3.tgz",
@ -1008,6 +993,12 @@
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true
},
"has-symbols": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz",
"integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==",
"dev": true
},
"hash-base": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz",
@ -1096,9 +1087,9 @@
"dev": true
},
"interpret": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz",
"integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==",
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz",
"integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==",
"dev": true
},
"ipaddr.js": {
@ -1138,12 +1129,12 @@
"dev": true
},
"is-regex": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz",
"integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==",
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz",
"integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==",
"dev": true,
"requires": {
"has": "^1.0.3"
"has-symbols": "^1.0.1"
}
},
"is-typedarray": {

Просмотреть файл

@ -4,7 +4,7 @@
"description": "package.json intended for in-repo use only, package.json used for publishing is located in src/AutoRest.CSharp.V3/package.json",
"devDependencies": {
"autorest": "https://github.com/Azure/autorest/releases/download/autorest-3.0.6223/autorest-3.0.6223.tgz",
"@microsoft.azure/autorest.testserver": "2.10.37"
"@microsoft.azure/autorest.testserver": "2.10.42"
},
"dependencies": {}
}

Просмотреть файл

@ -668,6 +668,33 @@ namespace AutoRest.TestServer.Tests
}
});
[Test]
[IgnoreOnTestServer(TestServerVersion.V2, "Request not matched.")]
public Task PagingReturnModelWithXMSClientName() => Test(async (host, pipeline) =>
{
var result = await new PagingClient(ClientDiagnostics, pipeline, host).RestClient.GetPagingModelWithItemNameWithXMSClientNameAsync();
var resultPage = Page.FromValues(result.Value.Indexes, result.Value.NextLink, result.GetRawResponse());
Assert.AreEqual(1, resultPage.Values.First().Properties.Id);
Assert.AreEqual("Product", resultPage.Values.First().Properties.Name);
Assert.IsNull(resultPage.ContinuationToken);
var pageableAsync = new PagingClient(ClientDiagnostics, pipeline, host).GetPagingModelWithItemNameWithXMSClientNameAsync();
await foreach (var page in pageableAsync.AsPages())
{
Assert.AreEqual(1, page.Values.First().Properties.Id);
Assert.AreEqual("Product", page.Values.First().Properties.Name);
Assert.IsNull(page.ContinuationToken);
}
var pageable = new PagingClient(ClientDiagnostics, pipeline, host).GetPagingModelWithItemNameWithXMSClientName();
foreach (var page in pageable.AsPages())
{
Assert.AreEqual(1, page.Values.First().Properties.Id);
Assert.AreEqual("Product", page.Values.First().Properties.Name);
Assert.IsNull(page.ContinuationToken);
}
});
[Test]
[IgnoreOnTestServer(TestServerVersion.V2, "Refused connection.")]
public Task PagingOdataMultiple() => Test(async (host, pipeline) =>

Просмотреть файл

@ -64,8 +64,8 @@ namespace AutoRest.TestServer.Tests
public Task UrlQueriesDoubleNull() => TestStatus(async (host, pipeline) => await new QueriesClient(ClientDiagnostics, pipeline, host).DoubleNullAsync( null));
[Test]
[Ignore("No test server handler for this one")]
public Task StringUnicodeAsync() => TestStatus(async (host, pipeline) => await new QueriesClient(ClientDiagnostics, pipeline, host).StringUnicodeAsync());
[IgnoreOnTestServer(TestServerVersion.V2, "Request not matched.")]
public Task UrlQueriesStringUnicode() => TestStatus(async (host, pipeline) => await new QueriesClient(ClientDiagnostics, pipeline, host).StringUnicodeAsync());
[Test]
public Task UrlQueriesStringUrlEncoded() => TestStatus(async (host, pipeline) => await new QueriesClient(ClientDiagnostics, pipeline, host).StringUrlEncodedAsync());

Просмотреть файл

@ -36,8 +36,8 @@ namespace AutoRest.TestServer.Tests
}, ignoreScenario: true);
[Test]
[Ignore("Wasn't able to find a server endpoint for this")]
public Task UrlStringUnicodeAsync() => TestStatus(async (host, pipeline) => await new PathsClient(ClientDiagnostics, pipeline, host).StringUnicodeAsync());
[IgnoreOnTestServer(TestServerVersion.V2, "Request not matched.")]
public Task UrlPathsStringUnicode() => TestStatus(async (host, pipeline) => await new PathsClient(ClientDiagnostics, pipeline, host).StringUnicodeAsync());
[Test]
public Task UrlPathsArrayCSVInPath() => TestStatus(async (host, pipeline) => await new PathsClient(ClientDiagnostics, pipeline, host).ArrayCsvInPathAsync( new[] { "ArrayPath1", "begin!*'();:@ &=+$,/?#[]end", "", "" }));

8
test/TestServerProjects/body-datetime/CodeModel.yaml сгенерированный
Просмотреть файл

@ -504,8 +504,8 @@ operationGroups:
language: !<!Languages>
default:
name: PutUtcMaxDateTime7Digits
description: 'Put max datetime value 9999-12-31T23:59:59.9999999Z'
summary: 'This is against the recommendation that asks for 3 digits, but allow to test what happens in that scenario'
description: 'This is against the recommendation that asks for 3 digits, but allow to test what happens in that scenario'
summary: 'Put max datetime value 9999-12-31T23:59:59.9999999Z'
protocol: !<!Protocols> {}
- !<!Operation>
apiVersions:
@ -658,8 +658,8 @@ operationGroups:
language: !<!Languages>
default:
name: GetUtcUppercaseMaxDateTime7Digits
description: 'Get max datetime value 9999-12-31T23:59:59.9999999Z'
summary: 'This is against the recommendation that asks for 3 digits, but allow to test what happens in that scenario'
description: 'This is against the recommendation that asks for 3 digits, but allow to test what happens in that scenario'
summary: 'Get max datetime value 9999-12-31T23:59:59.9999999Z'
protocol: !<!Protocols> {}
- !<!Operation>
apiVersions:

Просмотреть файл

@ -206,7 +206,7 @@ namespace body_datetime
}
}
/// <summary> Put max datetime value 9999-12-31T23:59:59.9999999Z. </summary>
/// <summary> This is against the recommendation that asks for 3 digits, but allow to test what happens in that scenario. </summary>
/// <param name="datetimeBody"> The DateTime to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> PutUtcMaxDateTime7DigitsAsync(DateTimeOffset datetimeBody, CancellationToken cancellationToken = default)
@ -224,7 +224,7 @@ namespace body_datetime
}
}
/// <summary> Put max datetime value 9999-12-31T23:59:59.9999999Z. </summary>
/// <summary> This is against the recommendation that asks for 3 digits, but allow to test what happens in that scenario. </summary>
/// <param name="datetimeBody"> The DateTime to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response PutUtcMaxDateTime7Digits(DateTimeOffset datetimeBody, CancellationToken cancellationToken = default)
@ -310,7 +310,7 @@ namespace body_datetime
}
}
/// <summary> Get max datetime value 9999-12-31T23:59:59.9999999Z. </summary>
/// <summary> This is against the recommendation that asks for 3 digits, but allow to test what happens in that scenario. </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response<DateTimeOffset>> GetUtcUppercaseMaxDateTime7DigitsAsync(CancellationToken cancellationToken = default)
{
@ -327,7 +327,7 @@ namespace body_datetime
}
}
/// <summary> Get max datetime value 9999-12-31T23:59:59.9999999Z. </summary>
/// <summary> This is against the recommendation that asks for 3 digits, but allow to test what happens in that scenario. </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response<DateTimeOffset> GetUtcUppercaseMaxDateTime7Digits(CancellationToken cancellationToken = default)
{

Просмотреть файл

@ -306,7 +306,7 @@ namespace body_datetime
return message;
}
/// <summary> Put max datetime value 9999-12-31T23:59:59.9999999Z. </summary>
/// <summary> This is against the recommendation that asks for 3 digits, but allow to test what happens in that scenario. </summary>
/// <param name="datetimeBody"> The DateTime to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public async Task<Response> PutUtcMaxDateTime7DigitsAsync(DateTimeOffset datetimeBody, CancellationToken cancellationToken = default)
@ -322,7 +322,7 @@ namespace body_datetime
}
}
/// <summary> Put max datetime value 9999-12-31T23:59:59.9999999Z. </summary>
/// <summary> This is against the recommendation that asks for 3 digits, but allow to test what happens in that scenario. </summary>
/// <param name="datetimeBody"> The DateTime to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public Response PutUtcMaxDateTime7Digits(DateTimeOffset datetimeBody, CancellationToken cancellationToken = default)
@ -454,7 +454,7 @@ namespace body_datetime
return message;
}
/// <summary> Get max datetime value 9999-12-31T23:59:59.9999999Z. </summary>
/// <summary> This is against the recommendation that asks for 3 digits, but allow to test what happens in that scenario. </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public async Task<Response<DateTimeOffset>> GetUtcUppercaseMaxDateTime7DigitsAsync(CancellationToken cancellationToken = default)
{
@ -474,7 +474,7 @@ namespace body_datetime
}
}
/// <summary> Get max datetime value 9999-12-31T23:59:59.9999999Z. </summary>
/// <summary> This is against the recommendation that asks for 3 digits, but allow to test what happens in that scenario. </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public Response<DateTimeOffset> GetUtcUppercaseMaxDateTime7Digits(CancellationToken cancellationToken = default)
{

2
test/TestServerProjects/body-string/CodeModel.yaml сгенерированный
Просмотреть файл

@ -186,7 +186,7 @@ schemas: !<!Schemas>
byteArrays:
- !<!ByteArraySchema> &ref_13
type: byte-array
format: base64url
format: byte
apiVersions:
- !<!ApiVersion>
version: 1.0.0

Просмотреть файл

@ -583,7 +583,7 @@ namespace body_string
}
else
{
value = document.RootElement.GetBytesFromBase64("U");
value = document.RootElement.GetBytesFromBase64();
}
return Response.FromValue(value, message.Response);
}
@ -610,7 +610,7 @@ namespace body_string
}
else
{
value = document.RootElement.GetBytesFromBase64("U");
value = document.RootElement.GetBytesFromBase64();
}
return Response.FromValue(value, message.Response);
}

4
test/TestServerProjects/lro/CodeModel.yaml сгенерированный
Просмотреть файл

@ -1991,10 +1991,10 @@ schemas: !<!Schemas>
properties:
- !<!Property>
schema: *ref_11
serializedName: status
serializedName: code
language: !<!Languages>
default:
name: status
name: code
description: ''
protocol: !<!Protocols> {}
- !<!Property>

Просмотреть файл

@ -14,17 +14,17 @@ namespace lro.Models
{
internal static CloudError DeserializeCloudError(JsonElement element)
{
int? status = default;
int? code = default;
string message = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("status"))
if (property.NameEquals("code"))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
status = property.Value.GetInt32();
code = property.Value.GetInt32();
continue;
}
if (property.NameEquals("message"))
@ -37,7 +37,7 @@ namespace lro.Models
continue;
}
}
return new CloudError(status, message);
return new CloudError(code, message);
}
}
}

Просмотреть файл

@ -16,15 +16,15 @@ namespace lro.Models
}
/// <summary> Initializes a new instance of CloudError. </summary>
/// <param name="status"> . </param>
/// <param name="code"> . </param>
/// <param name="message"> . </param>
internal CloudError(int? status, string message)
internal CloudError(int? code, string message)
{
Status = status;
Code = code;
Message = message;
}
public int? Status { get; }
public int? Code { get; }
public string Message { get; }
}
}

313
test/TestServerProjects/paging/CodeModel.yaml сгенерированный
Просмотреть файл

@ -101,8 +101,18 @@ schemas: !<!Schemas>
name: OdataProductResultOdataNextLink
description: ''
protocol: !<!Protocols> {}
- !<!StringSchema> &ref_23
type: string
apiVersions:
- !<!ApiVersion>
version: 1.0.0
language: !<!Languages>
default:
name: ProductResultValueWithXMSClientNameNextLink
description: ''
protocol: !<!Protocols> {}
choices:
- !<!ChoiceSchema> &ref_23
- !<!ChoiceSchema> &ref_24
choices:
- !<!ChoiceValue>
value: Succeeded
@ -181,7 +191,7 @@ schemas: !<!Schemas>
description: The status of the request
protocol: !<!Protocols> {}
constants:
- !<!ConstantSchema> &ref_33
- !<!ConstantSchema> &ref_35
type: constant
value: !<!ConstantValue>
value: true
@ -198,7 +208,7 @@ schemas: !<!Schemas>
- !<!GroupProperty>
schema: *ref_2
originalParameter:
- !<!Parameter> &ref_30
- !<!Parameter> &ref_32
schema: *ref_2
groupedBy: !<!Parameter> &ref_5
schema: *ref_3
@ -226,7 +236,7 @@ schemas: !<!Schemas>
- !<!GroupProperty>
schema: *ref_4
originalParameter:
- !<!Parameter> &ref_31
- !<!Parameter> &ref_33
schema: *ref_4
groupedBy: *ref_5
implementation: Method
@ -257,7 +267,7 @@ schemas: !<!Schemas>
- !<!GroupProperty>
schema: *ref_2
originalParameter:
- !<!Parameter> &ref_36
- !<!Parameter> &ref_38
schema: *ref_2
groupedBy: !<!Parameter> &ref_7
schema: *ref_6
@ -285,7 +295,7 @@ schemas: !<!Schemas>
- !<!GroupProperty>
schema: *ref_4
originalParameter:
- !<!Parameter> &ref_37
- !<!Parameter> &ref_39
schema: *ref_4
groupedBy: *ref_7
implementation: Method
@ -316,7 +326,7 @@ schemas: !<!Schemas>
- !<!GroupProperty>
schema: *ref_2
originalParameter:
- !<!Parameter> &ref_40
- !<!Parameter> &ref_42
schema: *ref_2
groupedBy: !<!Parameter> &ref_9
schema: *ref_8
@ -345,7 +355,7 @@ schemas: !<!Schemas>
- !<!GroupProperty>
schema: *ref_2
originalParameter:
- !<!Parameter> &ref_41
- !<!Parameter> &ref_43
schema: *ref_2
groupedBy: *ref_9
implementation: Method
@ -368,7 +378,7 @@ schemas: !<!Schemas>
- !<!GroupProperty>
schema: *ref_4
originalParameter:
- !<!Parameter> &ref_42
- !<!Parameter> &ref_44
schema: *ref_4
groupedBy: *ref_9
implementation: Method
@ -399,7 +409,7 @@ schemas: !<!Schemas>
- !<!GroupProperty>
schema: *ref_10
originalParameter:
- !<!Parameter> &ref_50
- !<!Parameter> &ref_52
schema: *ref_10
groupedBy: !<!Parameter> &ref_12
schema: *ref_11
@ -420,7 +430,7 @@ schemas: !<!Schemas>
protocol: !<!Protocols>
http: !<!HttpParameter>
in: query
- !<!Parameter> &ref_52
- !<!Parameter> &ref_54
schema: *ref_10
groupedBy: !<!Parameter> &ref_13
schema: *ref_11
@ -451,7 +461,7 @@ schemas: !<!Schemas>
- !<!GroupProperty>
schema: *ref_10
originalParameter:
- !<!Parameter> &ref_51
- !<!Parameter> &ref_53
schema: *ref_10
groupedBy: *ref_12
implementation: Method
@ -464,7 +474,7 @@ schemas: !<!Schemas>
protocol: !<!Protocols>
http: !<!HttpParameter>
in: path
- !<!Parameter> &ref_53
- !<!Parameter> &ref_55
schema: *ref_10
groupedBy: *ref_13
implementation: Method
@ -497,7 +507,7 @@ schemas: !<!Schemas>
- !<!GroupProperty>
schema: *ref_2
originalParameter:
- !<!Parameter> &ref_56
- !<!Parameter> &ref_58
schema: *ref_2
groupedBy: !<!Parameter> &ref_15
schema: *ref_14
@ -525,7 +535,7 @@ schemas: !<!Schemas>
- !<!GroupProperty>
schema: *ref_4
originalParameter:
- !<!Parameter> &ref_57
- !<!Parameter> &ref_59
schema: *ref_4
groupedBy: *ref_15
implementation: Method
@ -551,14 +561,14 @@ schemas: !<!Schemas>
description: Parameter group
protocol: !<!Protocols> {}
objects:
- !<!ObjectSchema> &ref_28
- !<!ObjectSchema> &ref_30
type: object
apiVersions:
- !<!ApiVersion>
version: 1.0.0
properties:
- !<!Property>
schema: !<!ArraySchema> &ref_24
schema: !<!ArraySchema> &ref_25
type: array
apiVersions:
- !<!ApiVersion>
@ -652,14 +662,14 @@ schemas: !<!Schemas>
protocol: !<!Protocols> {}
- *ref_19
- *ref_20
- !<!ObjectSchema> &ref_29
- !<!ObjectSchema> &ref_31
type: object
apiVersions:
- !<!ApiVersion>
version: 1.0.0
properties:
- !<!Property>
schema: !<!ArraySchema> &ref_25
schema: !<!ArraySchema> &ref_26
type: array
apiVersions:
- !<!ApiVersion>
@ -694,14 +704,14 @@ schemas: !<!Schemas>
description: ''
namespace: ''
protocol: !<!Protocols> {}
- !<!ObjectSchema> &ref_39
- !<!ObjectSchema> &ref_41
type: object
apiVersions:
- !<!ApiVersion>
version: 1.0.0
properties:
- !<!Property>
schema: !<!ArraySchema> &ref_26
schema: !<!ArraySchema> &ref_27
type: array
apiVersions:
- !<!ApiVersion>
@ -736,6 +746,48 @@ schemas: !<!Schemas>
description: ''
namespace: ''
protocol: !<!Protocols> {}
- !<!ObjectSchema> &ref_61
type: object
apiVersions:
- !<!ApiVersion>
version: 1.0.0
properties:
- !<!Property>
schema: !<!ArraySchema> &ref_28
type: array
apiVersions:
- !<!ApiVersion>
version: 1.0.0
elementType: *ref_19
language: !<!Languages>
default:
name: Indexes
description: Array of Product
protocol: !<!Protocols> {}
serializedName: values
language: !<!Languages>
default:
name: indexes
description: ''
protocol: !<!Protocols> {}
- !<!Property>
schema: *ref_23
serializedName: nextLink
language: !<!Languages>
default:
name: nextLink
description: ''
protocol: !<!Protocols> {}
serializationFormats:
- json
usage:
- output
language: !<!Languages>
default:
name: ProductResultValueWithXMSClientName
description: ''
namespace: ''
protocol: !<!Protocols> {}
- !<!ObjectSchema>
type: object
apiVersions:
@ -743,7 +795,7 @@ schemas: !<!Schemas>
version: 1.0.0
properties:
- !<!Property>
schema: *ref_23
schema: *ref_24
serializedName: status
language: !<!Languages>
default:
@ -757,11 +809,12 @@ schemas: !<!Schemas>
namespace: ''
protocol: !<!Protocols> {}
arrays:
- *ref_24
- *ref_25
- *ref_26
- *ref_27
- *ref_28
globalParameters:
- !<!Parameter> &ref_27
- !<!Parameter> &ref_29
schema: *ref_0
clientDefaultValue: 'http://localhost:3000'
implementation: Client
@ -786,7 +839,7 @@ operationGroups:
- !<!ApiVersion>
version: 1.0.0
parameters:
- *ref_27
- *ref_29
requests:
- !<!Request>
language: !<!Languages>
@ -801,7 +854,7 @@ operationGroups:
signatureParameters: []
responses:
- !<!SchemaResponse>
schema: *ref_28
schema: *ref_30
language: !<!Languages>
default:
name: ''
@ -838,7 +891,7 @@ operationGroups:
- !<!ApiVersion>
version: 1.0.0
parameters:
- *ref_27
- *ref_29
requests:
- !<!Request>
language: !<!Languages>
@ -853,7 +906,7 @@ operationGroups:
signatureParameters: []
responses:
- !<!SchemaResponse>
schema: *ref_29
schema: *ref_31
language: !<!Languages>
default:
name: ''
@ -892,7 +945,7 @@ operationGroups:
- !<!ApiVersion>
version: 1.0.0
parameters:
- *ref_27
- *ref_29
requests:
- !<!Request>
language: !<!Languages>
@ -907,7 +960,7 @@ operationGroups:
signatureParameters: []
responses:
- !<!SchemaResponse>
schema: *ref_29
schema: *ref_31
language: !<!Languages>
default:
name: ''
@ -946,8 +999,8 @@ operationGroups:
- !<!ApiVersion>
version: 1.0.0
parameters:
- *ref_27
- !<!Parameter> &ref_32
- *ref_29
- !<!Parameter> &ref_34
schema: *ref_10
implementation: Method
language: !<!Languages>
@ -958,8 +1011,8 @@ operationGroups:
protocol: !<!Protocols>
http: !<!HttpParameter>
in: header
- *ref_30
- *ref_31
- *ref_32
- *ref_33
requests:
- !<!Request>
parameters:
@ -976,10 +1029,10 @@ operationGroups:
method: get
uri: '{$host}'
signatureParameters:
- *ref_32
- *ref_34
responses:
- !<!SchemaResponse>
schema: *ref_29
schema: *ref_31
language: !<!Languages>
default:
name: ''
@ -1018,8 +1071,8 @@ operationGroups:
- !<!ApiVersion>
version: 1.0.0
parameters:
- *ref_27
- !<!Parameter> &ref_34
- *ref_29
- !<!Parameter> &ref_36
schema: *ref_2
implementation: Method
required: true
@ -1032,7 +1085,7 @@ operationGroups:
http: !<!HttpParameter>
in: query
- !<!Parameter>
schema: *ref_33
schema: *ref_35
implementation: Method
required: true
language: !<!Languages>
@ -1055,10 +1108,10 @@ operationGroups:
method: get
uri: '{$host}'
signatureParameters:
- *ref_34
- *ref_36
responses:
- !<!SchemaResponse>
schema: *ref_29
schema: *ref_31
language: !<!Languages>
default:
name: ''
@ -1094,14 +1147,14 @@ operationGroups:
itemName: values
member: NextOperationWithQueryParams
nextLinkName: nextLink
nextLinkOperation: !<!Operation> &ref_35
nextLinkOperation: !<!Operation> &ref_37
apiVersions:
- !<!ApiVersion>
version: 1.0.0
parameters:
- *ref_27
- *ref_29
- !<!Parameter>
schema: *ref_33
schema: *ref_35
implementation: Method
required: true
language: !<!Languages>
@ -1126,7 +1179,7 @@ operationGroups:
signatureParameters: []
responses:
- !<!SchemaResponse>
schema: *ref_29
schema: *ref_31
language: !<!Languages>
default:
name: ''
@ -1161,14 +1214,14 @@ operationGroups:
nextLinkName: null
protocol: !<!Protocols> {}
protocol: !<!Protocols> {}
- *ref_35
- *ref_37
- !<!Operation>
apiVersions:
- !<!ApiVersion>
version: 1.0.0
parameters:
- *ref_27
- !<!Parameter> &ref_38
- *ref_29
- !<!Parameter> &ref_40
schema: *ref_10
implementation: Method
language: !<!Languages>
@ -1179,8 +1232,8 @@ operationGroups:
protocol: !<!Protocols>
http: !<!HttpParameter>
in: header
- *ref_36
- *ref_37
- *ref_38
- *ref_39
requests:
- !<!Request>
parameters:
@ -1197,10 +1250,10 @@ operationGroups:
method: get
uri: '{$host}'
signatureParameters:
- *ref_38
- *ref_40
responses:
- !<!SchemaResponse>
schema: *ref_39
schema: *ref_41
language: !<!Languages>
default:
name: ''
@ -1239,8 +1292,8 @@ operationGroups:
- !<!ApiVersion>
version: 1.0.0
parameters:
- *ref_27
- !<!Parameter> &ref_43
- *ref_29
- !<!Parameter> &ref_45
schema: *ref_10
implementation: Method
language: !<!Languages>
@ -1251,9 +1304,9 @@ operationGroups:
protocol: !<!Protocols>
http: !<!HttpParameter>
in: header
- *ref_40
- *ref_41
- *ref_42
- *ref_43
- *ref_44
requests:
- !<!Request>
parameters:
@ -1270,10 +1323,10 @@ operationGroups:
method: get
uri: '{$host}'
signatureParameters:
- *ref_43
- *ref_45
responses:
- !<!SchemaResponse>
schema: *ref_29
schema: *ref_31
language: !<!Languages>
default:
name: ''
@ -1312,7 +1365,7 @@ operationGroups:
- !<!ApiVersion>
version: 1.0.0
parameters:
- *ref_27
- *ref_29
requests:
- !<!Request>
language: !<!Languages>
@ -1327,7 +1380,7 @@ operationGroups:
signatureParameters: []
responses:
- !<!SchemaResponse>
schema: *ref_29
schema: *ref_31
language: !<!Languages>
default:
name: ''
@ -1366,7 +1419,7 @@ operationGroups:
- !<!ApiVersion>
version: 1.0.0
parameters:
- *ref_27
- *ref_29
requests:
- !<!Request>
language: !<!Languages>
@ -1381,7 +1434,7 @@ operationGroups:
signatureParameters: []
responses:
- !<!SchemaResponse>
schema: *ref_29
schema: *ref_31
language: !<!Languages>
default:
name: ''
@ -1420,7 +1473,7 @@ operationGroups:
- !<!ApiVersion>
version: 1.0.0
parameters:
- *ref_27
- *ref_29
requests:
- !<!Request>
language: !<!Languages>
@ -1435,7 +1488,7 @@ operationGroups:
signatureParameters: []
responses:
- !<!SchemaResponse>
schema: *ref_29
schema: *ref_31
language: !<!Languages>
default:
name: ''
@ -1474,7 +1527,7 @@ operationGroups:
- !<!ApiVersion>
version: 1.0.0
parameters:
- *ref_27
- *ref_29
requests:
- !<!Request>
language: !<!Languages>
@ -1489,7 +1542,7 @@ operationGroups:
signatureParameters: []
responses:
- !<!SchemaResponse>
schema: *ref_29
schema: *ref_31
language: !<!Languages>
default:
name: ''
@ -1528,7 +1581,7 @@ operationGroups:
- !<!ApiVersion>
version: 1.0.0
parameters:
- *ref_27
- *ref_29
requests:
- !<!Request>
language: !<!Languages>
@ -1543,7 +1596,7 @@ operationGroups:
signatureParameters: []
responses:
- !<!SchemaResponse>
schema: *ref_29
schema: *ref_31
language: !<!Languages>
default:
name: ''
@ -1582,8 +1635,8 @@ operationGroups:
- !<!ApiVersion>
version: 1.0.0
parameters:
- *ref_27
- !<!Parameter> &ref_44
- *ref_29
- !<!Parameter> &ref_46
schema: *ref_10
implementation: Method
required: true
@ -1595,7 +1648,7 @@ operationGroups:
protocol: !<!Protocols>
http: !<!HttpParameter>
in: query
- !<!Parameter> &ref_45
- !<!Parameter> &ref_47
schema: *ref_10
implementation: Method
required: true
@ -1619,11 +1672,11 @@ operationGroups:
method: get
uri: '{$host}'
signatureParameters:
- *ref_44
- *ref_45
- *ref_46
- *ref_47
responses:
- !<!SchemaResponse>
schema: *ref_39
schema: *ref_41
language: !<!Languages>
default:
name: ''
@ -1659,13 +1712,13 @@ operationGroups:
itemName: values
member: NextFragment
nextLinkName: odata.nextLink
nextLinkOperation: !<!Operation> &ref_49
nextLinkOperation: !<!Operation> &ref_51
apiVersions:
- !<!ApiVersion>
version: 1.0.0
parameters:
- *ref_27
- !<!Parameter> &ref_46
- *ref_29
- !<!Parameter> &ref_48
schema: *ref_10
implementation: Method
required: true
@ -1677,7 +1730,7 @@ operationGroups:
protocol: !<!Protocols>
http: !<!HttpParameter>
in: query
- !<!Parameter> &ref_47
- !<!Parameter> &ref_49
schema: *ref_10
implementation: Method
required: true
@ -1689,7 +1742,7 @@ operationGroups:
protocol: !<!Protocols>
http: !<!HttpParameter>
in: path
- !<!Parameter> &ref_48
- !<!Parameter> &ref_50
schema: *ref_10
implementation: Method
required: true
@ -1715,12 +1768,12 @@ operationGroups:
method: get
uri: '{$host}'
signatureParameters:
- *ref_46
- *ref_47
- *ref_48
- *ref_49
- *ref_50
responses:
- !<!SchemaResponse>
schema: *ref_39
schema: *ref_41
language: !<!Languages>
default:
name: ''
@ -1756,7 +1809,7 @@ operationGroups:
itemName: values
member: NextFragment
nextLinkName: odata.nextLink
nextLinkOperation: *ref_49
nextLinkOperation: *ref_51
protocol: !<!Protocols> {}
protocol: !<!Protocols> {}
- !<!Operation>
@ -1764,9 +1817,9 @@ operationGroups:
- !<!ApiVersion>
version: 1.0.0
parameters:
- *ref_27
- *ref_50
- *ref_51
- *ref_29
- *ref_52
- *ref_53
requests:
- !<!Request>
parameters:
@ -1785,7 +1838,7 @@ operationGroups:
signatureParameters: []
responses:
- !<!SchemaResponse>
schema: *ref_39
schema: *ref_41
language: !<!Languages>
default:
name: ''
@ -1821,15 +1874,15 @@ operationGroups:
itemName: values
member: NextFragmentWithGrouping
nextLinkName: odata.nextLink
nextLinkOperation: !<!Operation> &ref_55
nextLinkOperation: !<!Operation> &ref_57
apiVersions:
- !<!ApiVersion>
version: 1.0.0
parameters:
- *ref_27
- *ref_52
- *ref_53
- !<!Parameter> &ref_54
- *ref_29
- *ref_54
- *ref_55
- !<!Parameter> &ref_56
schema: *ref_10
implementation: Method
required: true
@ -1859,10 +1912,10 @@ operationGroups:
method: get
uri: '{$host}'
signatureParameters:
- *ref_54
- *ref_56
responses:
- !<!SchemaResponse>
schema: *ref_39
schema: *ref_41
language: !<!Languages>
default:
name: ''
@ -1898,7 +1951,7 @@ operationGroups:
itemName: values
member: NextFragmentWithGrouping
nextLinkName: odata.nextLink
nextLinkOperation: *ref_55
nextLinkOperation: *ref_57
protocol: !<!Protocols> {}
protocol: !<!Protocols> {}
- !<!Operation>
@ -1906,8 +1959,8 @@ operationGroups:
- !<!ApiVersion>
version: 1.0.0
parameters:
- *ref_27
- !<!Parameter> &ref_58
- *ref_29
- !<!Parameter> &ref_60
schema: *ref_10
implementation: Method
language: !<!Languages>
@ -1918,8 +1971,8 @@ operationGroups:
protocol: !<!Protocols>
http: !<!HttpParameter>
in: header
- *ref_56
- *ref_57
- *ref_58
- *ref_59
requests:
- !<!Request>
parameters:
@ -1936,10 +1989,10 @@ operationGroups:
method: post
uri: '{$host}'
signatureParameters:
- *ref_58
- *ref_60
responses:
- !<!SchemaResponse>
schema: *ref_29
schema: *ref_31
language: !<!Languages>
default:
name: ''
@ -1974,8 +2027,62 @@ operationGroups:
itemName: values
nextLinkName: nextLink
protocol: !<!Protocols> {}
- *ref_49
- *ref_55
- *ref_51
- *ref_57
- !<!Operation>
apiVersions:
- !<!ApiVersion>
version: 1.0.0
parameters:
- *ref_29
requests:
- !<!Request>
language: !<!Languages>
default:
name: ''
description: ''
protocol: !<!Protocols>
http: !<!HttpRequest>
path: /paging/itemNameWithXMSClientName
method: get
uri: '{$host}'
signatureParameters: []
responses:
- !<!SchemaResponse>
schema: *ref_61
language: !<!Languages>
default:
name: ''
description: ''
protocol: !<!Protocols>
http: !<!HttpResponse>
knownMediaType: json
mediaTypes:
- application/json
statusCodes:
- '200'
exceptions:
- !<!Response>
language: !<!Languages>
default:
name: ''
description: ''
protocol: !<!Protocols>
http: !<!HttpResponse>
statusCodes:
- default
extensions:
x-ms-pageable:
itemName: values
nextLinkName: nextLink
language: !<!Languages>
default:
name: GetPagingModelWithItemNameWithXMSClientName
description: A paging operation that returns a paging model whose item name is is overriden by x-ms-client-name 'indexes'.
paging:
itemName: values
nextLinkName: nextLink
protocol: !<!Protocols> {}
language: !<!Languages>
default:
name: Paging

Просмотреть файл

@ -0,0 +1,56 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System.Collections.Generic;
using System.Text.Json;
using Azure.Core;
namespace paging.Models
{
public partial class ProductResultValueWithXMSClientName
{
internal static ProductResultValueWithXMSClientName DeserializeProductResultValueWithXMSClientName(JsonElement element)
{
IReadOnlyList<Product> values = default;
string nextLink = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("values"))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
List<Product> array = new List<Product>();
foreach (var item in property.Value.EnumerateArray())
{
if (item.ValueKind == JsonValueKind.Null)
{
array.Add(null);
}
else
{
array.Add(Product.DeserializeProduct(item));
}
}
values = array;
continue;
}
if (property.NameEquals("nextLink"))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
nextLink = property.Value.GetString();
continue;
}
}
return new ProductResultValueWithXMSClientName(values, nextLink);
}
}
}

Просмотреть файл

@ -0,0 +1,32 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System.Collections.Generic;
namespace paging.Models
{
/// <summary> The ProductResultValueWithXMSClientName. </summary>
public partial class ProductResultValueWithXMSClientName
{
/// <summary> Initializes a new instance of ProductResultValueWithXMSClientName. </summary>
internal ProductResultValueWithXMSClientName()
{
}
/// <summary> Initializes a new instance of ProductResultValueWithXMSClientName. </summary>
/// <param name="indexes"> . </param>
/// <param name="nextLink"> . </param>
internal ProductResultValueWithXMSClientName(IReadOnlyList<Product> indexes, string nextLink)
{
Indexes = indexes;
NextLink = nextLink;
}
public IReadOnlyList<Product> Indexes { get; }
public string NextLink { get; }
}
}

Просмотреть файл

@ -1346,6 +1346,80 @@ namespace paging
return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
}
/// <summary> A paging operation that returns a paging model whose item name is is overriden by x-ms-client-name &apos;indexes&apos;. </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual AsyncPageable<Product> GetPagingModelWithItemNameWithXMSClientNameAsync(CancellationToken cancellationToken = default)
{
async Task<Page<Product>> FirstPageFunc(int? pageSizeHint)
{
using var scope = _clientDiagnostics.CreateScope("PagingClient.GetPagingModelWithItemNameWithXMSClientName");
scope.Start();
try
{
var response = await RestClient.GetPagingModelWithItemNameWithXMSClientNameAsync(cancellationToken).ConfigureAwait(false);
return Page.FromValues(response.Value.Indexes, response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
async Task<Page<Product>> NextPageFunc(string nextLink, int? pageSizeHint)
{
using var scope = _clientDiagnostics.CreateScope("PagingClient.GetPagingModelWithItemNameWithXMSClientName");
scope.Start();
try
{
var response = await RestClient.GetPagingModelWithItemNameWithXMSClientNameNextPageAsync(nextLink, cancellationToken).ConfigureAwait(false);
return Page.FromValues(response.Value.Indexes, response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
}
/// <summary> A paging operation that returns a paging model whose item name is is overriden by x-ms-client-name &apos;indexes&apos;. </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Pageable<Product> GetPagingModelWithItemNameWithXMSClientName(CancellationToken cancellationToken = default)
{
Page<Product> FirstPageFunc(int? pageSizeHint)
{
using var scope = _clientDiagnostics.CreateScope("PagingClient.GetPagingModelWithItemNameWithXMSClientName");
scope.Start();
try
{
var response = RestClient.GetPagingModelWithItemNameWithXMSClientName(cancellationToken);
return Page.FromValues(response.Value.Indexes, response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
Page<Product> NextPageFunc(string nextLink, int? pageSizeHint)
{
using var scope = _clientDiagnostics.CreateScope("PagingClient.GetPagingModelWithItemNameWithXMSClientName");
scope.Start();
try
{
var response = RestClient.GetPagingModelWithItemNameWithXMSClientNameNextPage(nextLink, cancellationToken);
return Page.FromValues(response.Value.Indexes, response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
}
/// <summary> A long-running paging operation that includes a nextLink that has 10 pages. </summary>
/// <param name="clientRequestId"> The String to use. </param>
/// <param name="pagingGetMultiplePagesLroOptions"> Parameter group. </param>

Просмотреть файл

@ -1379,6 +1379,72 @@ namespace paging
}
}
internal HttpMessage CreateGetPagingModelWithItemNameWithXMSClientNameRequest()
{
var message = _pipeline.CreateMessage();
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
uri.Reset(endpoint);
uri.AppendPath("/paging/itemNameWithXMSClientName", false);
request.Uri = uri;
return message;
}
/// <summary> A paging operation that returns a paging model whose item name is is overriden by x-ms-client-name &apos;indexes&apos;. </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public async Task<Response<ProductResultValueWithXMSClientName>> GetPagingModelWithItemNameWithXMSClientNameAsync(CancellationToken cancellationToken = default)
{
using var message = CreateGetPagingModelWithItemNameWithXMSClientNameRequest();
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
switch (message.Response.Status)
{
case 200:
{
ProductResultValueWithXMSClientName value = default;
using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
if (document.RootElement.ValueKind == JsonValueKind.Null)
{
value = null;
}
else
{
value = ProductResultValueWithXMSClientName.DeserializeProductResultValueWithXMSClientName(document.RootElement);
}
return Response.FromValue(value, message.Response);
}
default:
throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
}
}
/// <summary> A paging operation that returns a paging model whose item name is is overriden by x-ms-client-name &apos;indexes&apos;. </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public Response<ProductResultValueWithXMSClientName> GetPagingModelWithItemNameWithXMSClientName(CancellationToken cancellationToken = default)
{
using var message = CreateGetPagingModelWithItemNameWithXMSClientNameRequest();
_pipeline.Send(message, cancellationToken);
switch (message.Response.Status)
{
case 200:
{
ProductResultValueWithXMSClientName value = default;
using var document = JsonDocument.Parse(message.Response.ContentStream);
if (document.RootElement.ValueKind == JsonValueKind.Null)
{
value = null;
}
else
{
value = ProductResultValueWithXMSClientName.DeserializeProductResultValueWithXMSClientName(document.RootElement);
}
return Response.FromValue(value, message.Response);
}
default:
throw _clientDiagnostics.CreateRequestFailedException(message.Response);
}
}
internal HttpMessage CreateGetNoItemNamePagesNextPageRequest(string nextLink)
{
var message = _pipeline.CreateMessage();
@ -2400,5 +2466,83 @@ namespace paging
throw _clientDiagnostics.CreateRequestFailedException(message.Response);
}
}
internal HttpMessage CreateGetPagingModelWithItemNameWithXMSClientNameNextPageRequest(string nextLink)
{
var message = _pipeline.CreateMessage();
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
uri.Reset(endpoint);
uri.AppendRawNextLink(nextLink, false);
request.Uri = uri;
return message;
}
/// <summary> A paging operation that returns a paging model whose item name is is overriden by x-ms-client-name &apos;indexes&apos;. </summary>
/// <param name="nextLink"> The URL to the next page of results. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public async Task<Response<ProductResultValueWithXMSClientName>> GetPagingModelWithItemNameWithXMSClientNameNextPageAsync(string nextLink, CancellationToken cancellationToken = default)
{
if (nextLink == null)
{
throw new ArgumentNullException(nameof(nextLink));
}
using var message = CreateGetPagingModelWithItemNameWithXMSClientNameNextPageRequest(nextLink);
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
switch (message.Response.Status)
{
case 200:
{
ProductResultValueWithXMSClientName value = default;
using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
if (document.RootElement.ValueKind == JsonValueKind.Null)
{
value = null;
}
else
{
value = ProductResultValueWithXMSClientName.DeserializeProductResultValueWithXMSClientName(document.RootElement);
}
return Response.FromValue(value, message.Response);
}
default:
throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
}
}
/// <summary> A paging operation that returns a paging model whose item name is is overriden by x-ms-client-name &apos;indexes&apos;. </summary>
/// <param name="nextLink"> The URL to the next page of results. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public Response<ProductResultValueWithXMSClientName> GetPagingModelWithItemNameWithXMSClientNameNextPage(string nextLink, CancellationToken cancellationToken = default)
{
if (nextLink == null)
{
throw new ArgumentNullException(nameof(nextLink));
}
using var message = CreateGetPagingModelWithItemNameWithXMSClientNameNextPageRequest(nextLink);
_pipeline.Send(message, cancellationToken);
switch (message.Response.Status)
{
case 200:
{
ProductResultValueWithXMSClientName value = default;
using var document = JsonDocument.Parse(message.Response.ContentStream);
if (document.RootElement.ValueKind == JsonValueKind.Null)
{
value = null;
}
else
{
value = ProductResultValueWithXMSClientName.DeserializeProductResultValueWithXMSClientName(document.RootElement);
}
return Response.FromValue(value, message.Response);
}
default:
throw _clientDiagnostics.CreateRequestFailedException(message.Response);
}
}
}
}

4
test/TestServerProjects/url/CodeModel.yaml сгенерированный
Просмотреть файл

@ -1377,8 +1377,8 @@ operationGroups:
language: !<!Languages>
default:
name: StringUrlNonEncoded
description: 'Get ''begin!*''();:@&=+$,end'
summary: 'https://tools.ietf.org/html/rfc3986#appendix-A ''path'' accept any ''pchar'' not encoded'
description: 'https://tools.ietf.org/html/rfc3986#appendix-A ''path'' accept any ''pchar'' not encoded'
summary: 'Get ''begin!*''();:@&=+$,end'
protocol: !<!Protocols> {}
- !<!Operation>
apiVersions:

4
test/TestServerProjects/url/Generated/PathsClient.cs сгенерированный
Просмотреть файл

@ -444,7 +444,7 @@ namespace url
}
}
/// <summary> Get &apos;begin!*&apos;();:@&amp;=+$,end. </summary>
/// <summary> https://tools.ietf.org/html/rfc3986#appendix-A &apos;path&apos; accept any &apos;pchar&apos; not encoded. </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> StringUrlNonEncodedAsync(CancellationToken cancellationToken = default)
{
@ -461,7 +461,7 @@ namespace url
}
}
/// <summary> Get &apos;begin!*&apos;();:@&amp;=+$,end. </summary>
/// <summary> https://tools.ietf.org/html/rfc3986#appendix-A &apos;path&apos; accept any &apos;pchar&apos; not encoded. </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response StringUrlNonEncoded(CancellationToken cancellationToken = default)
{

Просмотреть файл

@ -564,7 +564,7 @@ namespace url
return message;
}
/// <summary> Get &apos;begin!*&apos;();:@&amp;=+$,end. </summary>
/// <summary> https://tools.ietf.org/html/rfc3986#appendix-A &apos;path&apos; accept any &apos;pchar&apos; not encoded. </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public async Task<Response> StringUrlNonEncodedAsync(CancellationToken cancellationToken = default)
{
@ -579,7 +579,7 @@ namespace url
}
}
/// <summary> Get &apos;begin!*&apos;();:@&amp;=+$,end. </summary>
/// <summary> https://tools.ietf.org/html/rfc3986#appendix-A &apos;path&apos; accept any &apos;pchar&apos; not encoded. </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public Response StringUrlNonEncoded(CancellationToken cancellationToken = default)
{